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 SummaryNested ClassesModifier and TypeClassDescriptionstatic final classFluent API builder to createCompositeProviderSelectionPolicy.Nested classes/interfaces inherited from interface io.helidon.security.spi.ProviderSelectionPolicyProviderSelectionPolicy.Providers
- 
Method SummaryModifier and TypeMethodDescriptionbuilder()Builder for this selection policy.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- 
builderBuilder for this selection policy.- Returns:
- builder instance
 
- 
createpublic 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)
 
- 
selectProviderDescription copied from interface:ProviderSelectionPolicySelect a provider instance of the type defined that this policy has configured as the default.- Specified by:
- selectProviderin interface- ProviderSelectionPolicy
- Type Parameters:
- T- type of provider
- Parameters:
- providerType- type of provider (one of- AuthenticationProvider,- AuthorizationProvider)
- Returns:
- security provider instance
 
- 
selectOutboundProvidersDescription 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 interface- ProviderSelectionPolicy
- Returns:
- list of outbound provider to choose from (may be empty)
 
- 
selectProviderpublic <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 interface- ProviderSelectionPolicy
- Type Parameters:
- T- type of provider
- Parameters:
- providerType- type of provider (one of- AuthenticationProvider,- AuthorizationProvideror- OutboundSecurityProvider)
- requestedName- explicit provider name to find
- Returns:
- security provider instance
 
 
-