Skip to content

Commit 408afc9

Browse files
committed
revert
1 parent 47a5056 commit 408afc9

2 files changed

Lines changed: 1 addition & 28 deletions

File tree

instrumentation/spring/spring-security-config-6.0/library/src/main/java/io/opentelemetry/instrumentation/spring/security/config/v6_0/EnduserAttributesCapturer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public void captureEnduserAttributes(
8282
StringBuilder scopeBuilder = null;
8383
if (enduserRoleEnabled || enduserScopeEnabled) {
8484
for (GrantedAuthority authority : authentication.getAuthorities()) {
85-
@Nullable String authorityString = authority.getAuthority();
85+
String authorityString = authority.getAuthority();
8686
if (authorityString == null) {
8787
continue;
8888
}

instrumentation/spring/spring-security-config-6.0/library/src/test/java/io/opentelemetry/instrumentation/spring/security/config/v6_0/EnduserAttributesCapturerTest.java

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import org.junit.jupiter.api.Test;
2222
import org.junit.jupiter.api.extension.RegisterExtension;
2323
import org.springframework.security.core.Authentication;
24-
import org.springframework.security.core.GrantedAuthority;
2524
import org.springframework.security.core.authority.SimpleGrantedAuthority;
2625
import org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationToken;
2726

@@ -202,32 +201,6 @@ void allEnabledAndAlternatePrefix() {
202201
.hasAttribute(ENDUSER_SCOPE, "scope1,scope2"));
203202
}
204203

205-
@Test
206-
void allEnabledAndNullAuthority() {
207-
EnduserAttributesCapturer capturer = new EnduserAttributesCapturer();
208-
capturer.setEnduserIdEnabled(true);
209-
capturer.setEnduserRoleEnabled(true);
210-
capturer.setEnduserScopeEnabled(true);
211-
212-
GrantedAuthority nullAuthority = () -> null;
213-
Authentication authentication =
214-
new PreAuthenticatedAuthenticationToken(
215-
"principal",
216-
null,
217-
asList(
218-
new SimpleGrantedAuthority("ROLE_role1"),
219-
nullAuthority,
220-
new SimpleGrantedAuthority("SCOPE_scope1")));
221-
222-
test(
223-
capturer,
224-
authentication,
225-
span ->
226-
span.hasAttribute(ENDUSER_ID, "principal")
227-
.hasAttribute(ENDUSER_ROLE, "role1")
228-
.hasAttribute(ENDUSER_SCOPE, "scope1"));
229-
}
230-
231204
private static void test(
232205
EnduserAttributesCapturer capturer,
233206
Authentication authentication,

0 commit comments

Comments
 (0)