Removing an organization member leaves the member's PATs and their policies behind
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 52/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- go
- Área
- authentication, authorization
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Go
- Estrellas
- 343
- Forks
- 48
- Merge medio
- 2 d 9 h
- PR fusionados (30 d)
- 48
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de raystack/frontier
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
Los mantenedores suelen responder en 1 día
Todos los issues de raystack/frontier
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
oasdiff/oasdiff#1337 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
dataiku/kiji-proxy#635 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
hyperledger-firefly/signer#126 ·
-
agent-review-finding chore
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
jordansmall/spindrift#5748 ·
Los mantenedores suelen responder en 1 día