Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mitreid-connect/OpenID-Connect-Java-Spring-Server
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: dfcoffin/OpenID-Connect-Java-Spring-Server
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 2 commits
  • 423 files changed
  • 1 contributor

Commits on Feb 18, 2021

  1. Polish

    dfcoffin committed Feb 18, 2021
    Copy the full SHA
    3051a2b View commit details
  2. Fix merge conflict

    dfcoffin committed Feb 18, 2021
    Copy the full SHA
    7b32f58 View commit details
Showing 423 changed files with 41,767 additions and 39,198 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -9,6 +9,6 @@ end_of_line = lf
insert_final_newline = true

# 4 space - Tab indentation
[*.{java,xml,js,html}]
[*.{java, xml, js, html}]
indent_style = tab
indent_size = 4
22 changes: 11 additions & 11 deletions checkstyle.xml
Original file line number Diff line number Diff line change
@@ -17,8 +17,8 @@
limitations under the License.
-->
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">

<!-- This is a checkstyle configuration file. For descriptions of what the
following rules do, please see the checkstyle configuration page at http://checkstyle.sourceforge.net/config.html -->
@@ -100,7 +100,7 @@
<property name="applyToPrivate" value="false"/>
<property name="format" value="^([A-Z][A-Z0-9]*(_[A-Z0-9]+)*|FLAG_.*)$"/>
<message key="name.invalidPattern"
value="Variable ''{0}'' should be in ALL_CAPS (if it is a constant) or be private (otherwise)."/>
value="Variable ''{0}'' should be in ALL_CAPS (if it is a constant) or be private (otherwise)."/>
<property name="severity" value="warning"/>
</module>

@@ -157,16 +157,16 @@
<module name="LineLength">
<!-- Checks if a line is too long. -->
<property name="max"
value="${com.puppycrawl.tools.checkstyle.checks.sizes.LineLength.max}"
default="250"/>
value="${com.puppycrawl.tools.checkstyle.checks.sizes.LineLength.max}"
default="250"/>
<property name="severity" value="warning"/>

<!-- The default ignore pattern exempts the following elements: - import
statements - long URLs inside comments -->

<property name="ignorePattern"
value="${com.puppycrawl.tools.checkstyle.checks.sizes.LineLength.ignorePattern}"
default="^(package .*;\s*)|(import .*;\s*)|( *\* *https?://.*)$"/>
value="${com.puppycrawl.tools.checkstyle.checks.sizes.LineLength.ignorePattern}"
default="^(package .*;\s*)|(import .*;\s*)|( *\* *https?://.*)$"/>
</module>

<module name="LeftCurly">
@@ -186,7 +186,7 @@
<module name="NeedBraces">
<property name="severity" value="warning"/>
<property name="tokens"
value="LITERAL_IF, LITERAL_ELSE, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO"/>
value="LITERAL_IF, LITERAL_ELSE, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO"/>
</module>

<module name="UpperEll">
@@ -200,7 +200,7 @@
on the last non-blank line preceding the fallen-into case contains 'fall
through' (or some other variants which we don't publicized to promote consistency). -->
<property name="reliefPattern"
value="fall through|Fall through|fallthru|Fallthru|falls through|Falls through|fallthrough|Fallthrough|No break|NO break|no break|continue on"/>
value="fall through|Fall through|fallthru|Fallthru|falls through|Falls through|fallthrough|Fallthrough|No break|NO break|no break|continue on"/>
<property name="severity" value="error"/>
</module>

