Skip to content

Commit 489450b

Browse files
committed
automated code format cleanup
1 parent edda021 commit 489450b

File tree

117 files changed

+1023
-1020
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+1023
-1020
lines changed

openid-connect-client/src/main/java/org/mitre/oauth2/introspectingfilter/IntrospectingTokenService.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ public class IntrospectingTokenService implements ResourceServerTokenServices {
6868
private IntrospectionConfigurationService introspectionConfigurationService;
6969
private IntrospectionAuthorityGranter introspectionAuthorityGranter = new SimpleIntrospectionAuthorityGranter();
7070

71-
private int defaultExpireTime = 300000; // 5 minutes in milliseconds
71+
private int defaultExpireTime = 300000; // 5 minutes in milliseconds
7272
private boolean forceCacheExpireTime = false; // force removal of cached tokens based on default expire time
7373
private boolean cacheNonExpiringTokens = false;
7474
private boolean cacheTokens = true;
75-
75+
7676
private HttpClient httpClient = HttpClientBuilder.create()
7777
.useSystemProperties()
7878
.build();
@@ -83,15 +83,15 @@ private class TokenCacheObject {
8383
OAuth2AccessToken token;
8484
OAuth2Authentication auth;
8585
Date cacheExpire;
86-
86+
8787
private TokenCacheObject(OAuth2AccessToken token, OAuth2Authentication auth) {
8888
this.token = token;
8989
this.auth = auth;
90-
90+
9191
// we don't need to check the cacheTokens values, because this won't actually be added to the cache if cacheTokens is false
9292
// if the token isn't null we use the token expire time
9393
// if forceCacheExpireTime is also true, we also make sure that the token expire time is shorter than the default expire time
94-
if ((this.token.getExpiration() != null) && (!forceCacheExpireTime || (forceCacheExpireTime && (this.token.getExpiration().getTime() - System.currentTimeMillis() <= defaultExpireTime)))) {
94+
if ((this.token.getExpiration() != null) && (!forceCacheExpireTime || (forceCacheExpireTime && (this.token.getExpiration().getTime() - System.currentTimeMillis() <= defaultExpireTime)))) {
9595
this.cacheExpire = this.token.getExpiration();
9696
} else { // if the token doesn't have an expire time, or if the using forceCacheExpireTime the token expire time is longer than the default, then use the default expire time
9797
Calendar cal = Calendar.getInstance();
@@ -150,7 +150,7 @@ public int getDefaultExpireTime() {
150150
public void setDefaultExpireTime(int defaultExpireTime) {
151151
this.defaultExpireTime = defaultExpireTime;
152152
}
153-
153+
154154
/**
155155
* check if forcing a cache expire time maximum value
156156
* @return the forceCacheExpireTime setting
@@ -198,10 +198,10 @@ public boolean isCacheTokens() {
198198
public void setCacheTokens(boolean cacheTokens) {
199199
this.cacheTokens = cacheTokens;
200200
}
201-
201+
202202
/**
203203
* Check to see if the introspection end point response for a token has been cached locally
204-
* This call will return the token if it has been cached and is still valid according to
204+
* This call will return the token if it has been cached and is still valid according to
205205
* the cache expire time on the TokenCacheObject. If a cached value has been found but is
206206
* expired, either by default expire times or the token's own expire time, then the token is
207207
* removed from the cache and null is returned.
@@ -211,7 +211,7 @@ public void setCacheTokens(boolean cacheTokens) {
211211
private TokenCacheObject checkCache(String key) {
212212
if (cacheTokens && authCache.containsKey(key)) {
213213
TokenCacheObject tco = authCache.get(key);
214-
214+
215215
if (tco != null && tco.cacheExpire != null && tco.cacheExpire.after(new Date())) {
216216
return tco;
217217
} else {
@@ -246,7 +246,7 @@ private OAuth2AccessToken createAccessToken(final JsonObject token, final String
246246

247247
/**
248248
* Validate a token string against the introspection endpoint,
249-
* then parse it and store it in the local cache if caching is enabled.
249+
* then parse it and store it in the local cache if caching is enabled.
250250
*
251251
* @param accessToken Token to pass to the introspection endpoint
252252
* @return TokenCacheObject containing authentication and token if the token was valid, otherwise null

openid-connect-client/src/main/java/org/mitre/openid/connect/client/NamedAdminAuthoritiesMapper.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
public class NamedAdminAuthoritiesMapper implements OIDCAuthoritiesMapper {
4646

4747
private static Logger logger = LoggerFactory.getLogger(NamedAdminAuthoritiesMapper.class);
48-
48+
4949
private static final SimpleGrantedAuthority ROLE_ADMIN = new SimpleGrantedAuthority("ROLE_ADMIN");
5050
private static final SimpleGrantedAuthority ROLE_USER = new SimpleGrantedAuthority("ROLE_USER");
5151

@@ -57,17 +57,17 @@ public Collection<? extends GrantedAuthority> mapAuthorities(JWT idToken, UserIn
5757
Set<GrantedAuthority> out = new HashSet<>();
5858
try {
5959
ReadOnlyJWTClaimsSet claims = idToken.getJWTClaimsSet();
60-
60+
6161
SubjectIssuerGrantedAuthority authority = new SubjectIssuerGrantedAuthority(claims.getSubject(), claims.getIssuer());
6262
out.add(authority);
6363

6464
if (admins.contains(authority)) {
6565
out.add(ROLE_ADMIN);
6666
}
67-
67+
6868
// everybody's a user by default
6969
out.add(ROLE_USER);
70-
70+
7171
} catch (ParseException e) {
7272
logger.error("Unable to parse ID Token inside of authorities mapper (huh?)");
7373
}

openid-connect-client/src/main/java/org/mitre/openid/connect/client/OIDCAuthenticationFilter.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,8 @@ protected Authentication handleAuthorizationCodeResponse(HttpServletRequest requ
333333
protected ClientHttpRequest createRequest(URI url, HttpMethod method) throws IOException {
334334
ClientHttpRequest httpRequest = super.createRequest(url, method);
335335
httpRequest.getHeaders().add("Authorization",
336-
String.format("Basic %s", Base64.encode(String.format("%s:%s",
337-
UriUtils.encodePathSegment(clientConfig.getClientId(), "UTF-8"),
336+
String.format("Basic %s", Base64.encode(String.format("%s:%s",
337+
UriUtils.encodePathSegment(clientConfig.getClientId(), "UTF-8"),
338338
UriUtils.encodePathSegment(clientConfig.getClientSecret(), "UTF-8")))));
339339

340340
return httpRequest;
@@ -581,10 +581,10 @@ protected ClientHttpRequest createRequest(URI url, HttpMethod method) throws IOE
581581

582582
// construct an PendingOIDCAuthenticationToken and return a Authentication object w/the userId and the idToken
583583

584-
PendingOIDCAuthenticationToken token = new PendingOIDCAuthenticationToken(idClaims.getSubject(), idClaims.getIssuer(),
585-
serverConfig,
584+
PendingOIDCAuthenticationToken token = new PendingOIDCAuthenticationToken(idClaims.getSubject(), idClaims.getIssuer(),
585+
serverConfig,
586586
idToken, accessTokenValue, refreshTokenValue);
587-
587+
588588
Authentication authentication = this.getAuthenticationManager().authenticate(token);
589589

590590
return authentication;

openid-connect-client/src/main/java/org/mitre/openid/connect/client/OIDCAuthenticationProvider.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
public class OIDCAuthenticationProvider implements AuthenticationProvider {
4040

4141
private static Logger logger = LoggerFactory.getLogger(OIDCAuthenticationProvider.class);
42-
42+
4343
private UserInfoFetcher userInfoFetcher = new UserInfoFetcher();
4444

4545
private OIDCAuthoritiesMapper authoritiesMapper = new NamedAdminAuthoritiesMapper();
@@ -60,15 +60,15 @@ public Authentication authenticate(final Authentication authentication) throws A
6060
if (authentication instanceof PendingOIDCAuthenticationToken) {
6161

6262
PendingOIDCAuthenticationToken token = (PendingOIDCAuthenticationToken) authentication;
63-
63+
6464
// get the ID Token value out
6565
JWT idToken = token.getIdToken();
6666

6767
// load the user info if we can
6868
UserInfo userInfo = userInfoFetcher.loadUserInfo(token);
6969

7070
if (userInfo == null) {
71-
// user info not found -- could be an error, could be fine
71+
// user info not found -- could be an error, could be fine
7272
} else {
7373
// if we found userinfo, double check it
7474
if (!Strings.isNullOrEmpty(userInfo.getSub()) && !userInfo.getSub().equals(token.getSub())) {

openid-connect-client/src/main/java/org/mitre/openid/connect/client/OIDCAuthoritiesMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public interface OIDCAuthoritiesMapper {
3232

3333
/**
3434
* @param idToken the ID Token (parsed as a JWT, cannot be @null)
35-
* @param userInfo userInfo of the current user (could be @null)
35+
* @param userInfo userInfo of the current user (could be @null)
3636
* @return the set of authorities to map to this user
3737
*/
3838
Collection<? extends GrantedAuthority> mapAuthorities(JWT idToken, UserInfo userInfo);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public interface AuthRequestOptionsService {
4646
* @return
4747
*/
4848
public Map<String, String> getOptions(ServerConfiguration server, RegisteredClient client, HttpServletRequest request);
49-
49+
5050
/**
5151
* The set of options needed at the token endpoint.
5252
*

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import org.mitre.openid.connect.config.ServerConfiguration;
2626

2727
/**
28-
* Builds a URL string to the IdP's authorization endpoint.
28+
* Builds a URL string to the IdP's authorization endpoint.
2929
*
3030
* @author jricher
3131
*
@@ -38,7 +38,7 @@ public interface AuthRequestUrlBuilder {
3838
* @param redirectUri
3939
* @param nonce
4040
* @param state
41-
* @param loginHint
41+
* @param loginHint
4242
* @return
4343
*/
4444
public String buildAuthRequestUrl(ServerConfiguration serverConfig, RegisteredClient clientConfig, String redirectUri, String nonce, String state, Map<String, String> options, String loginHint);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public String buildAuthRequestUrl(ServerConfiguration serverConfig, RegisteredCl
7878
for (Entry<String, String> option : options.entrySet()) {
7979
claims.setClaim(option.getKey(), option.getValue());
8080
}
81-
81+
8282
// if there's a login hint, send it
8383
if (!Strings.isNullOrEmpty(loginHint)) {
8484
claims.setClaim("login_hint", loginHint);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public String buildAuthRequestUrl(ServerConfiguration serverConfig, RegisteredCl
6363
for (Entry<String, String> option : options.entrySet()) {
6464
uriBuilder.addParameter(option.getKey(), option.getValue());
6565
}
66-
66+
6767
// if there's a login hint, send it
6868
if (!Strings.isNullOrEmpty(loginHint)) {
6969
uriBuilder.addParameter("login_hint", loginHint);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public String buildAuthRequestUrl(ServerConfiguration serverConfig, RegisteredCl
7272
for (Entry<String, String> option : options.entrySet()) {
7373
claims.setClaim(option.getKey(), option.getValue());
7474
}
75-
75+
7676
// if there's a login hint, send it
7777
if (!Strings.isNullOrEmpty(loginHint)) {
7878
claims.setClaim("login_hint", loginHint);

0 commit comments

Comments
 (0)