Skip to content

Commit e53f90b

Browse files
committed
Add nullability annotations to module/spring-boot-security-oauth2-authorization-server
See gh-46587
1 parent f82da97 commit e53f90b

File tree

2 files changed

+24
-18
lines changed

2 files changed

+24
-18
lines changed

module/spring-boot-security-oauth2-authorization-server/src/main/java/org/springframework/boot/security/oauth2/server/authorization/autoconfigure/servlet/OAuth2AuthorizationServerProperties.java

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import java.util.Map;
2323
import java.util.Set;
2424

25+
import org.jspecify.annotations.Nullable;
26+
2527
import org.springframework.beans.factory.InitializingBean;
2628
import org.springframework.boot.context.properties.ConfigurationProperties;
2729
import org.springframework.boot.context.properties.NestedConfigurationProperty;
@@ -41,7 +43,7 @@ public class OAuth2AuthorizationServerProperties implements InitializingBean {
4143
/**
4244
* URL of the Authorization Server's Issuer Identifier.
4345
*/
44-
private String issuer;
46+
private @Nullable String issuer;
4547

4648
/**
4749
* Whether multiple issuers are allowed per host. Using path components in the URL of
@@ -68,11 +70,11 @@ public void setMultipleIssuersAllowed(boolean multipleIssuersAllowed) {
6870
this.multipleIssuersAllowed = multipleIssuersAllowed;
6971
}
7072

71-
public String getIssuer() {
73+
public @Nullable String getIssuer() {
7274
return this.issuer;
7375
}
7476

75-
public void setIssuer(String issuer) {
77+
public void setIssuer(@Nullable String issuer) {
7678
this.issuer = issuer;
7779
}
7880

@@ -297,14 +299,14 @@ public static class Client {
297299
/**
298300
* URL for the client's JSON Web Key Set.
299301
*/
300-
private String jwkSetUri;
302+
private @Nullable String jwkSetUri;
301303

302304
/**
303305
* JWS algorithm that must be used for signing the JWT used to authenticate the
304306
* client at the Token Endpoint for the {@code private_key_jwt} and
305307
* {@code client_secret_jwt} authentication methods.
306308
*/
307-
private String tokenEndpointAuthenticationSigningAlgorithm;
309+
private @Nullable String tokenEndpointAuthenticationSigningAlgorithm;
308310

309311
/**
310312
* Token settings of the registered client.
@@ -332,19 +334,20 @@ public void setRequireAuthorizationConsent(boolean requireAuthorizationConsent)
332334
this.requireAuthorizationConsent = requireAuthorizationConsent;
333335
}
334336

335-
public String getJwkSetUri() {
337+
public @Nullable String getJwkSetUri() {
336338
return this.jwkSetUri;
337339
}
338340

339-
public void setJwkSetUri(String jwkSetUri) {
341+
public void setJwkSetUri(@Nullable String jwkSetUri) {
340342
this.jwkSetUri = jwkSetUri;
341343
}
342344

343-
public String getTokenEndpointAuthenticationSigningAlgorithm() {
345+
public @Nullable String getTokenEndpointAuthenticationSigningAlgorithm() {
344346
return this.tokenEndpointAuthenticationSigningAlgorithm;
345347
}
346348

347-
public void setTokenEndpointAuthenticationSigningAlgorithm(String tokenEndpointAuthenticationSigningAlgorithm) {
349+
public void setTokenEndpointAuthenticationSigningAlgorithm(
350+
@Nullable String tokenEndpointAuthenticationSigningAlgorithm) {
348351
this.tokenEndpointAuthenticationSigningAlgorithm = tokenEndpointAuthenticationSigningAlgorithm;
349352
}
350353

@@ -362,17 +365,17 @@ public static class Registration {
362365
/**
363366
* Client ID of the registration.
364367
*/
365-
private String clientId;
368+
private @Nullable String clientId;
366369

367370
/**
368371
* Client secret of the registration. May be left blank for a public client.
369372
*/
370-
private String clientSecret;
373+
private @Nullable String clientSecret;
371374

372375
/**
373376
* Name of the client.
374377
*/
375-
private String clientName;
378+
private @Nullable String clientName;
376379

377380
/**
378381
* Client authentication method(s) that the client may use.
@@ -399,27 +402,27 @@ public static class Registration {
399402
*/
400403
private Set<String> scopes = new HashSet<>();
401404

402-
public String getClientId() {
405+
public @Nullable String getClientId() {
403406
return this.clientId;
404407
}
405408

406-
public void setClientId(String clientId) {
409+
public void setClientId(@Nullable String clientId) {
407410
this.clientId = clientId;
408411
}
409412

410-
public String getClientSecret() {
413+
public @Nullable String getClientSecret() {
411414
return this.clientSecret;
412415
}
413416

414-
public void setClientSecret(String clientSecret) {
417+
public void setClientSecret(@Nullable String clientSecret) {
415418
this.clientSecret = clientSecret;
416419
}
417420

418-
public String getClientName() {
421+
public @Nullable String getClientName() {
419422
return this.clientName;
420423
}
421424

422-
public void setClientName(String clientName) {
425+
public void setClientName(@Nullable String clientName) {
423426
this.clientName = clientName;
424427
}
425428

module/spring-boot-security-oauth2-authorization-server/src/main/java/org/springframework/boot/security/oauth2/server/authorization/autoconfigure/servlet/package-info.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,7 @@
1717
/**
1818
* Auto-configuration for Spring Security's OAuth2 authorization server.
1919
*/
20+
@NullMarked
2021
package org.springframework.boot.security.oauth2.server.authorization.autoconfigure.servlet;
22+
23+
import org.jspecify.annotations.NullMarked;

0 commit comments

Comments
 (0)