Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More cleanup
Browse files Browse the repository at this point in the history
breskeby committed Jan 24, 2024
1 parent 9a04969 commit d99f925
Showing 4 changed files with 45 additions and 20 deletions.
3 changes: 0 additions & 3 deletions x-pack/qa/saml-idp-tests/build.gradle
Original file line number Diff line number Diff line change
@@ -5,12 +5,9 @@ dependencies {
javaRestTestImplementation "com.google.jimfs:jimfs:${versions.jimfs}"
javaRestTestImplementation "com.google.guava:guava:${versions.jimfs_guava}"
javaRestTestImplementation project(":x-pack:test:idp-fixture")
javaRestTestImplementation project(":x-pack:test:idp-fixture")
javaRestTestRuntimeOnly "org.slf4j:slf4j-simple:${versions.slf4j}"
}

tasks.named("javaRestTest").configure {
usesDefaultDistribution()
// explicitly enable using prebaked images
systemProperty "testcontainer.prebaked", "true"
}
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@

public final class IdpTestContainer extends DockerEnvironmentAwareTestContainer {

private static final String PRE_BAKED_IMAGE = "docker.elastic.co/elasticsearch-dev/idp-fixture:1.0";
private static final String DOCKER_BASE_IMAGE = "docker.elastic.co/elasticsearch-dev/idp-fixture:1.0";
private final TemporaryFolder temporaryFolder = new TemporaryFolder();
private Path certsPath;

@@ -33,7 +33,7 @@ protected IdpTestContainer() {

public IdpTestContainer(Network network) {
super(
new ImageFromDockerfile("es-idp-testfixture").withDockerfileFromBuilder(builder -> builder.from(PRE_BAKED_IMAGE).build())
new ImageFromDockerfile("es-idp-testfixture").withDockerfileFromBuilder(builder -> builder.from(DOCKER_BASE_IMAGE).build())
.withFileFromClasspath("idp/jetty-custom/ssl.mod", "/idp/jetty-custom/ssl.mod")
.withFileFromClasspath("idp/jetty-custom/keystore", "/idp/jetty-custom/keystore")
.withFileFromClasspath("idp/shib-jetty-base/", "/idp/shib-jetty-base/")
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@

public final class OpenLdapTestContainer extends DockerEnvironmentAwareTestContainer {

private static final String PRE_BAKED_IMAGE = "docker.elastic.co/elasticsearch-dev/openldap-fixture:1.0";
private static final String DOCKER_BASE_IMAGE = "docker.elastic.co/elasticsearch-dev/openldap-fixture:1.0";

private final TemporaryFolder temporaryFolder = new TemporaryFolder();
private Path certsPath;
@@ -30,7 +30,7 @@ public OpenLdapTestContainer() {

public OpenLdapTestContainer(Network network) {
super(
new ImageFromDockerfile("es-openldap-testfixture").withDockerfileFromBuilder(builder -> builder.from(PRE_BAKED_IMAGE).build())
new ImageFromDockerfile("es-openldap-testfixture").withDockerfileFromBuilder(builder -> builder.from(DOCKER_BASE_IMAGE).build())
.withFileFromClasspath("openldap/certs", "/openldap/certs/")
.withFileFromClasspath("openldap/ldif/users.ldif", "/openldap/ldif/users.ldif")
.withFileFromClasspath("openldap/ldif/config.ldif", "/openldap/ldif/config.ldif")
Original file line number Diff line number Diff line change
@@ -9,14 +9,42 @@

default-init-method="initialize"
default-destroy-method="destroy">

<!-- Metrics enablement / activation. -->

<!--
Register one or more of the built-in system metric sets available.
-->

<bean parent="shibboleth.metrics.RegisterMetricSets">
<property name="arguments">
<list>
<ref bean="shibboleth.metrics.CoreGaugeSet" />
<ref bean="shibboleth.metrics.IdPGaugeSet" />
<ref bean="shibboleth.metrics.LoggingGaugeSet" />
<ref bean="shibboleth.metrics.AccessControlGaugeSet" />
<ref bean="shibboleth.metrics.MetadataGaugeSet" />
<ref bean="shibboleth.metrics.NameIdentifierGaugeSet" />
<ref bean="shibboleth.metrics.RelyingPartyGaugeSet" />
<ref bean="shibboleth.metrics.AttributeResolverGaugeSet" />
<ref bean="shibboleth.metrics.AttributeFilterGaugeSet" />

<!--
<bean class="com.codahale.metrics.jvm.CachedThreadStatesGaugeSet"
c:_0="1" c:_1="#{T(java.util.concurrent.TimeUnit).MINUTES}" />
<bean class="com.codahale.metrics.jvm.ClassLoadingGaugeSet" />
<bean class="com.codahale.metrics.jvm.GarbageCollectorMetricSet" />
<bean class="com.codahale.metrics.jvm.MemoryUsageGaugeSet" />
-->
</list>
</property>
</bean>

<!-- Metrics REST API Configuration -->

<!--
The global metric set is available by default at /idp/profile/admin/metrics
Any pathinfo after that is assumed to identify specific named metrics. You can
create mappings here between a logical "group" name and an implementation of the
com.codahale.metrics.MetricFilter interface to specify which metrics to include.
@@ -32,29 +60,29 @@
<entry key="resolver" value-ref="shibboleth.metrics.AttributeResolverGaugeSet" />
<entry key="filter" value-ref="shibboleth.metrics.AttributeFilterGaugeSet" />
</util:map>

<!-- If you don't specify an alternate access policy, this named policy will be enforced. -->
<bean id="shibboleth.metrics.DefaultAccessPolicy" class="java.lang.String" c:_0="AccessByIPAddress" />

<!--
To override the default access policy, map a metric name or
mapped group above to an alternative policy name.
-->
<util:map id="shibboleth.metrics.AccessPolicyMap">

</util:map>

<!--
In addition to the "pull" REST API for accessing metrics, a "push" reporter is also
available to upload a JSON feed to a URL. The example shown relies on standard JVM
trust configuration for TLS server verification.
The "start" method triggers the timer thread; the example pushes every 30 minutes.
-->
<!--
<bean id="PushReporter" parent="shibboleth.metrics.HTTPReporter" c:name="MyCollector"
p:collectorURL="https://log.example.org/cgi-bin/collector.cgi" />
<bean class="org.springframework.beans.factory.config.MethodInvokingBean"
p:targetObject-ref="PushReporter"
p:targetMethod="start">
@@ -68,15 +96,15 @@
-->

<!-- IdP Metrics Configuration -->

<!--
A bean named shibboleth.metrics.MetricStrategy of type Function<ProfileRequestContext,Boolean>
can be defined to add timers and counters to a large range of objects in the system. Each timer is
defined by a triple (timer name, start object, stop object). Counters are just object/counter pairs.
The most common example is to start a timer when a particular flow action bean starts and
stop it when the same or different action bean stops, to measure how long the execution takes.
If you want to leave a timer in place but disabled to prevent overhead, you can turn off a
logging category named "metrics.<timername>" in your logging configuration.
-->
@@ -90,12 +118,12 @@
metricCtx.addTimer("idp.attribute.resolution",
"ResolveAttributes",
"FilterAttributes"
);
);
true; // Signals success.
]]>
</value>
</constructor-arg>
</bean>
-->

</beans>

0 comments on commit d99f925

Please sign in to comment.