Skip to content

feat: support a custom STS endpoint for AWS-API-compatible services - #90

Open
karcaw wants to merge 1 commit into
stensonb:mainfrom
EMSL-MSC:feature/sts-endpoint-support
Open

feat: support a custom STS endpoint for AWS-API-compatible services#90
karcaw wants to merge 1 commit into
stensonb:mainfrom
EMSL-MSC:feature/sts-endpoint-support

Conversation

@karcaw

@karcaw karcaw commented Sep 3, 2026

Copy link
Copy Markdown

Adds sts_endpoint and aws_region config keys. When sts_endpoint is set, both the OIDC (AssumeRoleWithWebIdentity) and SAML (AssumeRoleWithSAML) code paths target that URL via a new shared newSTSConfig() helper, instead of always hitting sts.amazonaws.com. If aws_region is left blank but an endpoint is set, region defaults to us-east-1, since the SDK still needs some region string to sign requests even for services with no real AWS regions. Needed to get credentials from non-AWS STS-compatible services (e.g. VAST Data's S3 federation).

Also bundles the pieces that only make sense once a custom endpoint exists:

  • insecure_skip_verify (already used for the OIDC provider's HTTP client) is now honored for the STS client's transport too, but only when sts_endpoint is set - real AWS STS is never affected. Needed for internal/self-signed AWS-API-compatible endpoints where the certificate doesn't validate cleanly.

  • A new -v/--debug flag wires the existing (previously hardcoded-off) log.IsTraceEnabled switch, turning on the AWS SDK's own request/response body logging for STS calls (routed through the same trace logger) plus a new traceSTSError() helper that unwraps a failed call's smithy.APIError (code/message/fault) and HTTP status - detail the default error string can otherwise collapse into one line. Useful for debugging exactly the kind of endpoint/TLS/role issues a custom STS target introduces.

  • Setup wizard prompts for sts_endpoint and aws_region, so they can be configured through aws-cli-oidc setup instead of only by hand-editing config.yaml.

Adds sts_endpoint and aws_region config keys. When sts_endpoint is set, both
the OIDC (AssumeRoleWithWebIdentity) and SAML (AssumeRoleWithSAML) code paths
target that URL via a new shared newSTSConfig() helper, instead of always
hitting sts.amazonaws.com. If aws_region is left blank but an endpoint is
set, region defaults to us-east-1, since the SDK still needs some region
string to sign requests even for services with no real AWS regions. Needed
to get credentials from non-AWS STS-compatible services (e.g. VAST Data's S3
federation).

Also bundles the pieces that only make sense once a custom endpoint exists:

- insecure_skip_verify (already used for the OIDC provider's HTTP client) is
  now honored for the STS client's transport too, but only when
  sts_endpoint is set - real AWS STS is never affected. Needed for
  internal/self-signed AWS-API-compatible endpoints where the certificate
  doesn't validate cleanly.

- A new -v/--debug flag wires the existing (previously hardcoded-off)
  log.IsTraceEnabled switch, turning on the AWS SDK's own request/response
  body logging for STS calls (routed through the same trace logger) plus a
  new traceSTSError() helper that unwraps a failed call's smithy.APIError
  (code/message/fault) and HTTP status - detail the default error string
  can otherwise collapse into one line. Useful for debugging exactly the
  kind of endpoint/TLS/role issues a custom STS target introduces.

- Setup wizard prompts for sts_endpoint and aws_region, so they can be
  configured through `aws-cli-oidc setup` instead of only by hand-editing
  config.yaml.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant