posit-dev / posit-dev/rsconnect-python
Make system keyring discoverable (or default) for rsconnect login
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 37
- Forks
- 28
- Merge medio
- 1 d 3 h
- PR fusionados (30 d)
- 7
Descripción
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:
-
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?"
-
Document it in the
login/logouthelp text and the deploying/auth docs (the--helpforloginmentions the keyring but not the extra needed to enable it). -
Consider making
keyringa default dependency. Modernkeyringinstalls 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_tokenreturnsFalseon 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).
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con el extra de keyring en pyproject.toml y, después, localiza el mensaje de fallback de login, el texto de ayuda de login/logout y la documentación de deploying/auth mencionados en el issue. Se considera terminado cuando un usuario de una workstation puede descubrir el extra y habilitar el almacenamiento en el llavero del sistema, y el mensaje accionable y la documentación cubren la ruta compatible.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- cli, documentation
- Tipo de issue
- Documentación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Tranquilo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 68/100