Class RolesEndpoint
- java.lang.Object
-
- org.eclipse.microprofile.jwt.tck.container.jaxrs.RolesEndpoint
-
@Path("/endp") @DenyAll @RequestScoped public class RolesEndpoint extends Object
-
-
Constructor Summary
Constructors Constructor Description RolesEndpoint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description jakarta.ws.rs.core.Response
checkIsUserInRole(jakarta.ws.rs.core.SecurityContext sec)
This endpoint requires a Tester role, and also validates that the caller has the role Echoer by calling SecurityContext.isUserInRole(String).String
echoInput(jakarta.ws.rs.core.SecurityContext sec, String input)
String
echoInput2(jakarta.ws.rs.core.SecurityContext sec, String input)
String
echoInputPermitAll(jakarta.ws.rs.core.SecurityContext sec, String input)
String
echoNeedsToken2Role(jakarta.ws.rs.core.SecurityContext sec, String input)
String
getInjectedPrincipal(jakarta.ws.rs.core.SecurityContext sec)
String
getPrincipalClass(jakarta.ws.rs.core.SecurityContext sec)
Validate that the SecurityContext#getUserPrincipal is a JsonWebTokenString
heartbeat()
String
needsGroup1Mapping(jakarta.ws.rs.core.SecurityContext sec)
This endpoint requires a role that is mapped to the group1 role
-
-
-
Method Detail
-
echoInput
@GET @Path("/echo") @RolesAllowed("Echoer") public String echoInput(@Context jakarta.ws.rs.core.SecurityContext sec, @QueryParam("input") String input)
-
echoInputPermitAll
@GET @Path("/echo-permit-all") @PermitAll public String echoInputPermitAll(@Context jakarta.ws.rs.core.SecurityContext sec, @QueryParam("input") String input)
-
echoInput2
@GET @Path("/echo2") @RolesAllowed("NoSuchUser") public String echoInput2(@Context jakarta.ws.rs.core.SecurityContext sec, @QueryParam("input") String input)
-
echoNeedsToken2Role
@GET @Path("/echoNeedsToken2Role") @RolesAllowed("Token2Role") public String echoNeedsToken2Role(@Context jakarta.ws.rs.core.SecurityContext sec, @QueryParam("input") String input)
-
getPrincipalClass
@GET @Path("/getPrincipalClass") @RolesAllowed("Tester") public String getPrincipalClass(@Context jakarta.ws.rs.core.SecurityContext sec)
Validate that the SecurityContext#getUserPrincipal is a JsonWebToken- Parameters:
sec
-- Returns:
-
needsGroup1Mapping
@GET @Path("/needsGroup1Mapping") @RolesAllowed("Group1MappedRole") public String needsGroup1Mapping(@Context jakarta.ws.rs.core.SecurityContext sec)
This endpoint requires a role that is mapped to the group1 role- Returns:
- principal name
-
checkIsUserInRole
@GET @Path("/checkIsUserInRole") @RolesAllowed("Tester") public jakarta.ws.rs.core.Response checkIsUserInRole(@Context jakarta.ws.rs.core.SecurityContext sec)
This endpoint requires a Tester role, and also validates that the caller has the role Echoer by calling SecurityContext.isUserInRole(String).- Returns:
- principal name or FORBIDDEN error
-
getInjectedPrincipal
@GET @Path("/getInjectedPrincipal") @RolesAllowed("Tester") public String getInjectedPrincipal(@Context jakarta.ws.rs.core.SecurityContext sec)
-
heartbeat
@GET @Path("/heartbeat") @PermitAll public String heartbeat()
-
-