Class InboundClientDefinition.Builder
java.lang.Object
io.helidon.security.providers.httpsign.InboundClientDefinition.Builder
- All Implemented Interfaces:
Builder<InboundClientDefinition.Builder,
,InboundClientDefinition> Supplier<InboundClientDefinition>
- Enclosing class:
InboundClientDefinition
public static final class InboundClientDefinition.Builder
extends Object
implements Builder<InboundClientDefinition.Builder,InboundClientDefinition>
Fluent API builder to create a new instance of
InboundClientDefinition
.
Use build()
to create the instance.-
Method Summary
Modifier and TypeMethodDescriptionAlgorithm of signature used by this client.build()
Build the instance from this builder.Create a builder instance from configuration.hmacSecret
(byte[] secret) For hmac-sha256 algorithm, this provides access to a secret shared with the client.hmacSecret
(String secret) Helper method to configure a password-like secret (instead of byte basedhmacSecret(byte[])
.The key id of this client to map to this signature validation configuration.principalName
(String name) The principal name of the client, defaults to keyId if not configured.publicKeyConfig
(Keys keyConfig) For algorithms based on public/private key (such as rsa-sha256), this provides access to the public key of the client.subjectType
(SubjectType type) The type of principal we have authenticated (either user or service, defaults to service).
-
Method Details
-
principalName
The principal name of the client, defaults to keyId if not configured.- Parameters:
name
- name of security principal- Returns:
- updated builder instance
-
keyId
The key id of this client to map to this signature validation configuration.- Parameters:
keyId
- key id as provided in inbound signature- Returns:
- updated builder instance
-
subjectType
The type of principal we have authenticated (either user or service, defaults to service).- Parameters:
type
- principal type- Returns:
- updated builder instance
-
algorithm
Algorithm of signature used by this client. Currently supported:- rsa-sha256 - asymmetric based on public/private keys
- hmac-sha256 - symmetric based on a shared secret
- Parameters:
algorithm
- algorithm used- Returns:
- updated builder instance
-
publicKeyConfig
For algorithms based on public/private key (such as rsa-sha256), this provides access to the public key of the client.- Parameters:
keyConfig
- keys configured to access a public key to validate signature- Returns:
- updated builder instance
-
hmacSecret
For hmac-sha256 algorithm, this provides access to a secret shared with the client.- Parameters:
secret
- shared secret to validate signature- Returns:
- updated builder instance
-
hmacSecret
Helper method to configure a password-like secret (instead of byte basedhmacSecret(byte[])
. The password is transformed to bytes withStandardCharsets.UTF_8
charset.- Parameters:
secret
- shared secret to validate signature- Returns:
- updated builder instance
-
build
Description copied from interface:Builder
Build the instance from this builder.- Specified by:
build
in interfaceBuilder<InboundClientDefinition.Builder,
InboundClientDefinition> - Returns:
- instance of the built type
-
config
Create a builder instance from configuration.- Parameters:
config
- config instance- Returns:
- builder instance initialized from config
-