Interface HttpSigner<IdentityT extends Identity>
-
- Type Parameters:
IdentityT- The type of the identity.
- All Known Implementing Classes:
NoOpHttpSigner
@SdkPublicApi public interface HttpSigner<IdentityT extends Identity>
Interface for the process of modifying a request destined for a service so that the service can authenticate the SDK customer’s identity.
-
-
Field Summary
Fields Modifier and Type Field Description static SignerProperty<Clock>SIGNING_CLOCKAClockto be used to derive the signing time.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <T extends Identity>
HttpSigner<T>doNotSign()Retrieve a signer that returns the input message, without signing.default SignedRequestsign(Consumer<SignRequest.Builder<IdentityT>> consumer)Method that takes in inputs to sign a request with sync payload and returns a signed version of the request.SignedRequestsign(SignRequest<? extends IdentityT> request)Method that takes in inputs to sign a request with sync payload and returns a signed version of the request.default CompletableFuture<AsyncSignedRequest>signAsync(Consumer<AsyncSignRequest.Builder<IdentityT>> consumer)Method that takes in inputs to sign a request with async payload and returns a future containing the signed version of the request.CompletableFuture<AsyncSignedRequest>signAsync(AsyncSignRequest<? extends IdentityT> request)Method that takes in inputs to sign a request with async payload and returns a future containing the signed version of the request.
-
-
-
Field Detail
-
SIGNING_CLOCK
static final SignerProperty<Clock> SIGNING_CLOCK
AClockto be used to derive the signing time. This property defaults to the system clock.Note, signing time may not be relevant to some signers.
-
-
Method Detail
-
doNotSign
default <T extends Identity> HttpSigner<T> doNotSign()
Retrieve a signer that returns the input message, without signing.
-
sign
SignedRequest sign(SignRequest<? extends IdentityT> request)
Method that takes in inputs to sign a request with sync payload and returns a signed version of the request.- Parameters:
request- The inputs to sign a request.- Returns:
- A signed version of the request.
-
sign
default SignedRequest sign(Consumer<SignRequest.Builder<IdentityT>> consumer)
Method that takes in inputs to sign a request with sync payload and returns a signed version of the request.Similar to
sign(SignRequest), but takes a lambda to configure a newSignRequest.Builder. This removes the need to callSignRequest#builder(IdentityT)} andSdkBuilder.build().- Parameters:
consumer- AConsumerto which an emptySignRequest.Builderwill be given.- Returns:
- A signed version of the request.
-
signAsync
CompletableFuture<AsyncSignedRequest> signAsync(AsyncSignRequest<? extends IdentityT> request)
Method that takes in inputs to sign a request with async payload and returns a future containing the signed version of the request.- Parameters:
request- The inputs to sign a request.- Returns:
- A future containing the signed version of the request.
-
signAsync
default CompletableFuture<AsyncSignedRequest> signAsync(Consumer<AsyncSignRequest.Builder<IdentityT>> consumer)
Method that takes in inputs to sign a request with async payload and returns a future containing the signed version of the request.Similar to
signAsync(AsyncSignRequest), but takes a lambda to configure a newAsyncSignRequest.Builder. This removes the need to callAsyncSignRequest#builder(IdentityT)} andSdkBuilder.build().- Parameters:
consumer- AConsumerto which an emptyBaseSignRequest.Builderwill be given.- Returns:
- A future containing the signed version of the request.
-
-