Skip to content

Navigation Menu

Sign in
Sign up

Fix TokenKey host and user argument order in auth cache - #3028

Open
Hashim1999164 wants to merge 1 commit into
snowflakedb:main from
Hashim1999164:fix/tokenkey-host-user-order
Open

Fix TokenKey host and user argument order in auth cache #3028
Hashim1999164 wants to merge 1 commit into
snowflakedb:main from
Hashim1999164:fix/tokenkey-host-user-order

Conversation

@Hashim1999164

@Hashim1999164 Hashim1999164 commented Sep 6, 2026
edited
Loading

Copy link
Copy Markdown

Fixes #2931

TokenKey is declared as (user, host, tokenType), but the temporary credential helpers in auth/_auth.py built it positionally as TokenKey(host, user, cred_type). That swapped the fields, so ID and MFA cache entries used USER:HOST:TOKEN_TYPE while OAuth used the intended HOST:USER:TOKEN_TYPE.

This change builds those keys with keyword arguments and updates matching integ cleanup call sites. A unit test asserts store, retrieve, and delete all use user and host in the declared order.

Note: existing ID/MFA tokens stored under the swapped layout will not be found after upgrade, so users may see one extra authentication prompt while the cache repopulates.

Auth temporary credential helpers built TokenKey positionally as
TokenKey(host, user, type), which swapped the dataclass fields. Use
keyword arguments so keys match the declared (user, host) layout and
OAuth cache entries.
Hashim1999164 requested a review from a team as a code owner September 6, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

SNOW-3791018: TokenKey constructed with swapped host/user positional arguments in auth/_auth.py

1 participant

AltStyle によって変換されたページ (->オリジナル) /