cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6164] Creating a standalone Consumer class
Date Thu, 18 Dec 2014 13:01:45 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 9148f0447 -> ba0020228


[CXF-6164] Creating a standalone Consumer class


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/ba002022
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/ba002022
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/ba002022

Branch: refs/heads/master
Commit: ba00202288bce9ba80692f151c2d73b101400c50
Parents: 9148f04
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Thu Dec 18 13:01:29 2014 +0000
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Thu Dec 18 13:01:29 2014 +0000

----------------------------------------------------------------------
 .../cxf/rs/security/oauth2/client/Consumer.java | 48 ++++++++++++++++++++
 .../oauth2/client/OAuthClientUtils.java         | 23 ----------
 .../jaxrs/security/oauth2/JAXRSOAuth2Test.java  |  3 +-
 3 files changed, 50 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/ba002022/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/Consumer.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/Consumer.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/Consumer.java
new file mode 100644
index 0000000..96aaf11
--- /dev/null
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/Consumer.java
@@ -0,0 +1,48 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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
+ *
+ * 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.
+ */
+package org.apache.cxf.rs.security.oauth2.client;
+
+public class Consumer {
+    
+    private String key;
+    private String secret;
+    
+    public Consumer() {
+        
+    }
+    public Consumer(String key, String secret) {
+        this.setKey(key);
+        this.setSecret(secret);
+    }
+    public String getKey() {
+        return key;
+    }
+    public void setKey(String key) {
+        this.key = key;
+    }
+    public String getSecret() {
+        return secret;
+    }
+    public void setSecret(String secret) {
+        this.secret = secret;
+    }
+    
+    
+    
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/ba002022/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java
index 19258ac..88cf93b 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/OAuthClientUtils.java
@@ -384,27 +384,4 @@ public final class OAuthClientUtils {
         }
         
     }
-    
-    /**
-     * Simple consumer representation
-     */
-    public static class Consumer {
-        
-        private String key;
-        private String secret;
-        
-        public Consumer(String key, String secret) {
-            this.key = key;
-            this.secret = secret;
-        }
-        public String getKey() {
-            return key;
-        }
-    
-        public String getSecret() {
-            return secret;
-        }
-        
-        
-    }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/ba002022/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/JAXRSOAuth2Test.java
----------------------------------------------------------------------
diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/JAXRSOAuth2Test.java
b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/JAXRSOAuth2Test.java
index 0a4f079..2a713b6 100644
--- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/JAXRSOAuth2Test.java
+++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/JAXRSOAuth2Test.java
@@ -34,6 +34,7 @@ import org.apache.cxf.jaxrs.client.WebClient;
 import org.apache.cxf.jaxrs.impl.MetadataMap;
 import org.apache.cxf.rs.security.common.CryptoLoader;
 import org.apache.cxf.rs.security.oauth2.auth.saml.Saml2BearerAuthOutInterceptor;
+import org.apache.cxf.rs.security.oauth2.client.Consumer;
 import org.apache.cxf.rs.security.oauth2.client.OAuthClientUtils;
 import org.apache.cxf.rs.security.oauth2.common.AccessTokenGrant;
 import org.apache.cxf.rs.security.oauth2.common.ClientAccessToken;
@@ -71,7 +72,7 @@ public class JAXRSOAuth2Test extends AbstractBusClientServerTestBase {
                                                       signInfo).assertionToString();
         Saml2BearerGrant grant = new Saml2BearerGrant(assertion);
         ClientAccessToken at = OAuthClientUtils.getAccessToken(wc, 
-                                        new OAuthClientUtils.Consumer("alice", "alice"),

+                                        new Consumer("alice", "alice"), 
                                         grant,
                                         false);
         assertNotNull(at.getTokenKey());


Mime
View raw message