Removing an organization member leaves the member's PATs and their policies behind
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 52/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- go
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Go
- スター
- 343
- フォーク
- 48
- 平均マージ
- 2日 9時間
- マージ済み PR(30日)
- 48
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
raystack/frontier のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
raystack/frontier の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
QuantumNous/new-api#7839 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
puppe1990/amarra-cais#355 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Gentleman-Programming/engram#1899 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信