Operator limits: hand a workspace owner over to an operator-configured page
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 12/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- api, authentication, backend
Direzione di ricerca
Start with the blocking dependencies #268 and #275, since the operator token and the /api/operator/v1 contract come from #275. Then look at src/signed-state to judge whether it fits single-use tokens, and at the existing rate_limits storage. Done means the setting, the Manage plan route, the scoped token table, the redeem endpoint and the T01 to T12 tests all pass, with no token value ever logged.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Part of #268. Depends on #275.
Problem
An operator who manages plans in an external service needs the person who clicks "manage plan" in a workspace to arrive there as an identified Owner or Admin of that workspace, without a second account and without the app sharing a signing secret or personal data with the service.
Behavior
- New instance setting
plan_management_url(anhttps:URL, validated, editable by the instance admin in the portal and through the operator API). Unset: nothing below appears. - In the workspace settings (and on the plan page of #282 when it exists), an Owner or Admin sees Manage plan. It posts to
POST /api/w/<slug>/plan-handoff, which creates a handoff token: 256 bits of randomness, stored only as a SHA-256 hash, valid 5 minutes, single use, bound to the workspace, the acting user and the user's role at that moment. The app redirects the browser toplan_management_urlwith the token in the query (?handoff=<token>). A Member does not see the button, and the route refuses with the role error. - The external service redeems it with
POST /api/operator/v1/handoff/redeem{ "token": "…" }using its operator token. A valid token answers{ workspaceId, workspaceSlug, userId (opaque), role }and is used up in the same statement; an unknown, used, expired or revoked token gets one answer,invalid_token. The answer holds no email, name or repository. - The role is checked again at redemption (an Owner demoted within the 5 minutes gets
invalid_token). A new token for the same user and workspace invalidates the unused ones. - The route is rate limited per user and workspace (existing
rate_limits), same-site only, and logs the workspace id and result code, never a token. - The external service returns people to
/w/<slug>/settings/plan; no open redirect exists on the app side (the return target is fixed).
Scope
Setting, route, token table (scoped), redeem endpoint and contract entry, button and copy, docs, tests. Reuse src/signed-state if it fits the single-use semantics; otherwise a small dedicated table.
Out of scope
Anything the external service does with the identity, and sessions on its side.
Test cases
| ID | kind | level | case | expected |
|---|---|---|---|---|
| T01 | regression | integration | plan_management_url unset |
no button, the route is a missing path |
| T02 | behavior | integration | Owner clicks Manage plan | redirect to the configured URL with a token; hash stored, not the token |
| T03 | behavior | integration | redeem a fresh token | workspace, role, opaque user id returned; token used up |
| T04 | security | integration | redeem twice, after 5 minutes, unknown | invalid_token, one answer for all |
| T05 | security | integration | role removed before redeem | invalid_token |
| T06 | security | integration | a Member opens the route | refused like any other role-restricted route; no token created |
| T07 | security | integration | cross-site POST | refused |
| T08 | security | integration | rate limit exceeded | refused with Retry-After |
| T09 | security | integration | redeem without the operator token | 404/401 as #275 |
| T10 | security | integration | answers and logs | no token value, no email |
| T11 | negative | unit | URL that is http:, has credentials or a fragment |
refused on save |
| T12 | behavior | integration | a newer token for the same user and workspace | the older unused one is invalid |
- Lingua principale
- TypeScript
- Stelle
- 0
- Fork
- 1
- Merge medio
- 1h 18m
- PR unite (30g)
- 186
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ExpidetGames/code-reviewer
-
area: app type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
ExpidetGames/code-reviewer#308 ·
I maintainer di solito rispondono entro 1 giorno
-
type: docs
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ExpidetGames/code-reviewer#94 ·
I maintainer di solito rispondono entro 1 giorno
-
area: app post-mvp type: feature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
ExpidetGames/code-reviewer#339 ·
I maintainer di solito rispondono entro 1 giorno
-
area: runner post-mvp type: feature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 18/100
ExpidetGames/code-reviewer#338 ·
I maintainer di solito rispondono entro 1 giorno
-
area: runner post-mvp type: feature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
ExpidetGames/code-reviewer#337 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di ExpidetGames/code-reviewer
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
QuantumNous/new-api#7839 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
bug p2 triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
getpaseo/paseo#7071 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
test: make the #3408 Claude OAuth token fixture obviously fake so secret scanners stop flagging itAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
code-yeongyu/senpi#3436 ·
I maintainer di solito rispondono entro 1 giorno
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
lingdojo/kana-dojo#32505 · 1 commento · 5 reazioni ·
I maintainer di solito rispondono entro 1 giorno