cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lmo...@apache.org
Subject svn commit: r1037649 [2/2] - in /cxf/sandbox/oauth_1.0a/rt/rs/oauth: ./ oauth-core/src/main/java/org/apache/cxf/auth/oauth/endpoints/ oauth-core/src/main/java/org/apache/cxf/auth/oauth/handlers/ oauth-core/src/main/java/org/apache/cxf/auth/oauth/interc...
Date Mon, 22 Nov 2010 09:50:34 GMT
Modified: cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/TestSampleOAuthDataProvider.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/TestSampleOAuthDataProvider.java?rev=1037649&r1=1037648&r2=1037649&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/TestSampleOAuthDataProvider.java
(original)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth/oauth-core/src/test/java/org/apache/cxf/auth/oauth/TestSampleOAuthDataProvider.java
Mon Nov 22 09:50:33 2010
@@ -28,7 +28,7 @@ import javax.servlet.http.HttpServletReq
 import org.apache.cxf.auth.oauth.provider.Client;
 import org.apache.cxf.auth.oauth.provider.ClientImpl;
 import org.apache.cxf.auth.oauth.provider.MemoryOauthDataProvider;
-import org.apache.cxf.auth.oauth.tokens.OAuthScope;
+import org.apache.cxf.auth.oauth.tokens.OAuthPermission;
 import org.apache.cxf.auth.oauth.utils.OAuthTestUtils;
 import org.apache.cxf.common.security.SimplePrincipal;
 
@@ -37,30 +37,31 @@ import org.apache.cxf.common.security.Si
  */
 public class TestSampleOAuthDataProvider extends MemoryOauthDataProvider {
 
-    protected ConcurrentHashMap<String, OAuthScope> availableScopes
-        = new ConcurrentHashMap<String, OAuthScope>();
+    protected ConcurrentHashMap<String, OAuthPermission> availablePermissions = new
+            ConcurrentHashMap<String, OAuthPermission>();
 
     {
-        availableScopes
-            .put("read_info", new OAuthScope("read_info", "Read your personal information",
"ROLE_USER"));
-        availableScopes.put("modify_info",
-            new OAuthScope("modify_info", "Modify your personal information", "ROLE_ADMIN"));
+        availablePermissions
+                .put("read_info", new OAuthPermission("read_info", "Read your personal information",
+                        "ROLE_USER"));
+        availablePermissions.put("modify_info",
+                new OAuthPermission("modify_info", "Modify your personal information", "ROLE_ADMIN"));
     }
 
     public TestSampleOAuthDataProvider() {
         Client client = new ClientImpl(OAuthTestUtils.CLIENT_ID, OAuthTestUtils.CLIENT_SECRET,
-            OAuthTestUtils.CALLBACK, OAuthTestUtils.APPLICATION_NAME);
+                OAuthTestUtils.CALLBACK, OAuthTestUtils.APPLICATION_NAME);
         clientAuthInfo.put(OAuthTestUtils.CLIENT_ID, client);
     }
 
-    public List<OAuthScope> getAvailableScopes(List<String> requestScopes) {
-        List<OAuthScope> scopes = new ArrayList<OAuthScope>();
-        for (String requestScope : requestScopes) {
-            OAuthScope oAuthScope = availableScopes.get(requestScope);
-            scopes.add(oAuthScope);
+    public List<OAuthPermission> getAvailablePermissions(List<String> requestPermissions)
{
+        List<OAuthPermission> permissions = new ArrayList<OAuthPermission>();
+        for (String requestScope : requestPermissions) {
+            OAuthPermission oAuthPermission = availablePermissions.get(requestScope);
+            permissions.add(oAuthPermission);
         }
 
-        return scopes;
+        return permissions;
     }
 
     public Principal loggedPrincipal(HttpServletRequest request) {

Modified: cxf/sandbox/oauth_1.0a/rt/rs/oauth/pom.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/rt/rs/oauth/pom.xml?rev=1037649&r1=1037648&r2=1037649&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/rt/rs/oauth/pom.xml (original)
+++ cxf/sandbox/oauth_1.0a/rt/rs/oauth/pom.xml Mon Nov 22 09:50:33 2010
@@ -13,7 +13,7 @@
   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
+  specific language governing scopes and limitations
   under the License.
 -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -113,6 +113,24 @@
         </dependency>
     </dependencies>
 
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-source-plugin</artifactId>
+                <version>2.1.2</version>
+                <executions>
+                    <execution>
+                        <id>attach-sources</id>
+                        <phase>verify</phase>
+                        <goals>
+                            <goal>jar-no-fork</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
     <repositories>
         <repository>
             <id>oauth</id>



Mime
View raw message