cleanup, added revocation uri to server config

pull/544/merge
Justin Richer 2013-11-27 12:23:04 -05:00
parent ed06b14406
commit d330bd1c9b
2 changed files with 448 additions and 324 deletions

View File

@ -173,6 +173,14 @@ public class ServerConfiguration {
private String introspectionEndpointUri;
private String revocationEndpointUri;
public String getRevocationEndpointUri() {
return revocationEndpointUri;
}
public void setRevocationEndpointUri(String revocationEndpointUri) {
this.revocationEndpointUri = revocationEndpointUri;
}
private String checkSessionIframe;
private String endSessionEndpoint;
private List<String> scopesSupported;
@ -647,55 +655,147 @@ public class ServerConfiguration {
public void setOpTosUri(String opTosUri) {
this.opTosUri = opTosUri;
}
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((acrValuesSupported == null) ? 0 : acrValuesSupported.hashCode());
result = prime * result + ((authorizationEndpointUri == null) ? 0 : authorizationEndpointUri.hashCode());
result = prime * result + ((checkSessionIframe == null) ? 0 : checkSessionIframe.hashCode());
result = prime * result + ((claimTypesSupported == null) ? 0 : claimTypesSupported.hashCode());
result = prime * result + ((claimsLocalesSupported == null) ? 0 : claimsLocalesSupported.hashCode());
result = prime * result + ((claimsParameterSupported == null) ? 0 : claimsParameterSupported.hashCode());
result = prime * result + ((claimsSupported == null) ? 0 : claimsSupported.hashCode());
result = prime * result + ((displayValuesSupported == null) ? 0 : displayValuesSupported.hashCode());
result = prime * result + ((endSessionEndpoint == null) ? 0 : endSessionEndpoint.hashCode());
result = prime * result + ((grantTypesSupported == null) ? 0 : grantTypesSupported.hashCode());
result = prime * result + ((idTokenEncryptionAlgValuesSupported == null) ? 0 : idTokenEncryptionAlgValuesSupported.hashCode());
result = prime * result + ((idTokenEncryptionEncValuesSupported == null) ? 0 : idTokenEncryptionEncValuesSupported.hashCode());
result = prime * result + ((idTokenSigningAlgValuesSupported == null) ? 0 : idTokenSigningAlgValuesSupported.hashCode());
result = prime * result + ((introspectionEndpointUri == null) ? 0 : introspectionEndpointUri.hashCode());
result = prime
* result
+ ((acrValuesSupported == null) ? 0 : acrValuesSupported
.hashCode());
result = prime
* result
+ ((authorizationEndpointUri == null) ? 0
: authorizationEndpointUri.hashCode());
result = prime
* result
+ ((checkSessionIframe == null) ? 0 : checkSessionIframe
.hashCode());
result = prime
* result
+ ((claimTypesSupported == null) ? 0 : claimTypesSupported
.hashCode());
result = prime
* result
+ ((claimsLocalesSupported == null) ? 0
: claimsLocalesSupported.hashCode());
result = prime
* result
+ ((claimsParameterSupported == null) ? 0
: claimsParameterSupported.hashCode());
result = prime * result
+ ((claimsSupported == null) ? 0 : claimsSupported.hashCode());
result = prime
* result
+ ((displayValuesSupported == null) ? 0
: displayValuesSupported.hashCode());
result = prime
* result
+ ((endSessionEndpoint == null) ? 0 : endSessionEndpoint
.hashCode());
result = prime
* result
+ ((grantTypesSupported == null) ? 0 : grantTypesSupported
.hashCode());
result = prime
* result
+ ((idTokenEncryptionAlgValuesSupported == null) ? 0
: idTokenEncryptionAlgValuesSupported.hashCode());
result = prime
* result
+ ((idTokenEncryptionEncValuesSupported == null) ? 0
: idTokenEncryptionEncValuesSupported.hashCode());
result = prime
* result
+ ((idTokenSigningAlgValuesSupported == null) ? 0
: idTokenSigningAlgValuesSupported.hashCode());
result = prime
* result
+ ((introspectionEndpointUri == null) ? 0
: introspectionEndpointUri.hashCode());
result = prime * result + ((issuer == null) ? 0 : issuer.hashCode());
result = prime * result + ((jwksUri == null) ? 0 : jwksUri.hashCode());
result = prime * result + ((opPolicyUri == null) ? 0 : opPolicyUri.hashCode());
result = prime * result + ((opTosUri == null) ? 0 : opTosUri.hashCode());
result = prime * result + ((registrationEndpointUri == null) ? 0 : registrationEndpointUri.hashCode());
result = prime * result + ((requestObjectEncryptionAlgValuesSupported == null) ? 0 : requestObjectEncryptionAlgValuesSupported.hashCode());
result = prime * result + ((requestObjectEncryptionEncValuesSupported == null) ? 0 : requestObjectEncryptionEncValuesSupported.hashCode());
result = prime * result + ((requestObjectSigningAlgValuesSupported == null) ? 0 : requestObjectSigningAlgValuesSupported.hashCode());
result = prime * result + ((requestParameterSupported == null) ? 0 : requestParameterSupported.hashCode());
result = prime * result + ((requestUriParameterSupported == null) ? 0 : requestUriParameterSupported.hashCode());
result = prime * result + ((requireRequestUriRegistration == null) ? 0 : requireRequestUriRegistration.hashCode());
result = prime * result + ((responseTypesSupported == null) ? 0 : responseTypesSupported.hashCode());
result = prime * result + ((scopesSupported == null) ? 0 : scopesSupported.hashCode());
result = prime * result + ((serviceDocumentation == null) ? 0 : serviceDocumentation.hashCode());
result = prime * result + ((subjectTypesSupported == null) ? 0 : subjectTypesSupported.hashCode());
result = prime * result + ((tokenEndpointAuthMethodsSupported == null) ? 0 : tokenEndpointAuthMethodsSupported.hashCode());
result = prime * result + ((tokenEndpointAuthSigningAlgValuesSupported == null) ? 0 : tokenEndpointAuthSigningAlgValuesSupported.hashCode());
result = prime * result + ((tokenEndpointUri == null) ? 0 : tokenEndpointUri.hashCode());
result = prime * result + ((uiLocalesSupported == null) ? 0 : uiLocalesSupported.hashCode());
result = prime * result + ((userInfoUri == null) ? 0 : userInfoUri.hashCode());
result = prime * result + ((userinfoEncryptionAlgValuesSupported == null) ? 0 : userinfoEncryptionAlgValuesSupported.hashCode());
result = prime * result + ((userinfoEncryptionEncValuesSupported == null) ? 0 : userinfoEncryptionEncValuesSupported.hashCode());
result = prime * result + ((userinfoSigningAlgValuesSupported == null) ? 0 : userinfoSigningAlgValuesSupported.hashCode());
result = prime * result
+ ((opPolicyUri == null) ? 0 : opPolicyUri.hashCode());
result = prime * result
+ ((opTosUri == null) ? 0 : opTosUri.hashCode());
result = prime
* result
+ ((registrationEndpointUri == null) ? 0
: registrationEndpointUri.hashCode());
result = prime
* result
+ ((requestObjectEncryptionAlgValuesSupported == null) ? 0
: requestObjectEncryptionAlgValuesSupported.hashCode());
result = prime
* result
+ ((requestObjectEncryptionEncValuesSupported == null) ? 0
: requestObjectEncryptionEncValuesSupported.hashCode());
result = prime
* result
+ ((requestObjectSigningAlgValuesSupported == null) ? 0
: requestObjectSigningAlgValuesSupported.hashCode());
result = prime
* result
+ ((requestParameterSupported == null) ? 0
: requestParameterSupported.hashCode());
result = prime
* result
+ ((requestUriParameterSupported == null) ? 0
: requestUriParameterSupported.hashCode());
result = prime
* result
+ ((requireRequestUriRegistration == null) ? 0
: requireRequestUriRegistration.hashCode());
result = prime
* result
+ ((responseTypesSupported == null) ? 0
: responseTypesSupported.hashCode());
result = prime
* result
+ ((revocationEndpointUri == null) ? 0 : revocationEndpointUri
.hashCode());
result = prime * result
+ ((scopesSupported == null) ? 0 : scopesSupported.hashCode());
result = prime
* result
+ ((serviceDocumentation == null) ? 0 : serviceDocumentation
.hashCode());
result = prime
* result
+ ((subjectTypesSupported == null) ? 0 : subjectTypesSupported
.hashCode());
result = prime
* result
+ ((tokenEndpointAuthMethodsSupported == null) ? 0
: tokenEndpointAuthMethodsSupported.hashCode());
result = prime
* result
+ ((tokenEndpointAuthSigningAlgValuesSupported == null) ? 0
: tokenEndpointAuthSigningAlgValuesSupported.hashCode());
result = prime
* result
+ ((tokenEndpointUri == null) ? 0 : tokenEndpointUri.hashCode());
result = prime
* result
+ ((uiLocalesSupported == null) ? 0 : uiLocalesSupported
.hashCode());
result = prime * result
+ ((userInfoUri == null) ? 0 : userInfoUri.hashCode());
result = prime
* result
+ ((userinfoEncryptionAlgValuesSupported == null) ? 0
: userinfoEncryptionAlgValuesSupported.hashCode());
result = prime
* result
+ ((userinfoEncryptionEncValuesSupported == null) ? 0
: userinfoEncryptionEncValuesSupported.hashCode());
result = prime
* result
+ ((userinfoSigningAlgValuesSupported == null) ? 0
: userinfoSigningAlgValuesSupported.hashCode());
return result;
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj) {
@ -704,7 +804,7 @@ public class ServerConfiguration {
if (obj == null) {
return false;
}
if (!(obj instanceof ServerConfiguration)) {
if (getClass() != obj.getClass()) {
return false;
}
ServerConfiguration other = (ServerConfiguration) obj;
@ -719,7 +819,8 @@ public class ServerConfiguration {
if (other.authorizationEndpointUri != null) {
return false;
}
} else if (!authorizationEndpointUri.equals(other.authorizationEndpointUri)) {
} else if (!authorizationEndpointUri
.equals(other.authorizationEndpointUri)) {
return false;
}
if (checkSessionIframe == null) {
@ -747,7 +848,8 @@ public class ServerConfiguration {
if (other.claimsParameterSupported != null) {
return false;
}
} else if (!claimsParameterSupported.equals(other.claimsParameterSupported)) {
} else if (!claimsParameterSupported
.equals(other.claimsParameterSupported)) {
return false;
}
if (claimsSupported == null) {
@ -782,28 +884,32 @@ public class ServerConfiguration {
if (other.idTokenEncryptionAlgValuesSupported != null) {
return false;
}
} else if (!idTokenEncryptionAlgValuesSupported.equals(other.idTokenEncryptionAlgValuesSupported)) {
} else if (!idTokenEncryptionAlgValuesSupported
.equals(other.idTokenEncryptionAlgValuesSupported)) {
return false;
}
if (idTokenEncryptionEncValuesSupported == null) {
if (other.idTokenEncryptionEncValuesSupported != null) {
return false;
}
} else if (!idTokenEncryptionEncValuesSupported.equals(other.idTokenEncryptionEncValuesSupported)) {
} else if (!idTokenEncryptionEncValuesSupported
.equals(other.idTokenEncryptionEncValuesSupported)) {
return false;
}
if (idTokenSigningAlgValuesSupported == null) {
if (other.idTokenSigningAlgValuesSupported != null) {
return false;
}
} else if (!idTokenSigningAlgValuesSupported.equals(other.idTokenSigningAlgValuesSupported)) {
} else if (!idTokenSigningAlgValuesSupported
.equals(other.idTokenSigningAlgValuesSupported)) {
return false;
}
if (introspectionEndpointUri == null) {
if (other.introspectionEndpointUri != null) {
return false;
}
} else if (!introspectionEndpointUri.equals(other.introspectionEndpointUri)) {
} else if (!introspectionEndpointUri
.equals(other.introspectionEndpointUri)) {
return false;
}
if (issuer == null) {
@ -838,49 +944,56 @@ public class ServerConfiguration {
if (other.registrationEndpointUri != null) {
return false;
}
} else if (!registrationEndpointUri.equals(other.registrationEndpointUri)) {
} else if (!registrationEndpointUri
.equals(other.registrationEndpointUri)) {
return false;
}
if (requestObjectEncryptionAlgValuesSupported == null) {
if (other.requestObjectEncryptionAlgValuesSupported != null) {
return false;
}
} else if (!requestObjectEncryptionAlgValuesSupported.equals(other.requestObjectEncryptionAlgValuesSupported)) {
} else if (!requestObjectEncryptionAlgValuesSupported
.equals(other.requestObjectEncryptionAlgValuesSupported)) {
return false;
}
if (requestObjectEncryptionEncValuesSupported == null) {
if (other.requestObjectEncryptionEncValuesSupported != null) {
return false;
}
} else if (!requestObjectEncryptionEncValuesSupported.equals(other.requestObjectEncryptionEncValuesSupported)) {
} else if (!requestObjectEncryptionEncValuesSupported
.equals(other.requestObjectEncryptionEncValuesSupported)) {
return false;
}
if (requestObjectSigningAlgValuesSupported == null) {
if (other.requestObjectSigningAlgValuesSupported != null) {
return false;
}
} else if (!requestObjectSigningAlgValuesSupported.equals(other.requestObjectSigningAlgValuesSupported)) {
} else if (!requestObjectSigningAlgValuesSupported
.equals(other.requestObjectSigningAlgValuesSupported)) {
return false;
}
if (requestParameterSupported == null) {
if (other.requestParameterSupported != null) {
return false;
}
} else if (!requestParameterSupported.equals(other.requestParameterSupported)) {
} else if (!requestParameterSupported
.equals(other.requestParameterSupported)) {
return false;
}
if (requestUriParameterSupported == null) {
if (other.requestUriParameterSupported != null) {
return false;
}
} else if (!requestUriParameterSupported.equals(other.requestUriParameterSupported)) {
} else if (!requestUriParameterSupported
.equals(other.requestUriParameterSupported)) {
return false;
}
if (requireRequestUriRegistration == null) {
if (other.requireRequestUriRegistration != null) {
return false;
}
} else if (!requireRequestUriRegistration.equals(other.requireRequestUriRegistration)) {
} else if (!requireRequestUriRegistration
.equals(other.requireRequestUriRegistration)) {
return false;
}
if (responseTypesSupported == null) {
@ -890,6 +1003,13 @@ public class ServerConfiguration {
} else if (!responseTypesSupported.equals(other.responseTypesSupported)) {
return false;
}
if (revocationEndpointUri == null) {
if (other.revocationEndpointUri != null) {
return false;
}
} else if (!revocationEndpointUri.equals(other.revocationEndpointUri)) {
return false;
}
if (scopesSupported == null) {
if (other.scopesSupported != null) {
return false;
@ -915,14 +1035,16 @@ public class ServerConfiguration {
if (other.tokenEndpointAuthMethodsSupported != null) {
return false;
}
} else if (!tokenEndpointAuthMethodsSupported.equals(other.tokenEndpointAuthMethodsSupported)) {
} else if (!tokenEndpointAuthMethodsSupported
.equals(other.tokenEndpointAuthMethodsSupported)) {
return false;
}
if (tokenEndpointAuthSigningAlgValuesSupported == null) {
if (other.tokenEndpointAuthSigningAlgValuesSupported != null) {
return false;
}
} else if (!tokenEndpointAuthSigningAlgValuesSupported.equals(other.tokenEndpointAuthSigningAlgValuesSupported)) {
} else if (!tokenEndpointAuthSigningAlgValuesSupported
.equals(other.tokenEndpointAuthSigningAlgValuesSupported)) {
return false;
}
if (tokenEndpointUri == null) {
@ -950,21 +1072,24 @@ public class ServerConfiguration {
if (other.userinfoEncryptionAlgValuesSupported != null) {
return false;
}
} else if (!userinfoEncryptionAlgValuesSupported.equals(other.userinfoEncryptionAlgValuesSupported)) {
} else if (!userinfoEncryptionAlgValuesSupported
.equals(other.userinfoEncryptionAlgValuesSupported)) {
return false;
}
if (userinfoEncryptionEncValuesSupported == null) {
if (other.userinfoEncryptionEncValuesSupported != null) {
return false;
}
} else if (!userinfoEncryptionEncValuesSupported.equals(other.userinfoEncryptionEncValuesSupported)) {
} else if (!userinfoEncryptionEncValuesSupported
.equals(other.userinfoEncryptionEncValuesSupported)) {
return false;
}
if (userinfoSigningAlgValuesSupported == null) {
if (other.userinfoSigningAlgValuesSupported != null) {
return false;
}
} else if (!userinfoSigningAlgValuesSupported.equals(other.userinfoSigningAlgValuesSupported)) {
} else if (!userinfoSigningAlgValuesSupported
.equals(other.userinfoSigningAlgValuesSupported)) {
return false;
}
return true;

View File

@ -94,8 +94,7 @@ public class DiscoveryEndpoint {
&& resourceUri.getScheme().equals("acct")) {
// acct: URI
UserInfo user = null;
user = userService.getByUsername(resourceUri.getUserInfo()); // first part is the username
UserInfo user = userService.getByUsername(resourceUri.getUserInfo()); // first part is the username
if (user == null) {
logger.info("User not found: " + resource);