Skip to content

fix(athena): support WIF/IRSA auth by making static credentials optional#2735

Open
nielsn wants to merge 1 commit into
mainfrom
PLATL-566/athena-wif-support
Open

fix(athena): support WIF/IRSA auth by making static credentials optional#2735
nielsn wants to merge 1 commit into
mainfrom
PLATL-566/athena-wif-support

Conversation

@nielsn
Copy link
Copy Markdown
Contributor

@nielsn nielsn commented Jun 3, 2026

Why

Customers (Alpiq, FirstStudent, Fitch) need WIF / IRSA auth for Athena — AWS issues short-lived tokens automatically, so no static access keys should be passed. V3 supported this implicitly (untyped config → None flows into pyathena.connect()). V4's pydantic model marked access_key_id/secret_access_key as required, so omitting them raises a ValidationError before any connection attempt, blocking onboarding.

What

  • access_key_id / secret_access_keyOptional (default None). region_name and staging_dir stay required.
  • When omitted, the AWS SDK falls back to its default credential provider chain (IRSA / web identity federation / instance profile).
  • Guard secret_access_key.get_secret_value() against None.
  • Added a both-or-neither validator: supplying only one key now gives a clear error.

Tests

  • partial_credentials: asserts the both-or-neither error.
  • test_athena_connection_without_static_credentials_parses: parse-only regression test proving creds can be omitted (no live AWS needed).

Scope

Connector side only. The webapp/onboarding UI has its own PR: https://github.com/sodadata/soda/pull/12348

V4's pydantic model marked access_key_id/secret_access_key as required,
breaking the V3 behavior where omitting them lets the AWS SDK use its
default credential provider chain (IAM Roles for Service Accounts / web
identity federation). Make both optional, guard secret unwrapping, and
require them both-or-neither.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 3, 2026

@nielsn nielsn marked this pull request as ready for review June 5, 2026 11:15
@nielsn nielsn requested review from a team, Niels-b and m1n0 June 5, 2026 11:24
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.

2 participants