<#1292 fix(auth): store tokens in one keychain ite...
# flyte-github
a
#1292 fix(auth): store tokens in one keychain item to avoid double password prompt Pull request opened by pingsutw Why On macOS, running a workflow prompted for the keychain password twice. macOS prompts once per keychain item accessed, and
KeyringStore
stored
access_token
and
refresh_token
as two separate keychain items — so every credential retrieve triggered two prompts. What changed •
KeyringStore.store()
now writes both tokens as a single JSON blob under one
tokens
key →
retrieve()
does exactly one keychain read, so at most one password prompt (zero after "Always Allow"). •
retrieve()
parses the JSON blob; unparseable/missing data falls back to
None
(same as no cached credentials). •
delete()
removes the new
tokens
key and also cleans up the legacy per-token `access_token`/`refresh_token` items. • Public API unchanged; callers in
_authenticators/base.py
are untouched. Note: previously cached tokens (old two-item format) are intentionally not read back — a legacy fallback would require a second keychain read, which is the exact bug. Users get one fresh browser login after upgrading, then a single prompt thereafter. Tests Updated `tests/flyte/keyring/test_keyring_store.py`: • single
set_password
call with JSON payload on store • exactly one
get_password
call on retrieve • unparseable blob returns
None
• delete removes
tokens
+ legacy keys
uv run pytest tests/flyte/keyring/ -q
→ all passing. Summary by Bito Fixes double macOS keychain password prompts by consolidating access and refresh tokens into a single keychain item, ensuring credential retrieval performs exactly one keychain read. flyteorg/flyte-sdk