Simplify reading Connect pins as the viewer

Đang mở
#363 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

.enhancement

#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.qmd to 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.
Ngôn ngữ chính
Python
Star
59
Fork
11
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của rstudio/pins-python

Tất cả issue của rstudio/pins-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.