Class InboundClientDefinition.Builder
- java.lang.Object
-
- io.helidon.security.providers.httpsign.InboundClientDefinition.Builder
-
- All Implemented Interfaces:
Builder<InboundClientDefinition>,Supplier<InboundClientDefinition>
- Enclosing class:
- InboundClientDefinition
public static final class InboundClientDefinition.Builder extends Object implements Builder<InboundClientDefinition>
Fluent API builder to create a new instance ofInboundClientDefinition. Usebuild()to create the instance.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InboundClientDefinition.Builderalgorithm(String algorithm)Algorithm of signature used by this client.InboundClientDefinitionbuild()Build the instance from this builder.InboundClientDefinition.Builderconfig(Config config)Create a builder instance from configuration.InboundClientDefinition.BuilderhmacSecret(byte[] secret)For hmac-sha256 algorithm, this provides access to a secret shared with the client.InboundClientDefinition.BuilderhmacSecret(String secret)Helper method to configure a password-like secret (instead of byte basedhmacSecret(byte[]).InboundClientDefinition.BuilderkeyId(String keyId)The key id of this client to map to this signature validation configuration.InboundClientDefinition.BuilderprincipalName(String name)The principal name of the client, defaults to keyId if not configured.InboundClientDefinition.BuilderpublicKeyConfig(KeyConfig keyConfig)For algorithms based on public/private key (such as rsa-sha256), this provides access to the public key of the client.InboundClientDefinition.BuildersubjectType(SubjectType type)The type of principal we have authenticated (either user or service, defaults to service).
-
-
-
Method Detail
-
principalName
public InboundClientDefinition.Builder principalName(String name)
The principal name of the client, defaults to keyId if not configured.- Parameters:
name- name of security principal- Returns:
- updated builder instance
-
keyId
public InboundClientDefinition.Builder keyId(String 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
public InboundClientDefinition.Builder subjectType(SubjectType type)
The type of principal we have authenticated (either user or service, defaults to service).- Parameters:
type- principal type- Returns:
- updated builder instance
-
algorithm
public InboundClientDefinition.Builder algorithm(String 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
public InboundClientDefinition.Builder publicKeyConfig(KeyConfig keyConfig)
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
public InboundClientDefinition.Builder hmacSecret(byte[] secret)
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
public InboundClientDefinition.Builder hmacSecret(String secret)
Helper method to configure a password-like secret (instead of byte basedhmacSecret(byte[]). The password is transformed to bytes withStandardCharsets.UTF_8charset.- Parameters:
secret- shared secret to validate signature- Returns:
- updated builder instance
-
build
public InboundClientDefinition build()
Description copied from interface:BuilderBuild the instance from this builder.- Specified by:
buildin interfaceBuilder<InboundClientDefinition>- Returns:
- instance of the built type
-
config
public InboundClientDefinition.Builder config(Config config)
Create a builder instance from configuration.- Parameters:
config- config instance- Returns:
- builder instance initialized from config
-
-