Repository navigation
✨ hub: edit a v1 registration in place with PATCH, key kept - #19097
Merged
Merged
Conversation
PATCH /api/hub/v1/registrations/{id} changes repos (full list or add and
remove) and dashboard_url with the heartbeat key untouched. If-Match is
required (428 missing, 412 stale). Only added repos are proven, read only,
with the owner's stored token. org, owner and keys are not editable. Owner
session only, gated by HIVE_HUB_SELFSERVICE_REGISTRATION, listed in v1
discovery. Nothing writes to GitHub.
Refs #19056
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
kubestellar-prow
Bot
deleted the
feat/19056-hub-v1-patch-registration
branch
November 18, 2026 19:38
Contributor
This was referenced Nov 19, 2026
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.
Refs #19056
Rollout step 1 of the hub registration protocol (RFC #18642) shipped discovery and the resources (#18892, #18896) but not the third slice the RFC's port plan named: PATCH. Without it, adding a repo still meant deleting a registration (revoking its key) and registering again. This PR adds it. The store side (
update()that restores the key hashes, owner, ID and timestamps; the revision and ETag) already landed in #18896.PATCH /api/hub/v1/registrations/{id}repos(a full list, or{add, remove}) and/ordashboard_url(httpsURL, or""to clear). The heartbeat key is never touched.If-Matchis required:428when absent,412with the currentETagwhen stale. Checked before any GitHub call and again under the store lock. If-Match*also re-checks that the stored repos are the ones the edit was planned from.permissions.admincheck as create, with the owner's own stored token); one failing repo refuses the whole edit and nothing is applied. Kept repos keep their proof time, removed repos lose theirs.org, the owner, the ID and the keys are not editable: any other field is400(orgwith its own message, per the owner's decision that org changes mean delete and re-register). A list that would leave no repo is400; overHIVE_HUB_SELFSERVICE_MAX_REPOSis413withlimit: max_repos.sync-reposstep); a hub admin who does not own the hive gets404.200with the currentETagand does not bump the revision.HIVE_HUB_SELFSERVICE_REGISTRATIONswitch as the rest of v1. Discovery now listsupdate(if_match: required) andpatch_fields: [repos, dashboard_url].selfservice_hive_updatedwith counts, no key and no hash; refused bodies areselfservice_hive_refusedwith reasoninvalid_update.Not touched: the v6
/api/hub/selfservice/*routes and their bodies,heartbeat_signing.go, the credential fence, existing records (no data change). Nothing here writes to GitHub.Tests cover add proving only the added repo and keeping the key authenticating, replace and remove with no GitHub call, dashboard set and clear and its refusals, 428 and 412 including weak tags, two editors with one winning, the wildcard re-check, no-op edits, every refusal, proof failure applying nothing, the repo cap, owner-session-only access, key and hash absent from responses and logs, and the legacy list view staying shape-stable. All credentials in tests are synthetic.
Docs: api-reference row, hub-deployment "Editing a registration", audit-log, changelog fragment.