Object AwsAuthUtil

  • All Implemented Interfaces:

    
    public class AwsAuthUtil
    
                        

    Shared 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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static AwsAuthUtil INSTANCE
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      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.
      final static HttpRequest authorizeWithApiKey(HttpRequest request, String apiKey) Authorizes an HTTP request using an API key sent as a Bearer token.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • 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 connection header is excluded from signing because it may be stripped by proxies and must not be part of the SigV4 signature.

        A content-type header 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.