cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1515924 - in /cxf/branches/2.7.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/
Date Tue, 20 Aug 2013 19:05:19 GMT
Author: sergeyb
Date: Tue Aug 20 19:05:19 2013
New Revision: 1515924

URL: http://svn.apache.org/r1515924
Log:
Merged revisions 1515922 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1515922 | sergeyb | 2013-08-20 22:00:10 +0300 (Tue, 20 Aug 2013) | 1 line
  
  [CXF-5212] Checking for superclass when looking for context setters, patch on behalf of
Thorsten Hoeger applied
........

Modified:
    cxf/branches/2.7.x-fixes/   (props changed)
    cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/AbstractResourceInfo.java
    cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/Injectable.java
    cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSSpringSecurityInterfaceTest.java
    cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/SecureBookStore.java

Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
    svn:mergeinfo = /cxf/trunk:1515922

Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/AbstractResourceInfo.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/AbstractResourceInfo.java?rev=1515924&r1=1515923&r2=1515924&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/AbstractResourceInfo.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/AbstractResourceInfo.java
Tue Aug 20 19:05:19 2013
@@ -154,6 +154,10 @@ public abstract class AbstractResourceIn
         for (Class<?> i : interfaces) {
             findContextSetterMethods(i);
         }
+        Class<?> superCls = cls.getSuperclass();
+        if (superCls != null && superCls != Object.class) {
+            findContextSetterMethods(superCls);
+        }
     }
     
     private void checkContextMethod(Method m) {

Modified: cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/Injectable.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/Injectable.java?rev=1515924&r1=1515923&r2=1515924&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/Injectable.java
(original)
+++ cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/Injectable.java
Tue Aug 20 19:05:19 2013
@@ -19,7 +19,9 @@
 package org.apache.cxf.systest.jaxrs.security;
 
 import javax.ws.rs.core.SecurityContext;
+import javax.ws.rs.core.UriInfo;
 
 public interface Injectable {
     void setSecurityContext(SecurityContext sc);
+    void setUriInfo(UriInfo ui);
 }

Modified: cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSSpringSecurityInterfaceTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSSpringSecurityInterfaceTest.java?rev=1515924&r1=1515923&r2=1515924&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSSpringSecurityInterfaceTest.java
(original)
+++ cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSSpringSecurityInterfaceTest.java
Tue Aug 20 19:05:19 2013
@@ -35,7 +35,7 @@ public class JAXRSSpringSecurityInterfac
     @BeforeClass
     public static void startServers() throws Exception {
         assertTrue("server did not launch correctly", 
-                   launchServer(BookServerSecuritySpringInterface.class));
+                   launchServer(BookServerSecuritySpringInterface.class, true));
     }
     
     @Test

Modified: cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/SecureBookStore.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/SecureBookStore.java?rev=1515924&r1=1515923&r2=1515924&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/SecureBookStore.java
(original)
+++ cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/SecureBookStore.java
Tue Aug 20 19:05:19 2013
@@ -26,16 +26,16 @@ import javax.annotation.Resource;
 import javax.ws.rs.Path;
 import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.Context;
-import javax.ws.rs.core.SecurityContext;
+import javax.ws.rs.core.UriInfo;
 
 import org.apache.cxf.systest.jaxrs.Book;
 import org.apache.cxf.systest.jaxrs.BookNotFoundFault;
 
 @Path("/bookstorestorage/")
-public class SecureBookStore implements SecureBookInterface, Injectable {
+public class SecureBookStore extends AbstractSecureBookStore implements SecureBookInterface
{
     private Map<Long, Book> books = new HashMap<Long, Book>();
     private SecureBookInterface subresource;
-    private SecurityContext securityContext; 
+    private UriInfo uriInfo; 
     
     public SecureBookStore() {
         Book book = new Book();
@@ -45,8 +45,8 @@ public class SecureBookStore implements 
     }
     
     @Context
-    public void setSecurityContext(SecurityContext sc) {
-        securityContext = sc;
+    public void setUriInfo(UriInfo ui) {
+        uriInfo = ui;
     }
     
     @Resource
@@ -66,6 +66,9 @@ public class SecureBookStore implements 
     }
     
     public Book getThatBook() throws BookNotFoundFault {
+        if (!uriInfo.getBaseUri().getScheme().startsWith("http")) {
+            throw new WebApplicationException(500);
+        }
         if ((securityContext.isUserInRole("ROLE_ADMIN")
             || securityContext.isUserInRole("ROLE_BOOK_OWNER"))
             && !securityContext.isUserInRole("ROLE_BAZ")) {



Mime
View raw message