Repository navigation
✨ hub: v1 registration resources, per-repo proofs and revision (2/3) - #18896
Merged
Merged
Conversation
Rollout step 1, part B of the hub registration protocol (#18642), ported from the tuna-os#189 prototype: - Per-repo proof times (SelfServiceHive.RepoProofs) and a Revision counter. Both are additive JSON fields, so older binaries ignore them; a record without a revision loads as 0. Heartbeats do not bump the revision, so a live spoke never invalidates an operator's ETag. - Store update() that restores the key hashes, owner, ID, CreatedAt and the heartbeat stamp after any mutation, plus rotate and revoke guarded by an ETag precondition. - selfServiceRegisterCore and selfServiceProveOwnership split out of the legacy register handler. Tests pin the legacy /api/hub/selfservice/* responses byte for byte. - v1 POST/GET/list/DELETE and POST .../keys: an ETag on every record, optional If-Match on delete and rotate, 413 with limit: max_repos over the repo cap, 201 on rotate, and a 400 for a caller-chosen grace window. Behind HIVE_HUB_SELFSERVICE_REGISTRATION. No GitHub writes; heartbeat_signing.go and the credential fence are untouched. Co-authored-by: James Reilly <5840441+hanthor@users.noreply.github.com> Signed-off-by: James Reilly <jreilly1821@gmail.com> Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Co-authored-by: James Reilly <5840441+hanthor@users.noreply.github.com> Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Contributor
|
New changes are detected. LGTM label has been removed. |
Contributor
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
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 #18642
Rollout step 1, PR B of 3 (A #18892 merged; C is PATCH). Ported from hanthor's prototype (tuna-os#189); his authorship is kept via a Co-authored-by trailer and his Signed-off-by. All behind
HIVE_HUB_SELFSERVICE_REGISTRATION.SelfServiceHive.RepoProofs(per-repo proof time) andRevision: additive JSON fields, old binaries ignore them, a record without a revision loads as 0. Heartbeats do not bump the revision (tested).update()restoring key hashes, owner, ID, CreatedAt and the heartbeat stamp; rotate and revoke guarded by an ETag precondition.OwnershipCheckedAtis kept as is.selfServiceRegisterCore/selfServiceProveOwnershipsplit out of the legacy handler; tests pin the legacy/api/hub/selfservice/*responses byte for byte.POST/GET /registrations,GET/DELETE /registrations/{id},POST .../keys: strong ETag on records, optionalIf-Matchon delete and rotate, 413 withlimit: max_reposon over-cap create, 201 on rotate, 400 on a grace window.Note: "org is not editable" is a PATCH refusal, so it ships with PATCH in PR C (no PATCH route exists in this PR).
Not touched:
heartbeat_signing.go, the credential fence, any GitHub write.🤖 Generated with Claude Code