oltu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pids...@apache.org
Subject svn commit: r961929 - in /incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server: OAuthServer.java OAuthnServer.java OAuthzServer.java
Date Thu, 08 Jul 2010 20:48:13 GMT
Author: pidster
Date: Thu Jul  8 20:48:12 2010
New Revision: 961929

URL: http://svn.apache.org/viewvc?rev=961929&view=rev
Log:
Changes to OAuthServer API, to separate authentication (authn) from authorization (authz)

Added:
    incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/OAuthnServer.java
  (with props)
    incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/OAuthzServer.java
  (with props)
Modified:
    incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/OAuthServer.java

Modified: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/OAuthServer.java
URL: http://svn.apache.org/viewvc/incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/OAuthServer.java?rev=961929&r1=961928&r2=961929&view=diff
==============================================================================
--- incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/OAuthServer.java
(original)
+++ incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/OAuthServer.java
Thu Jul  8 20:48:12 2010
@@ -16,10 +16,6 @@
  */
 package org.apache.amber.server;
 
-import org.apache.amber.OAuthException;
-import org.apache.amber.OAuthRequest;
-import org.apache.amber.OAuthToken;
-
 /**
  * An OAuth Server provides the functionality required to deliver OAuth Provider
  * functionality. It can be exposed by wrapping it in an HTTP layer, e.g. that
@@ -28,43 +24,6 @@ import org.apache.amber.OAuthToken;
  *
  * @version $Id$
  */
-public interface OAuthServer {
-
-    /**
-     * Generates a new request token.
-     *
-     * @param request
-     * @return
-     * @throws OAuthException
-     */
-    OAuthToken requestToken(OAuthRequest request) throws OAuthException;
-
-    /**
-     * Authorize a request token.
-     *
-     * @param oauthToken
-     * @return
-     * @throws OAuthException
-     */
-    OAuthToken authorizeToken(String oauthToken) throws OAuthException;
-
-    /**
-     * Generates a new access token.
-     *
-     * @param request
-     * @return
-     * @throws OAuthException
-     */
-    OAuthToken accessToken(OAuthRequest request) throws OAuthException;
-
-    /**
-     * Evaluates if a specific request contains authorization token to
-     * access to a protected resource.
-     *
-     * @param request
-     * @return
-     * @throws OAuthException
-     */
-    boolean canAccessToProtectedResources(OAuthRequest request) throws OAuthException;
+public abstract class OAuthServer implements OAuthnServer, OAuthzServer {
 
 }

Added: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/OAuthnServer.java
URL: http://svn.apache.org/viewvc/incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/OAuthnServer.java?rev=961929&view=auto
==============================================================================
--- incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/OAuthnServer.java
(added)
+++ incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/OAuthnServer.java
Thu Jul  8 20:48:12 2010
@@ -0,0 +1,56 @@
+/*
+ * 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.amber.server;
+
+import org.apache.amber.OAuthException;
+import org.apache.amber.OAuthRequest;
+import org.apache.amber.OAuthToken;
+
+/**
+ * @version $Id $HeadURL $Revision $Date $Author
+ *
+ */
+public interface OAuthnServer {
+
+    /**
+     * Generates a new request token.
+     *
+     * @param request
+     * @return
+     * @throws OAuthException
+     */
+    OAuthToken requestToken(OAuthRequest request) throws OAuthException;
+
+    /**
+     * Authorize a request token.
+     *
+     * @param oauthToken
+     * @return
+     * @throws OAuthException
+     */
+    OAuthToken authorizeToken(String oauthToken) throws OAuthException;
+
+    /**
+     * Generates a new access token.
+     *
+     * @param request
+     * @return
+     * @throws OAuthException
+     */
+    OAuthToken accessToken(OAuthRequest request) throws OAuthException;
+
+}

Propchange: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/OAuthnServer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/OAuthzServer.java
URL: http://svn.apache.org/viewvc/incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/OAuthzServer.java?rev=961929&view=auto
==============================================================================
--- incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/OAuthzServer.java
(added)
+++ incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/OAuthzServer.java
Thu Jul  8 20:48:12 2010
@@ -0,0 +1,38 @@
+/*
+ * 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.amber.server;
+
+import org.apache.amber.OAuthException;
+import org.apache.amber.OAuthRequest;
+
+/**
+ * @version $Id $HeadURL $Revision $Date $Author
+ *
+ */
+public interface OAuthzServer {
+
+    /**
+     * Evaluates if a specific request contains authorization token to
+     * access to a protected resource.
+     *
+     * @param request
+     * @return
+     * @throws OAuthException
+     */
+    boolean isAuthorized(OAuthRequest request) throws OAuthException;
+    
+}

Propchange: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/server/OAuthzServer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message