Repository navigation
api/tenants: A tenant has one name - #143
Merged
Merged
Conversation
The display name leaves the body of a tenant and the creation, and with it the only thing a PATCH of a tenant could change: the route is gone (405). The name is a slug, it is the namespace, the Incus project and the key of the rights, and the owner is an OpenFGA tuple; nothing about a tenant changes afterwards. A body that still gives displayName is refused as any field the API does not know (400). The tenants:write scope now only deletes. Closes #118
This was referenced Nov 14, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A tenant has one name.
displayNameleaves the body of a tenant (GET, list,POST) and the creation; a body that gives it is400, like any field the API does not know.With the plan gone (#139, #141) the display name was the only thing
PATCH /v1/tenants/{t}could change, and the owner cannot change either (an OpenFGA tuple), so the route is removed: it answers405. A tenant is renamed by nobody: its name is the namespace, the Incus project and the key of its rights. To hand one over, give the new person theadminrole with a membership, as before.tenants:writenow only deletes (its description says so); an existing key that holds it keeps working.displayNameof the tenant body and of the creation,MaxDisplayName,PatchRequestand its validation, the storePatch, the handler and the route, theupdateTenantoperation andTenantPatchof the OpenAPI.spec.displayNameand no longer reads it. Objects that still carry it are not touched.displayNameof an API key is another thing and stays.docs/reference/tenants.md,endpoints.mdandauthorization.mdsay it, with the rule of the name.Stacked on #141 (the plan), which already removed the
planof the same types: this branch is cut from it, so the base isfix/remove-planand GitHub retargets it tomainwhen #141 is merged.Not in this pull request
The description of the Incus project is still made by the Tenant composition from
spec.displayName, with the name as the fallback: with no display name sent it is the name, which is what is wanted. Stopping the composition from reading the field, and what happens to the objects that carry it, is phorge-fr/Hangar#488. The console side is phorge-fr/phorge-console#59 (it must stop sendingdisplayName, which is now a400, before this is deployed).Tests
internal/tenants,internal/kube,internal/api: the display name and the patch tests are gone; new checks thatPATCHis405for an admin, a viewer, a stranger, a key and nobody, thatdisplayNameon creation is400(given and empty), that the body of a tenant carries none, and that the store writes nospec.displayName.TestOpenAPIMatchesTheRoutesfollows the removed route; the rate-limit tests use another write route.gofmt -l,go vet ./...,go test -race ./...,yamllint --stricton the OpenAPI and the docs check pass locally.golangci-lintis not installed locally, CI runs it. The integration test no longer renames, and expects405for a patch; it is not run here (it needs the cluster).Closes #118