posit-dev / posit-dev/rsconnect-python

Make system keyring discoverable (or default) for rsconnect login

Aperta
#791 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Python
Stelle
37
Fork
28
Merge medio
1g 3h
PR unite (30g)
7

Descrizione

Problem

rsconnect login stores OAuth tokens in the system keyring only if the optional keyring package is installed, otherwise it falls back to a local chmod-600 file and prints:

Note: keyring not available; credentials stored in local file (chmod 600).

keyring is an optional extra (pyproject.toml: keyring = ["keyring>=23.0.0"]), added alongside the login/logout commands in #773. The reasoning for keeping it optional is sound: rsconnect-python frequently runs in headless/CI/container/server environments where there's no usable secret-service backend (especially on Linux, where keyring needs SecretService/dbus), and the file fallback works fine there.

But there's a discoverability gap: a workstation user who would benefit from the OS keychain has no way to learn that the feature exists or how to turn it on. The fallback message states that keyring is unavailable but not how to enable it. Most users will never find the [keyring] extra.

Proposals

In rough order of preference:

  1. Make the fallback message actionable. Tell the user how to opt in, e.g.:

    Note: keyring not available; credentials stored in local file (chmod 600).
    To store credentials in your system keychain instead, install the keyring extra:
        pip install 'rsconnect-python[keyring]'
    

    This is low-risk and directly answers "how would I know to use it?"

  2. Document it in the login/logout help text and the deploying/auth docs (the --help for login mentions the keyring but not the extra needed to enable it).

  3. Consider making keyring a default dependency. Modern keyring installs cleanly on all platforms without heavy system requirements; on a backend-less Linux host it simply has no usable backend, and the existing code already catches that (keyring_store_token returns False on any exception and falls back to the file). If install footprint is the only concern, the trade-off may now favor including it by default and letting the runtime fallback handle headless environments. Worth at least evaluating.

Acceptance

  • A workstation user can discover and enable system-keychain credential storage without prior knowledge of the [keyring] extra (at minimum via an actionable message and docs).

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con l’extra keyring in pyproject.toml, quindi individua il messaggio di fallback del login, il testo di aiuto per login/logout e la documentazione deploying/auth menzionati nell’issue. Il lavoro è completo quando un utente su una workstation può individuare l’extra e abilitare l’archiviazione nel portachiavi di sistema, e il messaggio operativo e la documentazione coprono il percorso supportato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
cli, documentation
Tipo di issue
Documentazione
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
68/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.