Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Removing an organization member leaves the member's PATs and their policies behind

Abierto
#1,970 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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

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.CheckAuthz checks 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

  1. A member creates a PAT scoped to the organization with the viewer role. The PAT passes CheckResourcePermission.
  2. An owner removes the member with RemoveOrganizationMember. The PAT now fails the check and GetOrganization returns permission denied, but its policy row is still live and the token list still shows the PAT with the viewer role.
  3. 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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de raystack/frontier

Todos los issues de raystack/frontier

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.