Class AbacProvider
java.lang.Object
io.helidon.security.providers.abac.AbacProvider
- All Implemented Interfaces:
AuthorizationProvider, SecurityProvider
Attribute based access control (ABAC) provider.
This provider gathers all attributes to be validated on endpoint and makes sure they are all validated as expected during
authorization process.
Each attribute to be validated must have a
AbacValidator implemented.- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TypeNameType name forjakarta.annotation.security.DenyAll.static final TypeNameType name forjavax.annotation.security.DenyAll.static final TypeNameType name forjakarta.annotation.security.PermitAll.static final TypeNameType name forjavax.annotation.security.PermitAll.static final TypeNameType name forjakarta.annotation.security.RolesAllowed.static final TypeNameType name forjavax.annotation.security.RolesAllowed. -
Method Summary
Modifier and TypeMethodDescriptionauthorize(ProviderRequest providerRequest) Authorize a request based on configuration.static AbacProvider.Builderbuilder()Creates a fluent API builder to build new instances of this class.static AbacProvidercreate()Creates a new provider instance with default configuration.static AbacProviderCreates a new provider instance from configuration.Collection<Class<? extends Annotation>> Provide extension annotations supported by this provider (e.g.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AuthorizationProvider
isUserInRoleModifier and TypeMethodDescriptiondefault booleanisUserInRole(Subject subject, String role) Return true if current user is in the specified role.Methods inherited from interface SecurityProvider
supportedAttributes, supportedConfigKeys, supportedCustomObjectsModifier and TypeMethodDescriptiondefault Collection<String> A collection of attribute names expected by this provider to override endpoint configuration.default Collection<String> Keys expected in configuration.default Collection<Class<? extends ProviderConfig>> Class of the configuration type.
-
Field Details
-
ROLES_ALLOWED_JAKARTA_TYPE
Type name forjakarta.annotation.security.RolesAllowed. -
ROLES_ALLOWED_JAVAX_TYPE
Type name forjavax.annotation.security.RolesAllowed. -
PERMIT_ALL_JAKARTA_TYPE
Type name forjakarta.annotation.security.PermitAll. -
PERMIT_ALL_JAVAX_TYPE
Type name forjavax.annotation.security.PermitAll. -
DENY_ALL_JAKARTA_TYPE
Type name forjakarta.annotation.security.DenyAll. -
DENY_ALL_JAVAX_TYPE
Type name forjavax.annotation.security.DenyAll.
-
-
Method Details
-
builder
Creates a fluent API builder to build new instances of this class.- Returns:
- a new builder instance
-
create
Creates a new provider instance from configuration.- Parameters:
config- configuration- Returns:
- ABAC provider instantiated from config
-
create
Creates a new provider instance with default configuration.- Returns:
- ABAC provider
-
supportedAnnotations
Description copied from interface:SecurityProviderProvide extension annotations supported by this provider (e.g.jakarta.annotation.security.RolesAllowed). Annotations will be collected according to framework in use. For endpoint-style integrations, annotations from the application layer, endpoint class, and endpoint methods may all be collected.- Specified by:
supportedAnnotationsin interfaceSecurityProvider- Returns:
- Collection of annotations this provider expects.
-
authorize
Description copied from interface:AuthorizationProviderAuthorize a request based on configuration. Authorization cannot be optional. If this method is called, it should always attempt to authorize the current request. This method will be invoked for inbound requests ONLY.- Specified by:
authorizein interfaceAuthorizationProvider- Parameters:
providerRequest- context of this security enforcement/validation- Returns:
- response that either permits, denies or abstains from decision
- See Also:
-