Class ModelAuthSchemeKnowledgeIndex
java.lang.Object
software.amazon.awssdk.codegen.poet.auth.scheme.ModelAuthSchemeKnowledgeIndex
Knowledge index to get access to the configured service auth schemes and operations overrides. This index is optimized for code
generation of switch statements therefore the data is grouped by operations that share the same auth schemes. This index is a
building block for
AuthSchemeCodegenKnowledgeIndex and SigV4AuthSchemeCodegenKnowledgeIndex indexes that have a
friendly interface for the codegen use cases.-
Method Summary
Modifier and TypeMethodDescriptionof(IntermediateModel intermediateModel) Creates a new knowledge index using the given model.Returns a map from a list of operations to the list of auth-types modeled for those operations.
-
Method Details
-
of
Creates a new knowledge index using the given model. -
operationsToMetadata
Returns a map from a list of operations to the list of auth-types modeled for those operations. TheAuthTraitvalues are taken directly from theOperationModel.This method groups operations by their authentication requirements and chunked encoding needs:
- Operations with identical auth traits are grouped together
- Operations requiring chunked encoding (streaming operations with HTTP checksum traits - either requestAlgorithmMember or isRequestChecksumRequired) are separated from regular operations and marked with CHUNK_ENCODING_ENABLED property. This ensures they get distinct auth scheme metadata even if they share the same base auth traits.
- Operations using service defaults are keyed with an empty list
Processing flow:
- Identify all operations requiring chunked encoding
Example: PutObject (streaming + checksum) → chunked encoding needed - Get operations with custom auth traits (validation applied during this step:
WriteGetObjectResponse is filtered out for services with custom auth scheme overrides,
other operations with custom auth in those services throw exception)
Example: Operations with bearer auth → grouped by auth trait - Process each operation group:
- Split into regular and chunked encoding operations
Example: [GetObject, PutObject] with SigV4 → [GetObject] regular, [PutObject] chunked - Add regular operations with their auth metadata
Example: [GetObject] → SigV4 metadata - Add chunked operations with CHUNK_ENCODING_ENABLED property
Example: [PutObject] → SigV4 metadata + CHUNK_ENCODING_ENABLED
- Split into regular and chunked encoding operations
- Process remaining chunked encoding operations that use service defaults
Example: [UploadPart] (chunked, no custom auth) → service defaults + CHUNK_ENCODING_ENABLED - Add service-wide defaults with empty list key
Example: [] → SigV4 metadata (fallback for all other operations)
- Returns:
- Map where keys are lists of operation names and values are their auth scheme metadata. Empty list key represents service-wide defaults.
-