Class ModelBasedAuthSchemeProviderSpec

java.lang.Object
software.amazon.awssdk.codegen.poet.auth.scheme.ModelBasedAuthSchemeProviderSpec
All Implemented Interfaces:
ClassSpec

public class ModelBasedAuthSchemeProviderSpec extends Object implements ClassSpec
Generates an auth scheme provider implementation based on the service model's authentication configuration.

This class creates a provider that resolves authentication schemes for SDK operations. It supports both service-level default auth schemes and per-operation auth scheme overrides. When operations have different auth requirements, it generates a switch statement to return the appropriate schemes based on the operation name.

The generated provider implements the auth scheme provider interface and returns an ordered list of AuthSchemeOption instances that the SDK will attempt in sequence during authentication.

Usage Scenarios:

  • Services without endpoint-based auth: The generated class serves as the default auth scheme provider, directly implementing all auth scheme resolution logic based on the service model.
  • Services with endpoint-based auth(enabled through enableEndpointAuthSchemeParams customization config): The generated class is named with a "Fallback" prefix and works alongside the endpoint-based provider. It acts as a fallback when endpoint rules don't specify auth schemes, which could happen if the endpoint provider is overridden by users. The auth schemes are derived from hardcoded AuthTypeToSigV4Default
  • Constructor Details

    • ModelBasedAuthSchemeProviderSpec

      public ModelBasedAuthSchemeProviderSpec(IntermediateModel intermediateModel)
  • Method Details

    • className

      public com.squareup.javapoet.ClassName className()
      Specified by:
      className in interface ClassSpec
      Returns:
      The Poet representation of the class being generated, this may be used by other classes
    • poetSpec

      public com.squareup.javapoet.TypeSpec poetSpec()
      Specified by:
      poetSpec in interface ClassSpec
      Returns:
      The actual class specification generated from a PoetSpec.builder()... implementation