Repository: cxf Updated Branches: refs/heads/master b4c365203 -> 3af1a795d
[CXF-5705] Minor updates to ClientKey Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/3af1a795 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/3af1a795 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/3af1a795 Branch: refs/heads/master Commit: 3af1a795d55bb3494d5127afd16a72bb261e03a9 Parents: b4c3652 Author: Sergey Beryozkin <[email protected]> Authored: Wed Apr 30 11:09:06 2014 +0100 Committer: Sergey Beryozkin <[email protected]> Committed: Wed Apr 30 11:09:06 2014 +0100 ---------------------------------------------------------------------- .../rs/security/oauth2/common/ClientKey.java | 22 ++++++++++---------- .../oauth2/services/AbstractTokenService.java | 6 +++--- .../oauth2/utils/ModelEncryptionSupport.java | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/3af1a795/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/ClientKey.java ---------------------------------------------------------------------- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/ClientKey.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/ClientKey.java index f7f94f3..4cd9a73 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/ClientKey.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/common/ClientKey.java @@ -28,7 +28,7 @@ public class ClientKey implements Serializable { PUBLIC_KEY } - private String credential; + private String key; private Type type; public ClientKey() { @@ -43,17 +43,17 @@ public class ClientKey implements Serializable { this(null, type); } - public ClientKey(String cred, Type type) { - this.credential = cred; + public ClientKey(String key, Type type) { + this.key = key; this.type = type; } - public String getCredential() { - return credential; + public String getKey() { + return key; } - public void setCredential(String credential) { - this.credential = credential; + public void setKey(String key) { + this.key = key; } public Type getType() { @@ -65,16 +65,16 @@ public class ClientKey implements Serializable { } public int hashCode() { - return (credential == null ? 37 : credential.hashCode()) * type.hashCode(); + return (key == null ? 37 : key.hashCode()) * type.hashCode(); } public boolean equals(Object obj) { if (obj instanceof ClientKey) { ClientKey other = (ClientKey)obj; - if (this.credential == null && other.credential != null - || this.credential != null && other.credential == null) { + if (this.key == null && other.key != null + || this.key != null && other.key == null) { return false; } - return this.credential.equals(other.credential) && this.type.equals(other.type); + return this.key.equals(other.key) && this.type.equals(other.type); } else { return false; } http://git-wip-us.apache.org/repos/asf/cxf/blob/3af1a795/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractTokenService.java ---------------------------------------------------------------------- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractTokenService.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractTokenService.java index 3d19921..3e12532 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractTokenService.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AbstractTokenService.java @@ -112,7 +112,7 @@ public class AbstractTokenService extends AbstractOAuthService { } if (clientSecret == null || client.getClientKey() == null || !client.getClientId().equals(clientId) - || !client.getClientKey().getCredential().equals(clientSecret)) { + || !client.getClientKey().getKey().equals(clientSecret)) { throw ExceptionUtils.toNotAuthorizedException(null, null); } return client; @@ -162,10 +162,10 @@ public class AbstractTokenService extends AbstractOAuthService { if (credType != ClientKey.Type.X509CERTIFICATE && credType != ClientKey.Type.PUBLIC_KEY) { reportInvalidClient(); - } else if (client.getClientKey().getCredential() != null) { + } else if (client.getClientKey().getKey() != null) { // Client has a Base64 encoded representation of the certificate loaded // so lets validate the TLS certificates - compareCertificates(tlsSessionInfo, client.getClientKey().getCredential(), credType); + compareCertificates(tlsSessionInfo, client.getClientKey().getKey(), credType); } } http://git-wip-us.apache.org/repos/asf/cxf/blob/3af1a795/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/ModelEncryptionSupport.java ---------------------------------------------------------------------- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/ModelEncryptionSupport.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/ModelEncryptionSupport.java index b7ca8bc..14f764d 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/ModelEncryptionSupport.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/ModelEncryptionSupport.java @@ -347,7 +347,7 @@ public final class ModelEncryptionSupport { state.append(SEP); ClientKey cred = client.getClientKey(); // 1: secret - state.append(tokenizeString(cred == null ? null : cred.getCredential())); + state.append(tokenizeString(cred == null ? null : cred.getKey())); state.append(SEP); // 1.1: secret type state.append(tokenizeString(cred == null ? null : cred.getType().toString()));
