docs(integrations): allow a restricted key for the stripe app exchange
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- backend, documentation
Hướng nghiên cứu
Đọc docs/providers/stripe.md và đối chiếu chi tiết quyền của khóa bị giới hạn với các trang OAuth và khóa bị giới hạn của Stripe. Cập nhật hướng dẫn thiết lập Stripe và mô tả biến trong docs/operations/oauth-apps.md, docs/operations/deploy.md và .env.example; chỉ kiểm tra adapter và mã che dữ liệu nếu cần xác minh giả định về tiền tố. Hoàn tất khi tất cả tài liệu được liệt kê mô tả chính xác cả hai dạng khóa và phương thức dùng khóa bị giới hạn được đánh dấu là chưa xác minh cho đến khi thử nghiệm thực tế với Stripe App.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Context
StackDash's Stripe docs tell every instance to use a full secret key for the Stripe App's code exchange and refreshes, and say a restricted key does not work. Stripe's own page now says the opposite, so every self-hosted instance is steered to hold a live secret key with every permission, where Stripe recommends one limited to Connect OAuth.
Stripe, OAuth 2.0, "Exchange the authorization code for an access token" (read 2026-12-02):
Use your secret API key or a restricted API key. Stripe recommends using a restricted API key to limit permissions. If you use a restricted API key, grant it Write permission for the Connect OAuth resource. Without that permission, the request fails with an
invalid_clienterror.
and, under "Refresh your access token":
If you receive a permissions error when refreshing an access token, check that you're authenticating the request with your secret API key or a restricted API key with Write permission for the Connect OAuth resource.
Where StackDash says otherwise (on main and on the branch of #779):
docs/providers/stripe.md, "Code exchange": "Stripe warns that a restricted key, an access token, or a refresh token in place of the secret key fails with a permissions error. So the exchange needs a full secret key, not a restricted key."docs/providers/stripe.md, "Self-hosted setup", after the variables table: "Do not use a restricted key: Stripe documents that the exchange fails with one."docs/providers/stripe.md, "Permission risks": "The code exchange and every refresh use the app developer account's full secret key."docs/operations/oauth-apps.md, "Stripe App", Variables: "STRIPE_APP_SECRET_KEY(live secret keysk_live_...of the owner account; Stripe Apps have no client secret, and a restricted key does not work)".docs/operations/deploy.mdvariable table and.env.examplenamesk_live_.../sk_test_...only.
Found by the Fable review of #779 (review comment on docs/operations/oauth-apps.md:96, https://github.com/eddiejaoude/StackDash/pull/779#discussion_r4769485581). Not caused by that pull request, which is about the external test link (#754), so it is filed separately.
Plan
- Re-read the two Stripe pages above and Restricted API keys for the permission's exact name in the Dashboard and the key prefix (
rk_live_...,rk_test_...). - Check the adapter accepts a restricted key unchanged:
src/lib/adapters/stripe/index.tssends the key as the Basic auth username (requestToken) and never inspects its prefix; confirm no other code (configuration checks,src/lib/log/redact.ts) assumessk_.redact.tsalready covers Stripe restricted keys. - Rewrite the docs to recommend a restricted key with Connect OAuth: Write (and nothing else) for
STRIPE_APP_SECRET_KEYandSTRIPE_APP_TEST_SECRET_KEY, keep a full secret key as the accepted alternative, and update "Permission risks" to say what a key limited to Connect OAuth can and cannot do. - Update the variable descriptions in
docs/operations/oauth-apps.md,docs/operations/deploy.md, and.env.example. - Add the restricted key route to the Stripe doc's Unverified list until it has been tried with a real Stripe App (whether Connect OAuth Write alone is enough for both exchange and refresh of a Stripe Apps install).
Acceptance criteria
- No StackDash doc says a restricted key does not work for the Stripe App exchange or refresh.
- The Stripe setup steps recommend a restricted key with Connect OAuth Write, citing Stripe's page, with a full secret key as the alternative.
- Variable descriptions (
oauth-apps.md,deploy.md,.env.example) name both key forms. - If any code assumes an
sk_prefix, it acceptsrk_too, with a unit test. - Playwright e2e: none needed, documentation and a server-side credential only.
Files and areas
docs/providers/stripe.md,docs/operations/oauth-apps.md,docs/operations/deploy.md,.env.example- Read only unless a prefix check turns up:
src/lib/adapters/stripe/index.ts,src/lib/log/redact.ts
Non-goals: any change to the token exchange flow, the external test link (#754), or live Stripe testing.
Verification
npx vitest run src/lib/docs.test.ts src/lib/adapters/stripepasses.grep -rn "restricted key" docs .env.exampleshows only the new recommendation.
Branch: <issue-number>-stripe-restricted-key-docs
Closes with a Closes #<issue-number> footer on the commit or pull request.
Model: anthropic/claude-opus-5-5 | Reasoning effort: low
- Ngôn ngữ chính
- TypeScript
- Star
- 13
- Fork
- 2
- Merge trung bình
- 5 giờ 20 phút
- Pull request đã merge (30 ngày)
- 287
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của eddiejaoude/StackDash
-
area: ops documentation priority: P3 size: XS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
eddiejaoude/StackDash#796 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: docs documentation impact: low priority: P3 size: XS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
eddiejaoude/StackDash#790 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: ops bug impact: low priority: P3 size: XS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
eddiejaoude/StackDash#785 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: connections enhancement impact: low priority: P3 size: XS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
eddiejaoude/StackDash#768 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: ci area: database enhancement priority: P3 size: XS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
eddiejaoude/StackDash#747 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của eddiejaoude/StackDash
Issue tương tự
-
bot:ai-assisted component:midnight-js status:untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
midnightntwrk/midnight-js#1790 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:vscode bug has repro platform:macos platform:vscode regression
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
anthropics/claude-code#113502 ·
-
Add: Rajdhani TV HDĐang mởcheck:passed streams:add
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
effort/l priority/p1 risk/high triage/core
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
iflytek/skillhub#1188 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày