Package io.helidon.webserver.security
Class SecurityHandlerConfig.BuilderBase<BUILDER extends SecurityHandlerConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends SecurityHandlerConfig>
java.lang.Object
io.helidon.webserver.security.SecurityHandlerConfig.BuilderBase<BUILDER,PROTOTYPE>
- Type Parameters:
BUILDER
- type of the builder extending this abstract builderPROTOTYPE
- type of the prototype interface that would be built byPrototype.Builder.buildPrototype()
- All Implemented Interfaces:
Prototype.Builder<BUILDER,
,PROTOTYPE> Prototype.ConfiguredBuilder<BUILDER,
PROTOTYPE>
- Direct Known Subclasses:
SecurityHandlerConfig.Builder
- Enclosing interface:
SecurityHandlerConfig
public abstract static class SecurityHandlerConfig.BuilderBase<BUILDER extends SecurityHandlerConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends SecurityHandlerConfig>
extends Object
implements Prototype.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for
SecurityHandler
.-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
Generated implementation of the prototype, can be extended by descendant prototype implementations. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionRegister a custom object for security request(s).Register a custom object for security request(s).addQueryParam
(SecurityHandler.QueryParamHandler queryParam) Query parameter handler(s).addQueryParams
(List<? extends SecurityHandler.QueryParamHandler> queryParams) Query parameter handler(s).addRoleAllowed
(String roleAllowed) An array of allowed roles for this path - must have a security provider supporting roles (either authentication or authorization provider).addRolesAllowed
(Set<? extends String> rolesAllowed) An array of allowed roles for this path - must have a security provider supporting roles (either authentication or authorization provider).addSockets
(List<? extends String> sockets) List of sockets this configuration should be applied to.audit()
Whether to audit this request - defaults to false, if enabled, request is audited with event type "request".audit
(boolean audit) Whether to audit this request - defaults to false, if enabled, request is audited with event type "request".Override for event-type, defaults to "request".auditEventType
(String auditEventType) Override for event-type, defaults to "request".Override for audit message format, defaults to "%3$s %1$s \"%2$s\" %5$s %6$s requested by %4$s".auditMessageFormat
(String auditMessageFormat) Override for audit message format, defaults to "%3$s %1$s \"%2$s\" %5$s %6$s requested by %4$s".If called, request will go through authentication process - defaults to false (even if authorize is true).authenticate
(boolean authenticate) If called, request will go through authentication process - defaults to false (even if authorize is true).If called, authentication failure will not abort request and will continue as anonymous (defaults to false).authenticationOptional
(boolean authenticationOptional) If called, authentication failure will not abort request and will continue as anonymous (defaults to false).Use a named authenticator (as supported by security - if not defined, default authenticator is used).authenticator
(String authenticator) Use a named authenticator (as supported by security - if not defined, default authenticator is used).Enable authorization for this route.authorize
(boolean authorize) Enable authorization for this route.Use a named authorizer (as supported by security - if not defined, default authorizer is used, if none defined, all is permitted).authorizer
(String authorizer) Use a named authorizer (as supported by security - if not defined, default authorizer is used, if none defined, all is permitted).Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.Clear existing value of this property.boolean
combined()
Whether this is a combined handler.combined
(boolean combined) Whether this is a combined handler.config()
If this instance was configured, this would be the config instance used.Update builder from configuration (node of this type).A store of custom objects, that can be used to customize specific security providers.customObjects
(ClassToInstanceStore<Object> customObjects) A store of custom objects, that can be used to customize specific security providers.from
(SecurityHandlerConfig prototype) Update this builder from an existing prototype instance.from
(SecurityHandlerConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.protected void
Handles providers and decorators.Query parameter handler(s).queryParams
(List<? extends SecurityHandler.QueryParamHandler> queryParams) Query parameter handler(s).An array of allowed roles for this path - must have a security provider supporting roles (either authentication or authorization provider).rolesAllowed
(Set<? extends String> rolesAllowed) An array of allowed roles for this path - must have a security provider supporting roles (either authentication or authorization provider).sockets()
List of sockets this configuration should be applied to.List of sockets this configuration should be applied to.toString()
protected void
Validates required properties.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.helidon.builder.api.Prototype.Builder
buildPrototype, self
Methods inherited from interface io.helidon.builder.api.Prototype.ConfiguredBuilder
discoverService, discoverServices
-
Constructor Details
-
BuilderBase
protected BuilderBase()Protected to support extensibility.
-
-
Method Details
-
from
Update this builder from an existing prototype instance. This method disables automatic service discovery.- Parameters:
prototype
- existing prototype to update this builder from- Returns:
- updated builder instance
-
from
Update this builder from an existing prototype builder instance.- Parameters:
builder
- existing builder prototype to update this builder from- Returns:
- updated builder instance
-
addObject
Register a custom object for security request(s). This creates a hard dependency on a specific security provider, so use with care.- Parameters:
object
- An object expected by security provider- Returns:
- updated builder instance
-
addObject
Register a custom object for security request(s). This creates a hard dependency on a specific security provider, so use with care.- Parameters:
object
- An object expected by security provider- Returns:
- updated builder instance
-
config
Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
config
in interfacePrototype.ConfiguredBuilder<BUILDER extends SecurityHandlerConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends SecurityHandlerConfig> - Parameters:
config
- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
rolesAllowed
An array of allowed roles for this path - must have a security provider supporting roles (either authentication or authorization provider). This method enables authentication and authorization (you can disable them again by callingSecurityHandler.skipAuthorization()
andauthenticationOptional()
if needed).- Parameters:
rolesAllowed
- if subject is any of these roles, allow access- Returns:
- updated builder instance
- See Also:
-
addRolesAllowed
An array of allowed roles for this path - must have a security provider supporting roles (either authentication or authorization provider). This method enables authentication and authorization (you can disable them again by callingSecurityHandler.skipAuthorization()
andauthenticationOptional()
if needed).- Parameters:
rolesAllowed
- if subject is any of these roles, allow access- Returns:
- updated builder instance
- See Also:
-
addRoleAllowed
An array of allowed roles for this path - must have a security provider supporting roles (either authentication or authorization provider). This method enables authentication and authorization (you can disable them again by callingSecurityHandler.skipAuthorization()
andauthenticationOptional()
if needed).- Parameters:
roleAllowed
- if subject is any of these roles, allow access- Returns:
- updated builder instance
- See Also:
-
clearAuthenticator
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
authenticator
Use a named authenticator (as supported by security - if not defined, default authenticator is used). Will enable authentication.- Parameters:
authenticator
- name of authenticator as configured inSecurity
- Returns:
- updated builder instance
- See Also:
-
clearAuthorizer
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
authorizer
Use a named authorizer (as supported by security - if not defined, default authorizer is used, if none defined, all is permitted). Will enable authorization.- Parameters:
authorizer
- name of authorizer as configured inSecurity
- Returns:
- updated builder instance
- See Also:
-
clearAuthenticate
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
authenticate
If called, request will go through authentication process - defaults to false (even if authorize is true).- Parameters:
authenticate
- whether to authenticate or not- Returns:
- updated builder instance
- See Also:
-
clearAuthenticationOptional
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
authenticationOptional
If called, authentication failure will not abort request and will continue as anonymous (defaults to false).- Parameters:
authenticationOptional
- whether authn is optional- Returns:
- updated builder instance
- See Also:
-
clearAudit
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
audit
Whether to audit this request - defaults to false, if enabled, request is audited with event type "request".- Parameters:
audit
- whether to audit- Returns:
- updated builder instance
- See Also:
-
clearAuthorize
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
authorize
Enable authorization for this route.- Parameters:
authorize
- whether to authorize- Returns:
- updated builder instance
- See Also:
-
clearAuditEventType
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
auditEventType
Override for event-type, defaults to "request".- Parameters:
auditEventType
- audit event type to use- Returns:
- updated builder instance
- See Also:
-
clearAuditMessageFormat
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
auditMessageFormat
Override for audit message format, defaults to "%3$s %1$s \"%2$s\" %5$s %6$s requested by %4$s".- Parameters:
auditMessageFormat
- audit message format to use- Returns:
- updated builder instance
- See Also:
-
queryParams
Query parameter handler(s).- Parameters:
queryParams
- query parameters- Returns:
- updated builder instance
- See Also:
-
addQueryParams
Query parameter handler(s).- Parameters:
queryParams
- query parameters- Returns:
- updated builder instance
- See Also:
-
addQueryParam
Query parameter handler(s).- Parameters:
queryParam
- query parameters- Returns:
- updated builder instance
- See Also:
-
clearCustomObjects
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
customObjects
A store of custom objects, that can be used to customize specific security providers.- Parameters:
customObjects
- custom objects- Returns:
- updated builder instance
- See Also:
-
sockets
List of sockets this configuration should be applied to. If empty, the configuration is applied to all configured sockets.- Parameters:
sockets
- list of sockets- Returns:
- updated builder instance
- See Also:
-
addSockets
List of sockets this configuration should be applied to. If empty, the configuration is applied to all configured sockets.- Parameters:
sockets
- list of sockets- Returns:
- updated builder instance
- See Also:
-
combined
Whether this is a combined handler. Internal use.- Parameters:
combined
- if combined handler- Returns:
- updated builder instance
- See Also:
-
rolesAllowed
An array of allowed roles for this path - must have a security provider supporting roles (either authentication or authorization provider). This method enables authentication and authorization (you can disable them again by callingSecurityHandler.skipAuthorization()
andauthenticationOptional()
if needed).- Returns:
- the roles allowed
-
authenticator
Use a named authenticator (as supported by security - if not defined, default authenticator is used). Will enable authentication.- Returns:
- the authenticator
-
authorizer
Use a named authorizer (as supported by security - if not defined, default authorizer is used, if none defined, all is permitted). Will enable authorization.- Returns:
- the authorizer
-
authenticate
If called, request will go through authentication process - defaults to false (even if authorize is true).- Returns:
- the authenticate
-
authenticationOptional
If called, authentication failure will not abort request and will continue as anonymous (defaults to false).- Returns:
- the authentication optional
-
audit
Whether to audit this request - defaults to false, if enabled, request is audited with event type "request".- Returns:
- the audit
-
authorize
Enable authorization for this route.- Returns:
- the authorize
-
auditEventType
Override for event-type, defaults to "request".- Returns:
- the audit event type
-
auditMessageFormat
Override for audit message format, defaults to "%3$s %1$s \"%2$s\" %5$s %6$s requested by %4$s".- Returns:
- the audit message format
-
queryParams
Query parameter handler(s).- Returns:
- the query params
-
customObjects
A store of custom objects, that can be used to customize specific security providers.- Returns:
- the custom objects
-
sockets
List of sockets this configuration should be applied to. If empty, the configuration is applied to all configured sockets.- Returns:
- the sockets
-
combined
public boolean combined()Whether this is a combined handler. Internal use.- Returns:
- the combined
-
config
If this instance was configured, this would be the config instance used.- Returns:
- config node used to configure this builder, or empty if not configured
-
toString
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators. -
validatePrototype
protected void validatePrototype()Validates required properties.
-