cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject [2/2] git commit: [CXF-5954] Renaming some classes
Date Wed, 03 Sep 2014 20:57:48 GMT
[CXF-5954] Renaming some classes


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

Branch: refs/heads/3.0.x-fixes
Commit: 7b65e6fab71ff404e98036f10484cffa2664f795
Parents: e6df017
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Wed Sep 3 21:50:09 2014 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Wed Sep 3 21:57:20 2014 +0100

----------------------------------------------------------------------
 .../oauth2/jwk/DefaultJwkSetReaderWriter.java   | 48 ++++++++++++++++++++
 .../oauth2/jwk/JsonWebKeyReaderWriter.java      | 45 ------------------
 .../security/oauth2/jwk/JwkSetReaderWriter.java | 27 +++++++++++
 .../rs/security/oauth2/jwk/JsonWebKeyTest.java  |  2 +-
 4 files changed, 76 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/7b65e6fa/rt/rs/security/oauth-parent/oauth2-jwt/src/main/java/org/apache/cxf/rs/security/oauth2/jwk/DefaultJwkSetReaderWriter.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2-jwt/src/main/java/org/apache/cxf/rs/security/oauth2/jwk/DefaultJwkSetReaderWriter.java
b/rt/rs/security/oauth-parent/oauth2-jwt/src/main/java/org/apache/cxf/rs/security/oauth2/jwk/DefaultJwkSetReaderWriter.java
new file mode 100644
index 0000000..128e932
--- /dev/null
+++ b/rt/rs/security/oauth-parent/oauth2-jwt/src/main/java/org/apache/cxf/rs/security/oauth2/jwk/DefaultJwkSetReaderWriter.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.jwk;
+
+import org.apache.cxf.rs.security.oauth2.jwt.AbstractJwtObjectReaderWriter;
+
+
+
+
+public class DefaultJwkSetReaderWriter extends AbstractJwtObjectReaderWriter
+    implements JwkSetReaderWriter {
+    @Override
+    public String jwkToJson(JsonWebKey jwk) {
+        return toJson(jwk);
+    }
+    @Override
+    public String jwksToJson(JsonWebKeys jwks) {
+        return toJson(jwks);
+    }
+    @Override
+    public JsonWebKey jsonToJwk(String jwkJson) {
+        JsonWebKey jwk = new JsonWebKey();
+        fromJsonInternal(jwk, jwkJson);
+        return jwk;
+    }
+    @Override
+    public JsonWebKeys jsonToJwks(String jwksJson) {
+        JsonWebKeys jwks = new JsonWebKeys();
+        fromJsonInternal(jwks, jwksJson);
+        return jwks;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/7b65e6fa/rt/rs/security/oauth-parent/oauth2-jwt/src/main/java/org/apache/cxf/rs/security/oauth2/jwk/JsonWebKeyReaderWriter.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2-jwt/src/main/java/org/apache/cxf/rs/security/oauth2/jwk/JsonWebKeyReaderWriter.java
b/rt/rs/security/oauth-parent/oauth2-jwt/src/main/java/org/apache/cxf/rs/security/oauth2/jwk/JsonWebKeyReaderWriter.java
deleted file mode 100644
index 56f22e0..0000000
--- a/rt/rs/security/oauth-parent/oauth2-jwt/src/main/java/org/apache/cxf/rs/security/oauth2/jwk/JsonWebKeyReaderWriter.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * 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.jwk;
-
-import org.apache.cxf.rs.security.oauth2.jwt.AbstractJwtObjectReaderWriter;
-
-
-
-
-public class JsonWebKeyReaderWriter extends AbstractJwtObjectReaderWriter {
-    public String jwkToJson(JsonWebKey jwk) {
-        return toJson(jwk);
-    }
-
-    public String jwksToJson(JsonWebKeys jwks) {
-        return toJson(jwks);
-    }
-
-    public JsonWebKey jsonToJwk(String jwkJson) {
-        JsonWebKey jwk = new JsonWebKey();
-        fromJsonInternal(jwk, jwkJson);
-        return jwk;
-    }
-    public JsonWebKeys jsonToJwks(String jwksJson) {
-        JsonWebKeys jwks = new JsonWebKeys();
-        fromJsonInternal(jwks, jwksJson);
-        return jwks;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cxf/blob/7b65e6fa/rt/rs/security/oauth-parent/oauth2-jwt/src/main/java/org/apache/cxf/rs/security/oauth2/jwk/JwkSetReaderWriter.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2-jwt/src/main/java/org/apache/cxf/rs/security/oauth2/jwk/JwkSetReaderWriter.java
b/rt/rs/security/oauth-parent/oauth2-jwt/src/main/java/org/apache/cxf/rs/security/oauth2/jwk/JwkSetReaderWriter.java
new file mode 100644
index 0000000..b412b72
--- /dev/null
+++ b/rt/rs/security/oauth-parent/oauth2-jwt/src/main/java/org/apache/cxf/rs/security/oauth2/jwk/JwkSetReaderWriter.java
@@ -0,0 +1,27 @@
+/**
+ * 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.jwk;
+
+
+public interface JwkSetReaderWriter {
+    String jwkToJson(JsonWebKey jwk);
+    String jwksToJson(JsonWebKeys jwks);
+    JsonWebKey jsonToJwk(String jwkJson);
+    JsonWebKeys jsonToJwks(String jwksJson);
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/7b65e6fa/rt/rs/security/oauth-parent/oauth2-jwt/src/test/java/org/apache/cxf/rs/security/oauth2/jwk/JsonWebKeyTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2-jwt/src/test/java/org/apache/cxf/rs/security/oauth2/jwk/JsonWebKeyTest.java
b/rt/rs/security/oauth-parent/oauth2-jwt/src/test/java/org/apache/cxf/rs/security/oauth2/jwk/JsonWebKeyTest.java
index 0505f64..e52fbd1 100644
--- a/rt/rs/security/oauth-parent/oauth2-jwt/src/test/java/org/apache/cxf/rs/security/oauth2/jwk/JsonWebKeyTest.java
+++ b/rt/rs/security/oauth-parent/oauth2-jwt/src/test/java/org/apache/cxf/rs/security/oauth2/jwk/JsonWebKeyTest.java
@@ -165,7 +165,7 @@ public class JsonWebKeyTest extends Assert {
     public JsonWebKeys readKeySet(String fileName) throws Exception {
         InputStream is = JsonWebKeyTest.class.getResourceAsStream(fileName);
         String s = IOUtils.readStringFromStream(is);
-        JsonWebKeyReaderWriter reader = new JsonWebKeyReaderWriter();
+        JwkSetReaderWriter reader = new DefaultJwkSetReaderWriter();
         return reader.jsonToJwks(s);
     }
 }


Mime
View raw message