You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by cesarhernandezgt <gi...@git.apache.org> on 2018/12/14 02:55:42 UTC
[GitHub] tomee pull request #275: TOMEE-2357 - Fixed issue and updated test on exampl...
GitHub user cesarhernandezgt opened a pull request:
https://github.com/apache/tomee/pull/275
TOMEE-2357 - Fixed issue and updated test on example application.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/cesarhernandezgt/tomee TOMEE-2357
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/tomee/pull/275.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #275
----
commit d9563f82ca7852995f31dacf04956d84120ac65c
Author: CesarHernandezGt <cf...@...>
Date: 2018-12-14T02:53:05Z
TOMEE-2357 now if at least 1 role is valid from the security context, , successfull access is granted
commit 4c186420b2148854974e3c79ce563918e17b2454
Author: CesarHernandezGt <cf...@...>
Date: 2018-12-14T02:54:25Z
TOMEE-2357 a test in mp-rest-jwt example updated to validate this ticket fix
----
---
[GitHub] tomee pull request #275: TOMEE-2357 - Fixed issue and updated test on exampl...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/tomee/pull/275
---
[GitHub] tomee pull request #275: TOMEE-2357 - Fixed issue and updated test on exampl...
Posted by pzygielo <gi...@git.apache.org>.
Github user pzygielo commented on a diff in the pull request:
https://github.com/apache/tomee/pull/275#discussion_r241679807
--- Diff: mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/jaxrs/MPJWTSecurityAnnotationsInterceptor.java ---
@@ -39,14 +39,19 @@ public void filter(final ContainerRequestContext requestContext) throws IOExcept
}
final Set<String> roles = rolesAllowed.get(resourceInfo.getResourceMethod());
+
if (roles != null && !roles.isEmpty()) {
final SecurityContext securityContext = requestContext.getSecurityContext();
+ Boolean hasAtLeasOneValidRole = false;
--- End diff --
Why not use primitive `boolean`? Avoid boxing here and in L48 and unboxing in L52.
---
[GitHub] tomee pull request #275: TOMEE-2357 - Fixed issue and updated test on exampl...
Posted by cesarhernandezgt <gi...@git.apache.org>.
Github user cesarhernandezgt commented on a diff in the pull request:
https://github.com/apache/tomee/pull/275#discussion_r241796269
--- Diff: mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/jaxrs/MPJWTSecurityAnnotationsInterceptor.java ---
@@ -39,14 +39,19 @@ public void filter(final ContainerRequestContext requestContext) throws IOExcept
}
final Set<String> roles = rolesAllowed.get(resourceInfo.getResourceMethod());
+
if (roles != null && !roles.isEmpty()) {
final SecurityContext securityContext = requestContext.getSecurityContext();
+ Boolean hasAtLeasOneValidRole = false;
--- End diff --
Nice catch @pzygielo !
fixed.
---
[GitHub] tomee issue #275: TOMEE-2357 - Fixed issue and updated test on example appli...
Posted by jeanouii <gi...@git.apache.org>.
Github user jeanouii commented on the issue:
https://github.com/apache/tomee/pull/275
Thanks @pzygielo for the review.
All fixed. I tested locally and looks good.
I'll merge and monitor the build to see if it's ok.
---