Class OutboundTargetDefinition.Builder
java.lang.Object
io.helidon.security.providers.httpsign.OutboundTargetDefinition.Builder
- All Implemented Interfaces:
Builder<OutboundTargetDefinition.Builder,
,OutboundTargetDefinition> Supplier<OutboundTargetDefinition>
- Enclosing class:
OutboundTargetDefinition
public static final class OutboundTargetDefinition.Builder
extends Object
implements Builder<OutboundTargetDefinition.Builder,OutboundTargetDefinition>
Fluent API builder to build
OutboundTargetDefinition
instances.
Call build()
to create a new instance.-
Method Summary
Modifier and TypeMethodDescriptionAlgorithm used by this signature.backwardCompatibleEol
(Boolean backwardCompatible) Enable support for Helidon versions before 3.0.0 (exclusive).build()
Build the instance from this builder.Update this builder instance from configuration.header
(HttpSignHeader header) Header to store signature in.hmacSecret
(byte[] secret) Shared secret for HMAC based algorithms.hmacSecret
(String secret) Shared secret for HMAC based algorithms.Key id of this service (will be mapped by target service to validate signature).privateKeyConfig
(Keys keyConfig) Private key configuration for RSA based algorithms.signedHeaders
(SignedHeadersConfig config) Configuration of required and "if-present" headers to be signed for this target.tokenHandler
(TokenHandler tokenHandler) Configure a token handler to create the outbound header.
-
Method Details
-
keyId
Key id of this service (will be mapped by target service to validate signature).- Parameters:
keyId
- key id mapped by target service- Returns:
- updated builder instance
-
header
Header to store signature in.- Parameters:
header
- header type- Returns:
- updated builder instance
-
algorithm
Algorithm used by this signature. Set automatically on call to methodsprivateKeyConfig(io.helidon.common.pki.Keys)
andhmacSecret(byte[])
.- Parameters:
algorithm
- algorithm to use for outbound signatures- Returns:
- updated builder instance
-
privateKeyConfig
Private key configuration for RSA based algorithms. If called sets the algorithm to "rsa-sha256". Expects either explicit private key, or keystore and private key alias.- Parameters:
keyConfig
- private key configuration for outbound signatures- Returns:
- updated builder instance
-
signedHeaders
Configuration of required and "if-present" headers to be signed for this target. Defaults to the same asHttpSignProvider.Builder.inboundRequiredHeaders(SignedHeadersConfig)
.- Parameters:
config
- configuration of outbound headers to be signed for each method.- Returns:
- updated builder instance
-
hmacSecret
Shared secret for HMAC based algorithms. Also sets the algorithm to "hmac-sha256"- Parameters:
secret
- secret to sign outgoing requests (symmetric)- Returns:
- updated builder instance
-
hmacSecret
Shared secret for HMAC based algorithms. CallshmacSecret(byte[])
getting bytes of the secret string with UTF-8.- Parameters:
secret
- shared secret to sign outgoing requests- Returns:
- updated builder instance
-
tokenHandler
Configure a token handler to create the outbound header.- Parameters:
tokenHandler
- token handler to use- Returns:
- updated builder instance
-
build
Description copied from interface:Builder
Build the instance from this builder.- Specified by:
build
in interfaceBuilder<OutboundTargetDefinition.Builder,
OutboundTargetDefinition> - Returns:
- instance of the built type
-
config
Update this builder instance from configuration.- Parameters:
config
- config instance- Returns:
- updated builder instance
-
backwardCompatibleEol
Enable support for Helidon versions before 3.0.0 (exclusive).Until version 3.0.0 (exclusive) there was a trailing end of line added to the signed data. To be able to communicate cross versions, we must configure this when talking to older versions of Helidon. Default value is
false
. In Helidon 2.x, this switch exists as well and the default istrue
, to allow communication between versions as needed.- Parameters:
backwardCompatible
- whether to run in backward compatible mode- Returns:
- updated builder instance
-