Class DynamicEndpointAuthSchemeFactory

java.lang.Object
software.amazon.awssdk.services.s3.endpoints.authscheme.DynamicEndpointAuthSchemeFactory

@SdkProtectedApi @NotThreadSafe public final class DynamicEndpointAuthSchemeFactory extends Object
Builds an EndpointAuthScheme whose scheme name is only known at runtime.

Endpoint rulesets normally declare the auth scheme name as a string literal, which lets codegen emit a direct call to the matching concrete builder (for example SigV4AuthScheme.builder()). S3 is the one exception: its BDD-based ruleset merges two otherwise identical results whose auth scheme names differ, lifting the difference into a runtime conditional:

_s3e_auth = ite(coalesce(DisableS3ExpressSessionAuth, false), "sigv4", "sigv4-s3express");

The merged result then refers to the name indirectly, so the concrete type cannot be selected at codegen time. This factory collects the auth scheme properties up front and defers the type selection to create(String).

Only sigv4 and sigv4-s3express are supported, since those are the only names the S3 ruleset can produce here. The two schemes share the same property set (signingName, signingRegion, disableDoubleEncoding), so the properties are modelled directly rather than generically. Any other name is a programming error and fails fast.

Instances are mutable and are not safe for concurrent use. Generated endpoint providers create a fresh instance per resolution, so each instance is confined to a single resolution.