posit-dev / posit-dev/rsconnect-python

Make system keyring discoverable (or default) for rsconnect login

Offen
#791 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Python
Sterne
37
Forks
28
Ø Merge
1 T. 3 Std.
Gemergte PRs (30 T.)
7

Beschreibung

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).

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit dem keyring-Extra in pyproject.toml und suche dann die im Issue erwähnte Login-Fallback-Meldung, den Login/Logout-Hilfetext und die Deploying/Auth-Dokumentation. Erledigt ist die Aufgabe, wenn ein Workstation-Benutzer das Extra finden und die Speicherung im System-Schlüsselbund aktivieren kann und die umsetzbare Meldung sowie die Dokumentation den unterstützten Pfad abdecken.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
cli, documentation
Issue-Typ
Dokumentation
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
68/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.