Class AWS4SignedPayloadGenerator
java.lang.Object
software.amazon.msk.auth.iam.internals.AWS4SignedPayloadGenerator
This class is used to generate the AWS Sigv4 signed authentication payload sent by the IAMSaslClient to the broker.
It configures a AWSSigner based on the authentication request parameters. It generates a request with the endpoint
set to the kafka broker (kafka:// as prefix), action set to kafka-cluster:Connect and the Http method as GET.
It then pre-signs the request using the credentials in the authentication request parameters and a expiration period
of 15 minutes. Afterwards, the signed request is converted into a key value map with headers and query parameters
acting as keys. Then the key value map is serialized as a JSON object and returned as bytes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsoftware.amazon.awssdk.http.SdkHttpFullRequestpresignRequest(@NonNull AuthenticationRequestParams params) Presigns the request with AWS sigv4byte[]signedPayload(@NonNull AuthenticationRequestParams params)
-
Constructor Details
-
AWS4SignedPayloadGenerator
public AWS4SignedPayloadGenerator()
-
-
Method Details
-
signedPayload
public byte[] signedPayload(@NonNull @NonNull AuthenticationRequestParams params) throws PayloadGenerationException - Throws:
PayloadGenerationException
-
presignRequest
public software.amazon.awssdk.http.SdkHttpFullRequest presignRequest(@NonNull @NonNull AuthenticationRequestParams params) Presigns the request with AWS sigv4- Parameters:
params- authentication request parameters- Returns:
- presigned request
-