Resource update: reconcile SpiceDB #project/#owner, but first decide project-move + AuthZ + billing behaviour
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
Direzione di ricerca
Inizia dall'entry UpdateProjectResource in pkg/server/connect_interceptors/authorization.go e dal percorso Update di core/resource; poi esamina la PR chiusa #1686 e il relativo test di spostamento end-to-end. Metti in relazione il comportamento esistente di resource, project, owner, authorization ed entitlement con le questioni aperte. Il lavoro è completato quando le regole di move, owner, URN, AuthZ e billing sono decise con sufficiente chiarezza da poter reinserire la riconciliazione di SpiceDB.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Background
The UpdateProjectResource RPC updates a resource. Today core/resource Update only writes title/metadata to Postgres. It does not touch SpiceDB. So if a resource's project (#project) or owner (#owner) changes, the SpiceDB relations drift away from Postgres. This is gap (7) of #1661.
What the (now closed) PR did
PR #1686 reworked Update to reconcile those relations:
- load the existing resource first
- resolve a PAT principal to its underlying user
- keep the current owner when the request sends no principal (a title/metadata-only update should not blank the owner)
- rebuild the URN from the target project
- on project change: delete the old
#projecttuple, add the new one - on owner change: delete the old
#ownertuple, add the new one - repository
Updatenow persistsurn/project_id/principal_id/principal_type(and stores NULL, not"", when there is no principal, matchingCreate) - e2e test moves a resource from project A to project B and asserts the
#projectsubject flips to B only
The reconcile logic itself is sound. The deletes are scoped to the one resource's object_id plus the single relation name, so there is no over-delete.
Why we paused it
The update path also runs two checks (in pkg/server/connect_interceptors/authorization.go, the UpdateProjectResource entry) that were never designed for a project move:
-
AuthZ —
IsAuthorized(Object{namespace, resource_id}, update). This only checks theupdatepermission on the resource itself. On a move it does not check any permission on the target project. So a caller who can update a resource could move it into a project (and org) where they have no rights. -
Billing entitlement —
CheckPlanEntitlement(Object{project, request.project_id}). This checks the plan of the project named in the request (the target). For a cross-org move, how usage and entitlements are counted between the source org and the target org is undefined.
Open questions (decide before re-landing the reconcile)
- Should
UpdateProjectResourcebe allowed to change the project at all, or should "move" be a separate, explicit operation? - Same-org move vs different-org move — do we allow both? A different-org move is the bigger one: it changes billing, ownership, and audit ownership.
- AuthZ on a move: which permission(s) should we require on the target project (for example create/update on the destination) on top of
updateon the resource? - Billing on a cross-org move: which org's plan applies, and how is usage/entitlement re-attributed?
- Owner change: when the principal changes, do we need any check on the new owner?
- URN: the URN is built from the project name, so moving projects changes the URN. Confirm downstream consumers handle a URN change.
Scope
This stays part of gap (7) of #1661. The SpiceDB reconcile should land only after the move / AuthZ / billing behaviour above is decided. PR #1686 is closed in favor of this issue; its branch and code can be reused once the behaviour is settled.
- Lingua principale
- Go
- Stelle
- 344
- Fork
- 47
- Merge medio
- 4g 4h
- PR unite (30g)
- 26
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di raystack/frontier
-
enhancement go
Difficoltà 4/5 3-5 giorni Idoneità per principianti 62/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 58/100
-
authz bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 70/100
-
Add OpenTelemetry tracing Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 45/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
Tutte le issue di raystack/frontier
Issue simili
-
agentic-workflows
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
agentic-workflows
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
microsoft/agent-framework-go#1179 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
[Bug]: OLLAMA_KEEP_ALIVE="5m" / "24h" crashes Ollama embedding and vision models with ValueError Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
infiniflow/ragflow#20223 · 1 reazione ·
-
bug needs triage pkg/translator/faro
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
open-telemetry/opentelemetry-collector-contrib#51484 · 1 commento ·