1
0
mirror of synced 2026-05-22 21:33:16 +00:00

Apply Nullability to spring-security-data

This commit is contained in:
Rob Winch
2025-08-21 13:27:47 -05:00
parent 9bbf837c7c
commit bbcdb23698
2 changed files with 8 additions and 2 deletions
+4
View File
@@ -1,3 +1,7 @@
plugins {
id 'security-nullability'
}
apply plugin: 'io.spring.convention.spring-module'
dependencies {
@@ -29,6 +29,8 @@ import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.context.SecurityContextHolderStrategy;
import org.springframework.util.Assert;
import org.jspecify.annotations.Nullable;
import org.jspecify.annotations.NullUnmarked;
/**
* <p>
@@ -93,7 +95,7 @@ public class SecurityEvaluationContextExtension implements EvaluationContextExte
private SecurityContextHolderStrategy securityContextHolderStrategy = SecurityContextHolder
.getContextHolderStrategy();
private Authentication authentication;
private @Nullable Authentication authentication;
private AuthenticationTrustResolver trustResolver = new AuthenticationTrustResolverImpl();
@@ -146,7 +148,7 @@ public class SecurityEvaluationContextExtension implements EvaluationContextExte
this.securityContextHolderStrategy = securityContextHolderStrategy;
}
private Authentication getAuthentication() {
private @Nullable Authentication getAuthentication() {
if (this.authentication != null) {
return this.authentication;
}