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

View File

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