Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#1,970 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
52/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Go
Star
343
Fork
48
Merge trung bình
2 ngày 8 giờ
Pull request đã merge (30 ngày)
57

Chuẩn bị môi trường

  • Có Dockerfile hoặc tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của raystack/frontier

Tất cả issue của raystack/frontier

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.