Simplify reading Connect pins as the viewer
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 35/100
Piste de recherche
Start with the visitor example in docs/index.qmd and review the existing Client.with_user_session_token() behavior described in the issue. The work also depends on adding a helper to posit-sdk and deciding whether board_connect() should accept a visitor client or session directly. Done when the helper and example are updated and the API design choice is resolved.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
#362 documents how to read pins as the viewer on Posit Connect with a visitor API key. The example must read the Posit-Connect-User-Session-Token header from the Shiny session and exchange it with posit-sdk:
token = session.http_conn.headers.get("Posit-Connect-User-Session-Token")
client = connect.Client()
credentials = client.oauth.get_credentials(
token,
requested_token_type="urn:posit:connect:api-key",
)
board = board_connect(server_url=..., api_key=credentials["access_token"], cache=None)
Users must know about the header, the token exchange, and the token type, and it is easy to get wrong. Client.with_user_session_token() already does the exchange, but it does not expose the API key that pins needs.
In the review of the matching pins-r docs (rstudio/pins-r#906), a helper was proposed, so that the example does not need to explain the header or the exchange.
Tasks:
- Add a helper to posit-sdk that takes a Shiny session and returns the visitor API key, or a client that exposes it.
- Update the visitor example in
docs/index.qmdto use the helper. - Decide if
board_connect()should accept the visitor client or session directly, so that users do not pass the key and cache by hand.
- Langage dominant
- Python
- Étoiles
- 59
- Forks
- 11
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de rstudio/pins-python
-
.maint
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
rstudio/pins-python#280 ·
-
Test board github with a tokenOuvertetesting
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
rstudio/pins-python#196 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 55/100
rstudio/pins-python#354 ·
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 55/100
rstudio/pins-python#352 ·
-
Pins ecosystem documentationOuverte.documentation
Difficulté 3/5 1-2 jours Accessibilité débutants 45/100
rstudio/pins-python#348 ·
Toutes les issues de rstudio/pins-python
Issues similaires
-
add entry to blockOuverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 65/100
StevenBlack/hosts#3299 ·
-
`garak --report` overwrites the input report when its name has no ".report"Peut-être pris @0z5a l’a pris aujourd’hui. Ouverteneeds-triage
Difficulté 2/5 Une demi-journée Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 2 jours
-
plot_graph crashes when a mesh node has no m2m edgePeut-être pris @tygvi l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
mllam/neural-lam#883 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
future-agi/future-agi#4092 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
transcript analytics: a text whose only protected spans the prose pass redacts is withheld wholeOuverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 82/100
WingedGuardian/GENesis-AGI#4641 ·
Les mainteneurs répondent en général sous 1 jour