Removing an organization member leaves the member's PATs and their policies behind
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- go
- Ambito
- authentication, authorization
Direzione di ricerca
Start in core/membership/org.go at cascadeRemovePrincipal and trace how RemoveOrganizationMember deletes the member’s organization policies. Compare that flow with the existing user-deletion path through userpat.Service.Delete, which marks a PAT deleted and removes its policies. The issue is done when removing a member also deletes that user’s PATs scoped to the organization and their policies, without affecting service users.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happens
RemoveOrganizationMember deletes the member's own policies for the organization, but it does not touch the personal access tokens (PATs) the member created for that organization, nor the policies those PATs hold. PAT policies carry the PAT id as principal, so the principal filter in the removal cascade (core/membership/org.go, cascadeRemovePrincipal) never sees them.
Why it matters
- The PAT grants nothing while the owner is out of the organization.
resource.Service.CheckAuthzchecks the PAT's own scope and then the owner's permission, and both must pass. - The organization's token list (
SearchOrganizationPATs) still shows the PAT with its role, as if it worked. - When the owner is added back, the old PAT works again at once, within whatever the owner's new role allows. Nobody re-issued or re-approved it.
- The PAT row and its policy rows stay behind for a user who is no longer a member.
Verified locally
- A member creates a PAT scoped to the organization with the viewer role. The PAT passes
CheckResourcePermission. - An owner removes the member with
RemoveOrganizationMember. The PAT now fails the check andGetOrganizationreturns permission denied, but its policy row is still live and the token list still shows the PAT with the viewer role. - The member is added back. The PAT passes the check again immediately.
Proposed fix
Run the PAT delete cascade for the member's PATs in that organization as part of the removal: list the user's PATs for the organization and, for each, call the same per-PAT delete that user deletion already uses (userpat.Service.Delete: mark the PAT deleted, then remove its policies). Only user principals are affected, since service users have no PATs.
- Lingua principale
- Go
- Stelle
- 344
- Fork
- 48
- Merge medio
- 1g 22h
- PR unite (30g)
- 38
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Nessuna 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 raystack/frontier
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di raystack/frontier
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
I maintainer di solito rispondono entro 1 giorno
-
product/backlog
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
TencentBlueKing/bk-nodemgr#3645 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
modelcontextprotocol/go-sdk#1387 ·
I maintainer di solito rispondono entro 1 giorno
-
docs(prompt): filer socket fragment hardcodes an issue-intent cap of 8 that Chore runs overrideApertaagent-butler-finding chore
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
jordansmall/spindrift#5128 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
I maintainer di solito rispondono entro 2 giorni