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> ConfigBuilderSupport.ConfiguredBuilder<BUILDER,,PROTOTYPE> ConfigBuilderSupport.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 ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for
SecurityHandlerConfig.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations. -
Constructor Summary
Constructors -
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<String> rolesAllowed) An array of allowed roles for this path - must have a security provider supporting roles (either authentication or authorization provider).addSockets(List<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 audit.Clear existing value of auditEventType.Clear existing value of auditMessageFormat.Clear existing value of authenticate.Clear existing value of authenticationOptional.Clear existing value of authenticator.Clear existing value of authorize.Clear existing value of authorizer.Clear existing value of customObjects.Clear all queryParams.Clear all rolesAllowed.Clear all sockets.booleancombined()Whether this is a combined handler.combined(boolean combined) Whether this is a combined handler.config()Configuration associated with this security handler.Deprecated.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 voidHandles 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<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 voidValidates required properties.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.helidon.builder.api.Prototype.Builder
buildPrototype, self
-
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
Deprecated.Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
configin interfaceConfigBuilderSupport.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
-
config
Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
configin interfaceConfigBuilderSupport.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
-
clearRolesAllowed
Clear all rolesAllowed.- 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).- 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- add single if subject is any of these roles, allow access- Returns:
- updated builder instance
- See Also:
-
clearAuthenticator
Clear existing value of authenticator.- 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 authorizer.- 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 authenticate.- 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 authenticationOptional.- 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 audit.- 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 authorize.- 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 auditEventType.- 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 auditMessageFormat.- 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:
-
clearQueryParams
Clear all queryParams.- 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- add single query parameters- Returns:
- updated builder instance
- See Also:
-
clearCustomObjects
Clear existing value of customObjects.- 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:
-
clearSockets
Clear all sockets.- 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:
- if subject is any of these roles, allow access
-
authenticator
Use a named authenticator (as supported by security - if not defined, default authenticator is used). Will enable authentication.- Returns:
- name of authenticator as configured in
Security
-
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:
- name of authorizer as configured in
Security
-
authenticate
If called, request will go through authentication process - defaults to false (even if authorize is true).- Returns:
- whether to authenticate or not
-
authenticationOptional
If called, authentication failure will not abort request and will continue as anonymous (defaults to false).- Returns:
- whether authn is optional
-
audit
Whether to audit this request - defaults to false, if enabled, request is audited with event type "request".- Returns:
- whether to audit
-
authorize
Enable authorization for this route.- Returns:
- whether to authorize
-
auditEventType
Override for event-type, defaults to "request".- Returns:
- audit event type to use
-
auditMessageFormat
Override for audit message format, defaults to "%3$s %1$s \"%2$s\" %5$s %6$s requested by %4$s".- Returns:
- audit message format to use
-
queryParams
Query parameter handler(s).- Returns:
- query parameters
-
customObjects
A store of custom objects, that can be used to customize specific security providers.- Returns:
- custom objects
-
sockets
List of sockets this configuration should be applied to. If empty, the configuration is applied to all configured sockets.- Returns:
- list of sockets
-
config
Configuration associated with this security handler.- Returns:
- the configuration (if provided)
-
combined
public boolean combined()Whether this is a combined handler. Internal use.- Returns:
- if combined handler
-
toString
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators. -
validatePrototype
protected void validatePrototype()Validates required properties.
-
config(io.helidon.config.Config)