Skip to content

Commit 308dab6

Browse files
authored
Review fixes for spring-security-config-6.0:javaagent (#17741)
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
1 parent 4f3fd0e commit 308dab6

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

instrumentation/spring/spring-security-config-6.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/security/config/v6_0/EnduserAttributesCapturerSingletons.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313

1414
public class EnduserAttributesCapturerSingletons {
1515

16-
private static final EnduserAttributesCapturer ENDUSER_ATTRIBUTES_CAPTURER =
16+
private static final EnduserAttributesCapturer enduserAttributesCapturer =
1717
createEndUserAttributesCapturerFromConfig();
1818

1919
private EnduserAttributesCapturerSingletons() {}
2020

2121
public static EnduserAttributesCapturer enduserAttributesCapturer() {
22-
return ENDUSER_ATTRIBUTES_CAPTURER;
22+
return enduserAttributesCapturer;
2323
}
2424

2525
private static EnduserAttributesCapturer createEndUserAttributesCapturerFromConfig() {

instrumentation/spring/spring-security-config-6.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/security/config/v6_0/servlet/SpringSecurityConfigServletInstrumentationModule.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
4848
* since Spring Security >= 6.0 uses Jakarta EE rather than Java EE,
4949
* and this instrumentation module uses Jakarta EE.
5050
*/
51+
// added in 6.0
5152
return hasClassesNamed(
5253
"org.springframework.security.authentication.ObservationAuthenticationManager");
5354
}

instrumentation/spring/spring-security-config-6.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/spring/security/config/v6_0/webflux/SpringSecurityConfigWebFluxInstrumentationModule.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,13 @@ public SpringSecurityConfigWebFluxInstrumentationModule() {
2929

3030
@Override
3131
public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
32-
// Ensure this module is only applied to Spring Security >= 6.0. This instrumentation might
33-
// work with older versions of Spring Security, but since it is bundled together with the
34-
// servlet based instrumentation, that does not work with oder versions, we also limit this
35-
// module to only work with Spring Security >= 6.0.
32+
/*
33+
* Ensure this module is only applied to Spring Security >= 6.0. This instrumentation might
34+
* work with older versions of Spring Security, but since it is bundled together with the
35+
* servlet-based instrumentation, which does not work with older versions, we also limit this
36+
* module to only work with Spring Security >= 6.0.
37+
*/
38+
// added in 6.0
3639
return hasClassesNamed(
3740
"org.springframework.security.authentication.ObservationAuthenticationManager");
3841
}

0 commit comments

Comments
 (0)