java.lang.Object
io.helidon.security.CompositeProviderSelectionPolicy
- All Implemented Interfaces:
ProviderSelectionPolicy
public final class CompositeProviderSelectionPolicy
extends Object
implements ProviderSelectionPolicy
A provider selection policy that supports composing multiple providers (current Authentication and Outbound)
into a single virtual security provider.
Example configuration:
security.provider-policy {
type = "COMPOSITE"
# explicit name of this policy (to be used when this is not the default or when we want to explicitly reference it)
name = "composite"
# whether this is the default provider or not (if not, must be explicitly defined by name, if yes, it is returned)
default = true
authentication: [
{
name = "first"
flag = "REQUIRED"
},
{
name = "second"
}]
outbound: [
{
name = "first"
},
{
name = "second"
}]
}
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classFluent API builder to createCompositeProviderSelectionPolicy.Nested classes/interfaces inherited from interface io.helidon.security.spi.ProviderSelectionPolicy
ProviderSelectionPolicy.Providers -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Builder for this selection policy.Deprecated, for removal: This API element is subject to removal in a future version.Load this policy from config.Specific method for outbound providers, as we have an option to choose the first outbound provider that matches the current request.<T extends SecurityProvider>
Optional<T> selectProvider(Class<T> providerType) Select a provider instance of the type defined that this policy has configured as the default.<T extends SecurityProvider>
Optional<T> selectProvider(Class<T> providerType, String requestedName) Select a provider instance of the type defined that this policy finds for the requested name.
-
Method Details
-
builder
Builder for this selection policy.- Returns:
- builder instance
-
create
@Deprecated(since="4.4.0", forRemoval=true) public static Function<ProviderSelectionPolicy.Providers,ProviderSelectionPolicy> create(Config config) Deprecated, for removal: This API element is subject to removal in a future version.usecreate(io.helidon.config.Config)insteadLoad this policy from config. SeeCompositeProviderSelectionPolicyfor example.- Parameters:
config- configuration instance- Returns:
- function as expected by
Security.Builder.providerSelectionPolicy(Function)
-
create
public static Function<ProviderSelectionPolicy.Providers,ProviderSelectionPolicy> create(Config config) Load this policy from config. SeeCompositeProviderSelectionPolicyfor example.- Parameters:
config- configuration instance- Returns:
- function as expected by
Security.Builder.providerSelectionPolicy(Function)
-
selectProvider
Description copied from interface:ProviderSelectionPolicySelect a provider instance of the type defined that this policy has configured as the default.- Specified by:
selectProviderin interfaceProviderSelectionPolicy- Type Parameters:
T- type of provider- Parameters:
providerType- type of provider (one ofAuthenticationProvider,AuthorizationProvider)- Returns:
- security provider instance
-
selectOutboundProviders
Description copied from interface:ProviderSelectionPolicySpecific method for outbound providers, as we have an option to choose the first outbound provider that matches the current request.- Specified by:
selectOutboundProvidersin interfaceProviderSelectionPolicy- Returns:
- list of outbound provider to choose from (may be empty)
-
selectProvider
public <T extends SecurityProvider> Optional<T> selectProvider(Class<T> providerType, String requestedName) Description copied from interface:ProviderSelectionPolicySelect a provider instance of the type defined that this policy finds for the requested name.- Specified by:
selectProviderin interfaceProviderSelectionPolicy- Type Parameters:
T- type of provider- Parameters:
providerType- type of provider (one ofAuthenticationProvider,AuthorizationProviderorOutboundSecurityProvider)requestedName- explicit provider name to find- Returns:
- security provider instance
-
create(io.helidon.config.Config)instead