cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r911366 - in /cxf/trunk/systests/jaxrs/src/test: java/org/apache/cxf/systest/jaxrs/security/SecureBook.java java/org/apache/cxf/systest/jaxrs/security/SecureBookStoreNoInterface.java resources/jaxrs_security_cglib/WEB-INF/beans.xml
Date Thu, 18 Feb 2010 12:26:21 GMT
Author: sergeyb
Date: Thu Feb 18 12:26:21 2010
New Revision: 911366

URL: http://svn.apache.org/viewvc?rev=911366&view=rev
Log:
JAXRS : updating one of the security tests to use @RolesAllowed

Modified:
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/SecureBook.java
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/SecureBookStoreNoInterface.java
    cxf/trunk/systests/jaxrs/src/test/resources/jaxrs_security_cglib/WEB-INF/beans.xml

Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/SecureBook.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/SecureBook.java?rev=911366&r1=911365&r2=911366&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/SecureBook.java
(original)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/SecureBook.java
Thu Feb 18 12:26:21 2010
@@ -19,6 +19,7 @@
 
 package org.apache.cxf.systest.jaxrs.security;
 
+import javax.annotation.security.RolesAllowed;
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
@@ -59,6 +60,7 @@
     @Path("self")    
     @Produces("application/xml")
     @Secured("ROLE_ADMIN")
+    @RolesAllowed("ROLE_ADMIN")
     public Book getBook() {
         return new Book(name, id);
     } 

Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/SecureBookStoreNoInterface.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/SecureBookStoreNoInterface.java?rev=911366&r1=911365&r2=911366&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/SecureBookStoreNoInterface.java
(original)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/SecureBookStoreNoInterface.java
Thu Feb 18 12:26:21 2010
@@ -22,6 +22,7 @@
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.annotation.security.RolesAllowed;
 import javax.ws.rs.FormParam;
 import javax.ws.rs.GET;
 import javax.ws.rs.POST;
@@ -31,7 +32,6 @@
 
 import org.apache.cxf.systest.jaxrs.Book;
 import org.apache.cxf.systest.jaxrs.BookNotFoundFault;
-import org.springframework.security.annotation.Secured;
 
 @Path("/bookstorestorage/")
 public class SecureBookStoreNoInterface {
@@ -46,7 +46,7 @@
     
     @POST
     @Path("/bookforms")
-    @Secured({"ROLE_USER", "ROLE_ADMIN" })
+    @RolesAllowed({"ROLE_USER", "ROLE_ADMIN" })
     public Book getBookFromFormParams(@FormParam("name") String name, @FormParam("id") long
id) {
         if (name == null || id == 0) {
             throw new RuntimeException("FormParams are not set");
@@ -57,7 +57,7 @@
     @GET
     @Path("/thosebooks/{bookId}/{id}")
     @Produces("application/xml")
-    @Secured({"ROLE_USER", "ROLE_ADMIN" })
+    @RolesAllowed({"ROLE_USER", "ROLE_ADMIN" })
     public Book getThatBook(@PathParam("bookId") Long id, @PathParam("id") String s) {
         if (s == null) {
             throw new RuntimeException();
@@ -68,7 +68,7 @@
     @GET
     @Path("/thosebooks/{bookId}/")
     @Produces("application/xml")
-    @Secured("ROLE_USER")
+    @RolesAllowed("ROLE_USER")
     public Book getThatBook(@PathParam("bookId") Long id) {
         return books.get(id);
     }
@@ -76,7 +76,7 @@
     @GET
     @Path("/thosebooks")
     @Produces("application/xml")
-    @Secured("ROLE_ADMIN")
+    @RolesAllowed("ROLE_ADMIN")
     public Book getThatBook() throws BookNotFoundFault {
         return books.get(123L);
     }

Modified: cxf/trunk/systests/jaxrs/src/test/resources/jaxrs_security_cglib/WEB-INF/beans.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/resources/jaxrs_security_cglib/WEB-INF/beans.xml?rev=911366&r1=911365&r2=911366&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/resources/jaxrs_security_cglib/WEB-INF/beans.xml (original)
+++ cxf/trunk/systests/jaxrs/src/test/resources/jaxrs_security_cglib/WEB-INF/beans.xml Thu
Feb 18 12:26:21 2010
@@ -61,7 +61,8 @@
   
   <aop:config proxy-target-class="true"/>
   
-  <security:global-method-security secured-annotations="enabled"/>
+  <security:global-method-security secured-annotations="disabled"
+            jsr250-annotations="enabled"/>
   
   <security:http auto-config='true'>
     <security:http-basic />



Mime
View raw message