Add hints to invoke SecurityContextImpl#getAuthentication

Closes gh-11987
This commit is contained in:
Marcus Da Coregio
2022-10-13 09:06:16 -03:00
parent 6026f9f70f
commit db7f52db4e
2 changed files with 14 additions and 0 deletions

View File

@@ -49,6 +49,7 @@ import org.springframework.security.authentication.event.AuthenticationFailurePr
import org.springframework.security.authentication.event.AuthenticationFailureProxyUntrustedEvent;
import org.springframework.security.authentication.event.AuthenticationFailureServiceExceptionEvent;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.context.SecurityContextImpl;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.util.ClassUtils;
@@ -137,4 +138,10 @@ class CoreSecurityRuntimeHintsTests {
.forResource("org/springframework/security/core/userdetails/jdbc/users.ddl")).accepts(this.hints);
}
@Test
void securityContextHasHints() {
assertThat(RuntimeHintsPredicates.reflection().onType(SecurityContextImpl.class)
.withMemberCategories(MemberCategory.INVOKE_PUBLIC_METHODS)).accepts(this.hints);
}
}