@@ -275,7 +275,7 @@
<!-- Checks that various tokens are surrounded by whitespace. This includes
most binary operators and keywords followed by regular or curly braces. -->
<property name="tokens"
value="ASSIGN, BAND, BAND_ASSIGN, BOR,
value="ASSIGN, BAND, BAND_ASSIGN, BOR,
BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN,
EQUAL, GE, GT, LAND, LE, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE,
LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN,
@@ -295,7 +295,7 @@
<!-- Checks that there is no whitespace after various unary operators.
Linebreaks are allowed. -->
<property name="tokens"
value="BNOT, DEC, DOT, INC, LNOT, UNARY_MINUS, UNARY_PLUS"/>
value="BNOT, DEC, DOT, INC, LNOT, UNARY_MINUS, UNARY_PLUS"/>
<property name="allowLineBreaks" value="true"/>
<property name="severity" value="warning"/>
</module>
3 changes: 2 additions & 1 deletion openid-connect-client/pom.xml
Original file line number Diff line number Diff line change
@@ -16,7 +16,8 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>
<parent>
Original file line number Diff line number Diff line change
@@ -61,8 +61,8 @@
* This ResourceServerTokenServices implementation introspects incoming tokens at a
* server's introspection endpoint URL and passes an Authentication object along
* based on the response from the introspection endpoint.
* @author jricher
*
* @author jricher
*/
public class IntrospectingTokenService implements ResourceServerTokenServices {

@@ -143,6 +143,7 @@ public IntrospectionAuthorityGranter getIntrospectionAuthorityGranter() {

/**
* get the default cache expire time in milliseconds
*
* @return
*/
public int getDefaultExpireTime() {
@@ -151,6 +152,7 @@ public int getDefaultExpireTime() {

/**
* set the default cache expire time in milliseconds
*
* @param defaultExpireTime
*/
public void setDefaultExpireTime(int defaultExpireTime) {
@@ -159,6 +161,7 @@ public void setDefaultExpireTime(int defaultExpireTime) {

/**
* check if forcing a cache expire time maximum value
*
* @return the forceCacheExpireTime setting
*/
public boolean isForceCacheExpireTime() {
@@ -167,6 +170,7 @@ public boolean isForceCacheExpireTime() {

/**
* set forcing a cache expire time maximum value
*
* @param forceCacheExpireTime
*/
public void setForceCacheExpireTime(boolean forceCacheExpireTime) {
@@ -175,6 +179,7 @@ public void setForceCacheExpireTime(boolean forceCacheExpireTime) {

/**
* Are non-expiring tokens cached using the default cache time
*
* @return state of cacheNonExpiringTokens
*/
public boolean isCacheNonExpiringTokens() {
@@ -183,6 +188,7 @@ public boolean isCacheNonExpiringTokens() {

/**
* should non-expiring tokens be cached using the default cache timeout
*
* @param cacheNonExpiringTokens
*/
public void setCacheNonExpiringTokens(boolean cacheNonExpiringTokens) {
@@ -191,6 +197,7 @@ public void setCacheNonExpiringTokens(boolean cacheNonExpiringTokens) {

/**
* Is the service caching tokens, or is it hitting the introspection end point every time
*
* @return true is caching tokens locally, false hits the introspection end point every time
*/
public boolean isCacheTokens() {
@@ -199,6 +206,7 @@ public boolean isCacheTokens() {

/**
* Configure if the client should cache tokens locally or not
*
* @param cacheTokens
*/
public void setCacheTokens(boolean cacheTokens) {
@@ -211,6 +219,7 @@ public void setCacheTokens(boolean cacheTokens) {
* the cache expire time on the TokenCacheObject. If a cached value has been found but is
* expired, either by default expire times or the token's own expire time, then the token is
* removed from the cache and null is returned.
*
* @param key is the token to check
* @return the cached TokenCacheObject or null
*/
@@ -243,7 +252,7 @@ private OAuth2Request createStoredRequest(final JsonObject token) {

private Authentication createUserAuthentication(JsonObject token) {
JsonElement userId = token.get("user_id");
if(userId == null) {
if (userId == null) {
userId = token.get("sub");
if (userId == null) {
return null;
@@ -287,15 +296,15 @@ private TokenCacheObject parseToken(String accessToken) {
final String clientId = client.getClientId();
final String clientSecret = client.getClientSecret();

if (SECRET_BASIC.equals(client.getTokenEndpointAuthMethod())){
if (SECRET_BASIC.equals(client.getTokenEndpointAuthMethod())) {
// use BASIC auth if configured to do so
restTemplate = new RestTemplate(factory) {

@Override
protected ClientHttpRequest createRequest(URI url, HttpMethod method) throws IOException {
ClientHttpRequest httpRequest = super.createRequest(url, method);
httpRequest.getHeaders().add("Authorization",
String.format("Basic %s", Base64.encode(String.format("%s:%s", clientId, clientSecret)) ));
String.format("Basic %s", Base64.encode(String.format("%s:%s", clientId, clientSecret))));
return httpRequest;
}
};
Original file line number Diff line number Diff line change
@@ -88,7 +88,7 @@ public Date getExpiration() {
@Override
public int getExpiresIn() {
if (expireDate != null) {
return (int)TimeUnit.MILLISECONDS.toSeconds(expireDate.getTime() - (new Date()).getTime());
return (int) TimeUnit.MILLISECONDS.toSeconds(expireDate.getTime() - (new Date()).getTime());
}
return 0;
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/*******************************************************************************
/**
* Copyright 2018 The MIT Internet Trust Consortium
*
* <p>
* Portions copyright 2011-2013 The MITRE Corporation
*
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
*/
/**
*
*/
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/*******************************************************************************
/**
* Copyright 2018 The MIT Internet Trust Consortium
*
* <p>
* Portions copyright 2011-2013 The MITRE Corporation
*
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
*/
/**
*
*/
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/*******************************************************************************
/**
* Copyright 2018 The MIT Internet Trust Consortium
*
* <p>
* Portions copyright 2011-2013 The MITRE Corporation
*
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
*/
/**
*
*/
@@ -128,5 +128,4 @@ public RegisteredClient getClientConfiguration(String accessToken) {
}



}
Original file line number Diff line number Diff line change
@@ -30,7 +30,6 @@

/**
* @author jricher
*
*/
public class ScopeBasedIntrospectionAuthoritiesGranter implements IntrospectionAuthorityGranter {

Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/*******************************************************************************
/**
* Copyright 2018 The MIT Internet Trust Consortium
*
* <p>
* Portions copyright 2011-2013 The MITRE Corporation
*
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
*/
/**
*
*/
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/*******************************************************************************
/**
* Copyright 2018 The MIT Internet Trust Consortium
*
* <p>
* Portions copyright 2011-2013 The MITRE Corporation
*
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
*/
/**
*
*/
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/*******************************************************************************
/**
* Copyright 2018 The MIT Internet Trust Consortium
*
* <p>
* Portions copyright 2011-2013 The MITRE Corporation
*
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
*/
/**
*
*/
Loading