Skip to content

api/profiles: Give a profile the secure boot and the SSH keys of an instance - #132

Merged
l-nmch merged 1 commit into
mainfrom
feat/profile-settings
Nov 11, 2026
Merged

l-nmch merged 1 commit into
mainfrom
feat/profile-settings

Conversation

@l-nmch

@l-nmch l-nmch commented Nov 11, 2026

Copy link
Copy Markdown
Member

What

A profile the user makes can say two settings of an instance beside its size: secureBoot and sshPublicKeys. The Hangar side is merged (phorge-fr/Hangar#454): the Profile kind carries them, and an Instance takes them from its profile unless it says its own.

  • POST /v1/tenants/{t}/profiles takes secureBoot (boolean, no default) and sshPublicKeys (up to 20).
  • The keys are checked by the same function as the keys of an instance (checkKeys), not a copy.
  • The kube store writes a setting on the Profile spec only when the request gives it: an absent secureBoot stays absent and is never false; an empty list of keys is the same as none and is not written.
  • The body of a profile (create, get, list) carries what the profile says, and nothing for what it does not say. The three built-in profiles say none.
  • A profile has no nesting and no network. Incus refuses nesting on a profile of a tenant project (measured, see Hangar#434), so the API does not offer it: the strict decoding answers 400 for nesting or networks, as for any unknown field.
  • OpenAPI: the two fields on ProfileCreate and Profile. The default: true of the instance's secureBoot is removed from the spec, because the API sends nothing when the request leaves it out and the instance then takes its profile's value (the description says so, as for the keys).
  • Documentation: the profiles item of docs/reference/images-and-instances.md.

Not in this change

  • No PATCH of a profile: there is none today (a profile is replaced by making another one), so there is nothing to keep consistent. The Hangar kind can be changed in place; the API does not offer it yet.
  • No limit on the number of profiles beyond the existing MAX_PROFILES_PER_TENANT, which counts the profiles a tenant made as before. The per-plan limit of profiles is One plan for every tenant in the API: the limits, 2 networks, 2 profiles #131.

Checked

go vet ./..., gofmt -l, go test -race ./... and yamllint --strict . pass, and so does the docs layout check. New tests: validation of the keys of a profile (same cases as the instance), the routes (both fields, one of them, neither, refusal of nesting, a network and bad keys, absent fields in the answers), and the kube store (written only when given, false written, read back by the found flag). Nothing was run against a cluster.

Closes #116

POST /v1/tenants/{t}/profiles takes secureBoot and sshPublicKeys, which an
instance takes from its profile unless it says its own. The keys are checked by
the function of the instance. A setting the request does not give is not written
on the Profile, so an absent secureBoot is never false, and the body of a profile
shows only what it says. A profile has no nesting and no network: the strict
decoding refuses them.
@l-nmch l-nmch added this to the 2027-Q1 milestone Nov 11, 2026
@l-nmch l-nmch added the area/api Phorge API and console label Nov 11, 2026
@l-nmch l-nmch self-assigned this Nov 11, 2026
@l-nmch
l-nmch merged commit e852034 into main Nov 11, 2026
14 checks passed
@l-nmch
l-nmch deleted the feat/profile-settings branch November 11, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api Phorge API and console

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Profile settings in the API

1 participant