Module io.helidon.security
Package io.helidon.security
package io.helidon.security
Security
Supports security for web (and possibly other) resources including:- Authentication: authenticate a request
- Authorization: authorize a request to a resource, possibly using ABAC or RBAC.
- Outbound security: propagating security on outbound calls.
- Audit: auditing security operations
Security
and SecurityContext
.
Various security aspects are pluggable, using providers
to extend functionality.
Bootstrapping
You have two way to do things with security - either load it from configuration or create a fully configured instance using a builder. Both approaches should allow the same behavior.
To create security using builder:
Security
.builder()
.build()
Or using configuration:
Security.create(io.helidon.config.Config)
Configuration example (Google login for users and http-signatures for service):
security:
provider-policy:
# Composite policy when using more than one provider
type: "COMPOSITE"
authentication:
# This is a frontend service - only allow google authentication
- name: "google-login"
outbound:
# Propagate the goole token and this service's identity to backend
- name: "google-login"
- name: "http-signatures"
providers:
# Google login button support - authentication and identity propagation provider
- google-login:
client-id: "your-google-application-id"
# Attribute based access control authorization provider
- abac:
# HTTP signatures - authentication and identity propagation provider (for service identity)
- http-signatures:
outbound:
- name: "backend"
hosts: ["localhost"]
signature:
key-id: "frontend"
# password may be encrypted when using secure filter for Helidon config
hmac.secret: "..."
-
ClassDescriptionAn audit event to store using an Audit provider.Named parameters of audit event.Severity of
AuditEvent
.Response as returned from an authentication provider.Authentication response builder.Response from an authorization decision.Builder for custom Authorization responses.Map of classes to their instances.Flag driving resolution of providers.A provider selection policy that supports composing multiple providers (current Authentication and Outbound) into a single virtual security provider.Fluent API builder to createCompositeProviderSelectionPolicy
.Each endpoint can have security configuration either statically declared (e.g.Scope of annotations used in applications that integrate security.A fluent API builder forEndpointConfig
.A concept representing anything that can be granted to a subject.Grant.Builder<B extends Grant.Builder<B>>NamedProvider<T extends SecurityProvider>A wrapper for a named security provider.Builder constructing a security client - extends theSecurityRequestBuilder
for convenience.Response of outbound security provider.Builder class to build custom identity propagation responses.A security principal.A fluent API builder forPrincipal
.A request sent to security providers.Definition of a map to bind a query param to a header.A security role used in RBAC (role based access control) schemes.A fluent API builder forRole
.Marker interface for configuration of secrets providers.This class is used to "bootstrap" security and integrate it with other frameworks; runtime main entry point isSecurityContext
.Builder pattern class for helping createSecurity
in a convenient way.SecurityClient<T extends SecurityResponse>Common methods for security clients.SecurityClientBuilder<T extends SecurityResponse>Builder constructing a security client - extends theSecurityRequestBuilder
for convenience.Security context to retrieve security information about current user, either injected or obtained fromSecurity.contextBuilder(String)
and to handle programmatic security.Fluent API builder forSecurityContext
.Security environment is a set of attributes that are stable for an interaction (usually a request in our case).A fluent API builder forSecurityEnvironment
.Runtime exception used as by this module to be able to identify exception caused by it.Security level stores annotations bound to the specific class and method.Builder forSecurityLevel
class.Common methods for all security requests (authentication, authorization, and identity propagation).SecurityRequestBuilder<T extends SecurityRequestBuilder<T>>Fluent API to build a security request.Response from security provider (and security Module).Status of a security operation.Time used in security, configurable.Fluent API builder forSecurityTime
.A security subject, representing a user or a service.A fluent API builder forSubject
.Type of principal.