Skip to content

Commit fb2f2f9

Browse files
author
Justin Richer
committed
spelling, property access, and cleanup
1 parent 2ca713c commit fb2f2f9

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

openid-connect-client/src/main/java/org/mitre/openid/connect/client/service/impl/EncryptedAuthRequestUrlBuilder.java

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,16 @@
1919
import com.nimbusds.jose.EncryptionMethod;
2020
import com.nimbusds.jose.JWEAlgorithm;
2121
import com.nimbusds.jose.JWEHeader;
22-
import com.nimbusds.jose.JWSHeader;
2322
import com.nimbusds.jwt.EncryptedJWT;
2423
import com.nimbusds.jwt.JWTClaimsSet;
25-
import com.nimbusds.jwt.SignedJWT;
2624

2725
/**
2826
* @author jricher
2927
*
3028
*/
3129
public class EncryptedAuthRequestUrlBuilder implements AuthRequestUrlBuilder {
3230

33-
private JWKSetCacheService encryptors;
31+
private JWKSetCacheService encrypterService;
3432

3533
/* (non-Javadoc)
3634
* @see org.mitre.openid.connect.client.service.AuthRequestUrlBuilder#buildAuthRequestUrl(org.mitre.openid.connect.config.ServerConfiguration, org.mitre.oauth2.model.RegisteredClient, java.lang.String, java.lang.String, java.lang.String, java.util.Map)
@@ -77,7 +75,7 @@ public String buildAuthRequestUrl(ServerConfiguration serverConfig, RegisteredCl
7775

7876
EncryptedJWT jwt = new EncryptedJWT(new JWEHeader(alg, enc), claims);
7977

80-
JwtEncryptionAndDecryptionService encryptor = encryptors.getEncrypter(serverConfig.getJwksUri());
78+
JwtEncryptionAndDecryptionService encryptor = encrypterService.getEncrypter(serverConfig.getJwksUri());
8179

8280
encryptor.encryptJwt(jwt);
8381

@@ -92,4 +90,18 @@ public String buildAuthRequestUrl(ServerConfiguration serverConfig, RegisteredCl
9290
}
9391
}
9492

93+
/**
94+
* @return the encrypterService
95+
*/
96+
public JWKSetCacheService getEncrypterService() {
97+
return encrypterService;
98+
}
99+
100+
/**
101+
* @param encrypterService the encrypterService to set
102+
*/
103+
public void setEncrypterService(JWKSetCacheService encrypterService) {
104+
this.encrypterService = encrypterService;
105+
}
106+
95107
}

openid-connect-common/src/main/java/org/mitre/jwt/signer/service/impl/JWKSetCacheService.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
/**
4343
*
44-
* Creates a caching map of JOSE signers/validators and encryptors/decryptors
44+
* Creates a caching map of JOSE signers/validators and encrypters/decryptors
4545
* keyed on the JWK Set URI. Dynamically loads JWK Sets to create the services.
4646
*
4747
* @author jricher
@@ -56,14 +56,14 @@ public class JWKSetCacheService {
5656
private LoadingCache<String, JwtSigningAndValidationService> validators;
5757

5858
// map of jwk set uri -> encryption/decryption service built on the keys found in that jwk set
59-
private LoadingCache<String, JwtEncryptionAndDecryptionService> encryptors;
59+
private LoadingCache<String, JwtEncryptionAndDecryptionService> encrypters;
6060

6161
public JWKSetCacheService() {
6262
this.validators = CacheBuilder.newBuilder()
6363
.expireAfterWrite(1, TimeUnit.HOURS) // expires 1 hour after fetch
6464
.maximumSize(100)
6565
.build(new JWKSetVerifierFetcher());
66-
this.encryptors = CacheBuilder.newBuilder()
66+
this.encrypters = CacheBuilder.newBuilder()
6767
.expireAfterWrite(1, TimeUnit.HOURS) // expires 1 hour after fetch
6868
.maximumSize(100)
6969
.build(new JWKSetEncryptorFetcher());
@@ -86,7 +86,7 @@ public JwtSigningAndValidationService getValidator(String jwksUri) {
8686

8787
public JwtEncryptionAndDecryptionService getEncrypter(String jwksUri) {
8888
try {
89-
return encryptors.get(jwksUri);
89+
return encrypters.get(jwksUri);
9090
} catch (ExecutionException e) {
9191
logger.warn("Couldn't load JWK Set from " + jwksUri, e);
9292
return null;

0 commit comments

Comments
 (0)