Class OutboundConfig
java.lang.Object
io.helidon.security.providers.common.OutboundConfig
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 from
OutboundSecurityProvider.isOutboundSupported(ProviderRequest, SecurityEnvironment, EndpointConfig)-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classOutboundConfigbuilder when not reading it from configuration. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConfiguration key (expected under provider configuration) that holds the object list ofOutboundTargets configuration.static final StringProperty used for outbound calls with clients to disable registration/running of outbound security. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic OutboundConfig.Builderbuilder()New builder to programmatically build targets.static OutboundConfigDeprecated, for removal: This API element is subject to removal in a future version.static OutboundConfigcreate(Config config, OutboundTarget... defaults) Deprecated, for removal: This API element is subject to removal in a future version.static OutboundConfigParse targets from provider configuration.static OutboundConfigcreate(Config providerConfig, OutboundTarget... defaults) Parse targets from provider configuration with possible default targets.Find target for current security request.<T> Optional<T> findTargetCustomObject(SecurityEnvironment env, Class<T> customObjectClass, Function<Config, ? extends T> customObjectProducer, Supplier<? extends T> defaultValue) Find, create and cache a custom object associated with a specific outbound target.targets()Outbound targets configured for outbound handling.
-
Field Details
-
CONFIG_OUTBOUND
Configuration key (expected under provider configuration) that holds the object list ofOutboundTargets configuration.- See Also:
-
PROPERTY_DISABLE_OUTBOUND
Property used for outbound calls with clients to disable registration/running of outbound security. This may be used from clients that set up outbound security explicitly. By default this property is assumed to befalse, so outbound is enabled- See Also:
-
-
Constructor Details
-
OutboundConfig
public OutboundConfig()
-
-
Method Details
-
create
Deprecated, for removal: This API element is subject to removal in a future version.usecreate(io.helidon.config.Config)insteadParse targets from provider configuration.- Parameters:
config- configuration- Returns:
- new instance
-
create
Parse targets from provider configuration.- Parameters:
providerConfig- configuration object of current provider- Returns:
- new instance with targets from configuration
-
create
@Deprecated(since="4.4.0", forRemoval=true) public static OutboundConfig create(Config config, OutboundTarget... defaults) Deprecated, for removal: This API element is subject to removal in a future version.Parse targets from provider configuration with possible default targets.- Parameters:
config- configurationdefaults- default target configuration- Returns:
- new instance
-
create
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
New builder to programmatically build targets.- Returns:
- new Builder instance
-
findTarget
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
Optionalvalid for the request
-
findTargetCustomObject
public <T> Optional<T> findTargetCustomObject(SecurityEnvironment env, Class<T> customObjectClass, Function<Config, ? extends T> customObjectProducer, Supplier<? extends T> defaultValue) Find, create and cache a custom object associated with a specific outbound target.- Type Parameters:
T- type of the custom object- Parameters:
env- Security environment to find the outbound targetcustomObjectClass- class of the custom objectcustomObjectProducer- a producer of the custom object from config associated with the targetdefaultValue- supplier of the custom object if there is no object nor config associated with the target- Returns:
- custom object (cached for further calls) if a target was found, empty otherwise
-
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
-
create(io.helidon.config.Config)instead