docs(integrations): allow a restricted key for the stripe app exchange

オープン 初心者向け
#798 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
ドキュメント
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript

調査の方向性

docs/providers/stripe.mdを読み、制限付きキーの権限の詳細をStripeのOAuthページおよび制限付きキーページと照合してください。docs/operations/oauth-apps.md、docs/operations/deploy.md、.env.exampleにあるStripeの設定手順と変数の説明を更新してください。プレフィックスに関する想定の確認が必要な場合に限り、アダプターと秘匿化コードを調べてください。挙げられたすべてのドキュメントで両方のキー形式が正確に説明され、制限付きキーを使う手順が実際のStripe Appでテストされるまで未検証と示されていれば完了です。

索引モデルが issue の本文から書いたものです。

説明

area: integrations documentation priority: P2 size: XS

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_client error.

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 key sk_live_... of the owner account; Stripe Apps have no client secret, and a restricted key does not work)".
  • docs/operations/deploy.md variable table and .env.example name sk_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

  1. 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_...).
  2. Check the adapter accepts a restricted key unchanged: src/lib/adapters/stripe/index.ts sends the key as the Basic auth username (requestToken) and never inspects its prefix; confirm no other code (configuration checks, src/lib/log/redact.ts) assumes sk_. redact.ts already covers Stripe restricted keys.
  3. Rewrite the docs to recommend a restricted key with Connect OAuth: Write (and nothing else) for STRIPE_APP_SECRET_KEY and STRIPE_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.
  4. Update the variable descriptions in docs/operations/oauth-apps.md, docs/operations/deploy.md, and .env.example.
  5. 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 accepts rk_ 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/stripe passes.
  • grep -rn "restricted key" docs .env.example shows 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

主要言語
TypeScript
スター
13
フォーク
2
平均マージ
5時間 20分
マージ済み PR(30日)
287

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

eddiejaoude/StackDash のほかの issue

eddiejaoude/StackDash の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。