You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jl...@apache.org on 2018/12/14 15:55:46 UTC

[1/6] tomee git commit: Added index headers to microprofile related examples

Repository: tomee
Updated Branches:
  refs/heads/master 2c1ee1f0e -> cad956dcf


Added index headers to microprofile related examples


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

Branch: refs/heads/master
Commit: d12cfb2ff7ea50e89b1063ec87c43dab7bdc7bcf
Parents: 66ce200
Author: CesarHernandezGt <cf...@gmail.com>
Authored: Thu Dec 13 01:24:20 2018 -0600
Committer: CesarHernandezGt <cf...@gmail.com>
Committed: Thu Dec 13 01:24:20 2018 -0600

----------------------------------------------------------------------
 examples/mp-faulttolerance-retry/README.md | 4 ++++
 examples/mp-rest-jwt/README.md             | 4 ++++
 2 files changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/d12cfb2f/examples/mp-faulttolerance-retry/README.md
----------------------------------------------------------------------
diff --git a/examples/mp-faulttolerance-retry/README.md b/examples/mp-faulttolerance-retry/README.md
index df18c59..8955655 100644
--- a/examples/mp-faulttolerance-retry/README.md
+++ b/examples/mp-faulttolerance-retry/README.md
@@ -1,3 +1,7 @@
+index-group=Unrevised
+type=page
+status=published
+~~~~~~
 # Microprofile Fault Tolerance - Retry policy
 This is an example of how to use Microprofile @Retry in TomEE.
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/d12cfb2f/examples/mp-rest-jwt/README.md
----------------------------------------------------------------------
diff --git a/examples/mp-rest-jwt/README.md b/examples/mp-rest-jwt/README.md
index 60a4e62..fdd20da 100644
--- a/examples/mp-rest-jwt/README.md
+++ b/examples/mp-rest-jwt/README.md
@@ -1,3 +1,7 @@
+index-group=Unrevised
+type=page
+status=published
+~~~~~~
 # MP REST JWT
 This is a basic example on how to configure and use MicroProfile JWT in TomEE.
 


[5/6] tomee git commit: replacing Boolean with primitive boolean

Posted by jl...@apache.org.
replacing Boolean with primitive boolean


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/8966898c
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/8966898c
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/8966898c

Branch: refs/heads/master
Commit: 8966898c8533a08d6a330cbaf4f48c7e593993df
Parents: 4c18642
Author: CesarHernandezGt <cf...@gmail.com>
Authored: Fri Dec 14 09:40:29 2018 -0600
Committer: CesarHernandezGt <cf...@gmail.com>
Committed: Fri Dec 14 09:40:29 2018 -0600

----------------------------------------------------------------------
 .../jwt/jaxrs/MPJWTSecurityAnnotationsInterceptor.java             | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/8966898c/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/jaxrs/MPJWTSecurityAnnotationsInterceptor.java
