Class OutboundConfig
- java.lang.Object
-
- io.helidon.security.providers.common.OutboundConfig
-
public final class OutboundConfig extends Object
Configuration of outbound security targets. This is a common implementation for outbound security providers that want to have configuration of enabled endpoints based on transport (http/https etc.) and hosts (or ip addresses) with support for asterisk (*) wildcard. Use fromOutboundSecurityProvider.isOutboundSupported(ProviderRequest, SecurityEnvironment, EndpointConfig)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OutboundConfig.Builder
OutboundConfig
builder when not reading it from configuration.
-
Field Summary
Fields Modifier and Type Field Description static String
CONFIG_OUTBOUND
Configuration key (expected under provider configuration) that holds the object list ofOutboundTarget
s configuration.
-
Constructor Summary
Constructors Constructor Description OutboundConfig()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OutboundConfig.Builder
builder()
New builder to programmatically build targets.static OutboundConfig
create(Config providerConfig)
Parse targets from provider configuration.static OutboundConfig
create(Config providerConfig, OutboundTarget... defaults)
Parse targets from provider configuration with possible default targets.Optional<OutboundTarget>
findTarget(SecurityEnvironment env)
Find target for current security request.List<OutboundTarget>
targets()
Outbound targets configured for outbound handling.
-
-
-
Field Detail
-
CONFIG_OUTBOUND
public static final String CONFIG_OUTBOUND
Configuration key (expected under provider configuration) that holds the object list ofOutboundTarget
s configuration.- See Also:
- Constant Field Values
-
-
Method Detail
-
create
public static OutboundConfig create(Config providerConfig)
Parse targets from provider configuration.- Parameters:
providerConfig
- configuration object of current provider- Returns:
- new instance with targets from configuration
-
create
public static OutboundConfig create(Config providerConfig, OutboundTarget... defaults)
Parse targets from provider configuration with possible default targets. In case the configuration contains a target named "default", the defaults provided to this method will be ignored.- Parameters:
providerConfig
- configuration object of current providerdefaults
- default target configuration (e.g. known public endpoints that are expected static in time)- Returns:
- new instance with targets from configuration, defaults are first (unless overridden)
-
builder
public static OutboundConfig.Builder builder()
New builder to programmatically build targets.- Returns:
- new Builder instance
-
findTarget
public Optional<OutboundTarget> findTarget(SecurityEnvironment env)
Find target for current security request. Example of implementation ofOutboundSecurityProvider.isOutboundSupported(ProviderRequest, SecurityEnvironment, EndpointConfig)
:return (null != outboundTargets) && outboundTargets.findTarget(request).isPresent();
- Parameters:
env
- request we are processing- Returns:
- TargetConfig wrapped in
Optional
valid for the request
-
targets
public List<OutboundTarget> targets()
Outbound targets configured for outbound handling. Each target defines a protocol, host and path it is valid for (maybe using wildcards). Additional configuration is usually added to a target for a specific provider.- Returns:
- list of targets defined
-
-