Re-creating a resource by name changes its owner and drops the roles granted on it
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 42/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- go, postgresql
- Domaine
- authorization, backend
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Go
- Étoiles
- 343
- Forks
- 48
- Merge moyen
- 2 j 9 h
- PR mergées (30 j)
- 48
Préparer son environnement
- Fournit un Dockerfile ou un fichier Docker Compose
- Propose un modèle de pull request
- Aucun guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de raystack/frontier
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 3/5 1-2 jours Accessibilité débutants 62/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 3/5 1-2 jours Accessibilité débutants 55/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 3/5 1-2 jours Accessibilité débutants 62/100
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de raystack/frontier
Issues similaires
-
perf(translator): Claude→Responses stream re-validates the whole request body on every SSE chunkOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
router-for-me/CLIProxyAPI#6665 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
superplanehq/superplane#8557 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
copilot-api domain:platform go
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
docs: clarify gh api -f vs -F and @-file expansion in the gh skillPeut-être pris @MatiasOlivera l’a pris aujourd’hui. Ouverteenhancement
Difficulté 2/5 Une demi-journée Accessibilité débutants 62/100
cli/cli#14701 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour