Expand description
Profile validation — sts:GetCallerIdentity for AWS, list_buckets probe
for compat providers.
§Design
- AWS profiles (no
endpoint_url): callsts:GetCallerIdentityviaaws-sdk-sts. This surfaces theaccountandarnof the caller. - Compat providers (has
endpoint_url): calls3:ListBucketsas the probe because STS may not be supported at those endpoints.
§Error mapping
SDK errors are centralized in map_sts_error / map_s3_list_error.
Adding a new SDK error code means adding one arm to those functions — no
other code changes.
§OCP
ProviderKindenum is open for new variants (Sso,FederatedEnterprise).validate_profileaccepts an injected&ClientPool— testable with real LocalStack or a mock.- The
validate_with_caller<F>helper exposes pure error-mapping logic to unit tests without making any AWS SDK call.
Structs§
- Caller
Identity - Result type for the STS caller identity response.
- Validation
Report - Result of a
profile_validatecall.
Enums§
- Provider
Kind - The category of S3 provider a profile targets.
Functions§
- build_
s3_ 🔒client_ for_ compat - Build an
aws_sdk_s3::Clientfor a compat provider validation probe. - build_
sts_ 🔒client - Build an
aws_sdk_sts::Clientfor the given profile. - extract_
s3_ 🔒error_ parts - extract_
sts_ 🔒error_ parts - map_
s3_ 🔒list_ error - Categorize a raw S3 ListBuckets SDK error into the canonical
AppError. - map_
sts_ 🔒error - Categorize a raw STS SDK error string into the canonical
AppError. - now_
unix_ 🔒ms - validate_
aws 🔒 - Inner: AWS path using
sts:GetCallerIdentity. - validate_
compat 🔒 - Inner: compat provider path using
s3:ListBuckets. - validate_
profile - Validate a profile by running the appropriate probe.
- validate_
with_ caller - Pure validation logic for AWS profiles.