Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Operator limits: hand a workspace owner over to an operator-configured page

Aperta
#284 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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

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

area: app type: feature

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 (an https: 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 to plan_management_url with 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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ExpidetGames/code-reviewer

Tutte le issue di ExpidetGames/code-reviewer

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.