----------------------------------------------------------------------
diff --git a/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/jaxrs/MPJWTSecurityAnnotationsInterceptor.java b/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/jaxrs/MPJWTSecurityAnnotationsInterceptor.java
index ad067d3..fdba7bc 100644
--- a/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/jaxrs/MPJWTSecurityAnnotationsInterceptor.java
+++ b/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/jaxrs/MPJWTSecurityAnnotationsInterceptor.java
@@ -42,7 +42,7 @@ public class MPJWTSecurityAnnotationsInterceptor implements ContainerRequestFilt
 
         if (roles != null && !roles.isEmpty()) {
             final SecurityContext securityContext = requestContext.getSecurityContext();
-            Boolean hasAtLeasOneValidRole = false;
+            boolean hasAtLeasOneValidRole = false;
             for (String role : roles) {
                 if (securityContext.isUserInRole(role)) {
                     hasAtLeasOneValidRole = true;


[2/6] tomee git commit: Added index headers to mp-config-example

Posted by jl...@apache.org.
Added index headers to mp-config-example


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

Branch: refs/heads/master
Commit: e8ad43b3eed4b6cf863332c8dd3ac4b756306bb6
Parents: d12cfb2
Author: CesarHernandezGt <cf...@gmail.com>
Authored: Thu Dec 13 01:27:46 2018 -0600
Committer: CesarHernandezGt <cf...@gmail.com>
Committed: Thu Dec 13 01:27:46 2018 -0600

----------------------------------------------------------------------
 examples/mp-config-example/README.md | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/e8ad43b3/examples/mp-config-example/README.md
----------------------------------------------------------------------
diff --git a/examples/mp-config-example/README.md b/examples/mp-config-example/README.md
index b7bccc9..2a0a2f6 100644
--- a/examples/mp-config-example/README.md
+++ b/examples/mp-config-example/README.md
@@ -1,3 +1,7 @@
+index-group=Unrevised
+type=page
+status=published
+~~~~~~
 # Microprofile Config
 This is an example on how to use microprofile config in TomEE.
 


[4/6] tomee git commit: TOMEE-2357 a test in mp-rest-jwt example updated to validate this ticket fix

Posted by jl...@apache.org.
TOMEE-2357 a test in mp-rest-jwt example updated to validate this ticket fix


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/4c186420
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/4c186420
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/4c186420

Branch: refs/heads/master
Commit: 4c186420b2148854974e3c79ce563918e17b2454
Parents: d9563f8
Author: CesarHernandezGt <cf...@gmail.com>
Authored: Thu Dec 13 20:54:25 2018 -0600
Committer: CesarHernandezGt <cf...@gmail.com>
Committed: Thu Dec 13 20:54:25 2018 -0600

----------------------------------------------------------------------
 .../src/test/java/org/superbiz/moviefun/MoviesTest.java         | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/4c186420/examples/mp-rest-jwt/src/test/java/org/superbiz/moviefun/MoviesTest.java
----------------------------------------------------------------------
diff --git a/examples/mp-rest-jwt/src/test/java/org/superbiz/moviefun/MoviesTest.java b/examples/mp-rest-jwt/src/test/java/org/superbiz/moviefun/MoviesTest.java
index 98af3bc..731a194 100644
--- a/examples/mp-rest-jwt/src/test/java/org/superbiz/moviefun/MoviesTest.java
+++ b/examples/mp-rest-jwt/src/test/java/org/superbiz/moviefun/MoviesTest.java
@@ -87,13 +87,12 @@ public class MoviesTest {
         assertTrue(response.getStatus() == 204);
 
 
-        //GET movies (Using token1.json with group of claims: [read-only])
-        //This test should be updated to use token2.json once TOMEE-2357 gets resolved.
+        //GET movies (Using token2.json with group of claims: [read-only])
         Collection<? extends Movie> movies = webClient
                 .reset()
                 .path("/rest/cinema/movies")
                 .header("Content-Type", "application/json")
-                .header("Authorization", "Bearer " + token(1))
+                .header("Authorization", "Bearer " + token(2))
                 .getCollection(Movie.class);
         LOGGER.info(movies.toString());
         assertTrue(movies.size() == 1);


[6/6] tomee git commit: This closes apache/tomee#275

Posted by jl...@apache.org.
This closes apache/tomee#275


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

Branch: refs/heads/master
Commit: cad956dcf61d1be00b718f8fb77d2981bc073903
Parents: e8ad43b 8966898
Author: Jean-Louis Monteiro <je...@gmail.com>
Authored: Fri Dec 14 16:55:36 2018 +0100
Committer: Jean-Louis Monteiro <je...@gmail.com>
Committed: Fri Dec 14 16:55:36 2018 +0100

----------------------------------------------------------------------
 .../apache/openejb/config/CmpJpaConversion.java |  5 +-
 examples/mp-rest-jwt/pom.xml                    | 27 ++----
 .../java/org/superbiz/moviefun/MoviesTest.java  |  5 +-
 .../MPJWTSecurityAnnotationsInterceptor.java    |  9 +-
 .../server/cxf/rs/ApplicationFeatureTest.java   | 87 ++++++++++++++++++++
 .../apache/openejb/server/rest/RESTService.java |  2 +
 6 files changed, 106 insertions(+), 29 deletions(-)
----------------------------------------------------------------------



[3/6] tomee git commit: TOMEE-2357 now if at least 1 role is valid from the security context, , successfull access is granted

Posted by jl...@apache.org.
TOMEE-2357 now if at least 1 role is valid from the security context, , successfull access is granted


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

Branch: refs/heads/master
Commit: d9563f82ca7852995f31dacf04956d84120ac65c
Parents: 2c1ee1f
Author: CesarHernandezGt <cf...@gmail.com>
Authored: Thu Dec 13 20:53:05 2018 -0600
Committer: CesarHernandezGt <cf...@gmail.com>
Committed: Thu Dec 13 20:53:05 2018 -0600

----------------------------------------------------------------------
 .../jwt/jaxrs/MPJWTSecurityAnnotationsInterceptor.java      | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/d9563f82/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/jaxrs/MPJWTSecurityAnnotationsInterceptor.java
----------------------------------------------------------------------
diff --git a/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/jaxrs/MPJWTSecurityAnnotationsInterceptor.java b/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/jaxrs/MPJWTSecurityAnnotationsInterceptor.java
index f604e6b..ad067d3 100644
--- a/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/jaxrs/MPJWTSecurityAnnotationsInterceptor.java
+++ b/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/jaxrs/MPJWTSecurityAnnotationsInterceptor.java
@@ -39,14 +39,19 @@ public class MPJWTSecurityAnnotationsInterceptor implements ContainerRequestFilt
         }
 
         final Set<String> roles = rolesAllowed.get(resourceInfo.getResourceMethod());
+
         if (roles != null && !roles.isEmpty()) {
             final SecurityContext securityContext = requestContext.getSecurityContext();
+            Boolean hasAtLeasOneValidRole = false;
             for (String role : roles) {
-                if (!securityContext.isUserInRole(role)) {
-                    forbidden(requestContext);
+                if (securityContext.isUserInRole(role)) {
+                    hasAtLeasOneValidRole = true;
                     break;
                 }
             }
+            if (!hasAtLeasOneValidRole) {
+                forbidden(requestContext);
+            }
         }
 
     }