Object AwsAuthUtil
-
- All Implemented Interfaces:
public class AwsAuthUtilShared AWS authentication utilities used by both the AWS gateway backend and the Bedrock Mantle backend. Provides SigV4 request signing and API key authorization.
This is an internal utility class. Although it is in a published package, its API is not stable and may change without notice. Do not depend on it directly.
This object is thread-safe. The cached AwsV4HttpSigner instance is stateless and safe for concurrent use, and all methods are pure functions over their arguments.
-
-
Field Summary
Fields Modifier and Type Field Description public final static AwsAuthUtilINSTANCE
-
Method Summary
Modifier and Type Method Description final static HttpRequestsignRequestWithSigV4(HttpRequest request, AwsCredentials credentials, Region region, String serviceName)Signs an HTTP request using AWS SigV4 with the given credentials, region, and service name. final static HttpRequestauthorizeWithApiKey(HttpRequest request, String apiKey)Authorizes an HTTP request using an API key sent as a Bearer token. -
-
Method Detail
-
signRequestWithSigV4
final static HttpRequest signRequestWithSigV4(HttpRequest request, AwsCredentials credentials, Region region, String serviceName)
Signs an HTTP request using AWS SigV4 with the given credentials, region, and service name.
The
connectionheader is excluded from signing because it may be stripped by proxies and must not be part of the SigV4 signature.A
content-typeheader is only required when the request has a body. Body-less requests (e.g.GET,DELETE) are signed without one, as SigV4 does not require it.
-
authorizeWithApiKey
final static HttpRequest authorizeWithApiKey(HttpRequest request, String apiKey)
Authorizes an HTTP request using an API key sent as a Bearer token.
-
-
-
-