Re-creating a resource by name changes its owner and drops the roles granted on it
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 42/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- go, postgresql
- 領域
- authorization, backend
調査の方向性
Start with the conflict update in ResourceRepository.Create in internal/store/postgres/resource_repository.go, which overwrites principal_id and principal_type, then with Create in core/resource/service.go, which deletes all SpiceDB relations before re-adding the parent and owner. Reproduce the steps with CreateProjectResource, CreatePolicy and GetPolicy to confirm the owner and grants are lost. Done means re-creating an existing name keeps the original owner and its granted roles, and the relevant tests pass.
索引モデルが issue の本文から書いたものです。
説明
Creating a resource with the name of a live resource in the same project returns the existing row. The URN upsert overwrites principal_id and principal_type, and resource.Service.Create then deletes every SpiceDB relation on the resource before it adds the parent and the new owner.
So the caller becomes the owner, the first owner loses access, and every role granted on the resource stops working, while the policy rows stay. A service that re-creates a resource it already has, on a retry or a re-sync, changes the owner and drops the grants without noticing.
The principal has been overwritten since #261 and the relations deleted since #243. Organization resources (#1987) behave the same way.
Steps
- Member X, who can only view the project, creates resource R with
CreateProjectResource. - Grant member C a role on R with
CreatePolicy. - Member Y creates a resource with the same name and namespace in the same project.
- The same id comes back with Y as the principal. X can no longer update R, C's role no longer works, and
GetPolicystill returns C's policy.
Code
The conflict update in ResourceRepository.Create (internal/store/postgres/resource_repository.go) writes the principal, and Create in core/resource/service.go deletes all relations on the resource.
Expected
Re-creating a resource keeps its owner and the roles granted on it.
- 主要言語
- 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日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
raystack/frontier の issue をすべて見る
似ている issue
-
documentation hacktoberfest priority: low skill: good first issue status: ready for dev
難易度 2/5 半日 初心者へのやさしさ 85/100
hyperledger-labs/fabric-smart-client#2142 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
numberly/vault-db-injector#107 ·
メンテナーはふだん 1 日以内に返信
-
area/import kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
[DOC] Wrong sg_egress_ports range in the Terraform Databricks Guide for AWS Hub & Spoke with Network Firewall対応中かも @akhil9tiet が今日担当しました。 オープンdocs
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
databricks/terraform-provider-databricks#6080 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
spqr-coordinator usage shows 'run --config', but 'run' is not a subcommand (unknown command "run")オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
pg-sharding/spqr#3092 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信