public interface OpaJwtPrincipal
extends java.security.Principal
SecurityContext
that optionally contains a JWT and a set
of constraints as JSON object string.
The OpaJwtPrincipal
can be injected as field in endpoint implementations using Context
when the OpaBundle
is used to setup the open policy agent
configuration.
Modifier and Type | Method and Description |
---|---|
static OpaJwtPrincipalImpl |
create(java.lang.String jwt,
java.util.Map<java.lang.String,com.auth0.jwt.interfaces.Claim> claims,
com.fasterxml.jackson.databind.JsonNode constraints,
com.fasterxml.jackson.databind.ObjectMapper om) |
java.util.Map<java.lang.String,com.auth0.jwt.interfaces.Claim> |
getClaims() |
java.lang.String |
getConstraints() |
<T> T |
getConstraintsAsEntity(java.lang.Class<T> resultType)
returns the constraint as Object.
|
java.lang.String |
getJwt() |
static OpaJwtPrincipalImpl create(java.lang.String jwt, java.util.Map<java.lang.String,com.auth0.jwt.interfaces.Claim> claims, com.fasterxml.jackson.databind.JsonNode constraints, com.fasterxml.jackson.databind.ObjectMapper om)
jwt
- The token this Principal is created from. May be required to pass it to other
services.claims
- The claims in the verified jwt
.om
- The Object Mapper to use to decode the constraints.constraints
- Authorization details used within the service for limiting result datajava.lang.String getJwt()
java.util.Map<java.lang.String,com.auth0.jwt.interfaces.Claim> getClaims()
java.lang.String getConstraints()
<T> T getConstraintsAsEntity(java.lang.Class<T> resultType)
T
- type for correct castingresultType
- Result class to that the constraint string is parsed