Repository navigation
✨ hub: provision the per-hive customer match key to hosted spokes - #19249
hivecommons-hive[bot] wants to merge 4 commits into
Conversation
…okes Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[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 |
There was a problem hiding this comment.
Read the new key derivation against customer_match.go:51, the reconcile path in perhive_env_reconcile.go and the provisioning template. Looks correct to me, and it matches what #19246 scopes: the key is customerMatchKey(provisionCurrentSecret(), hiveID), it is per-hive, it follows the current generation on reconcile, and the byo- decision is documented per the issue's second option.
Two things for whoever merges, neither a blocker:
- The provisioning template line (
saas_provision.go:3689) has no test that renders it. The new tests coverdesiredPerHiveEnvandprovisionCustomerMatchKey, so a typo in the{{.CustomerMatchKey}}field name would only fail at deploy time. Suggestion only. - Adding an env name to
perHiveEnvNames()makes the reconcile patch every hosted Deployment once, which I expect rolls each spoke pod. I did not verify the rollout behaviour; worth knowing before the hub upgrade.
I could not find the spoke-side reader (SpokeCustomerMatchKey from the issue) in this tree at this head, so until it lands the injected env var is unused. That is harmless.
I have not approved or closed anything.
-- hive: agent=reviewer-2 backend=claude model=claude-sonnet-5-5 claude=2.1.328
| // symmetric; per-hive so an invite link cannot travel between tenants. | ||
| "InviteKey": provisionInviteKey(h.ID), | ||
| // Per-hive customers hub import match key (HIVE_CUSTOMER_MATCH_KEY). | ||
| "CustomerMatchKey": provisionCustomerMatchKey(h.ID), |
There was a problem hiding this comment.
Nothing renders the template with this field. A typo between this map key and {{.CustomerMatchKey}} at line 3689 would be a template error at provision time, not a test failure. A small render test asserting HIVE_CUSTOMER_MATCH_KEY appears with provisionCustomerMatchKey(h.ID) would close it. Suggestion, not a defect.
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. Review findings from Code looks correct to me; routing only because this provisions a new derived credential to spokes. Verified against the tree at the PR head:
Why a person should look: the key is a per-hive HMAC secret, written in clear as a Deployment env value like hive/awaiting-ci: CI pending - sweep will merge when green. Fixed the F19 wiring test count floor (it did not assert the new customer match key) and merged v5. 🐝 Hive Agent: |
…ixture Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
… wiring test Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether injecting a new derived credential (HIVE_CUSTOMER_MATCH_KEY) into every hub-hosted spoke, and rolling the whole fleet once to converge it, is acceptable to land now?
The code looks correct to me; I am routing only because it adds a new per-hive derived credential to the spoke deployment template and the fleet reconcile, which is a credentials/deploy surface.
Verified against the tree:
provisionCustomerMatchKey(hub_keys.go) iscustomerMatchKey(provisionCurrentSecret(), hiveID), the same formula the hub verifies with incustomerMatchKeys(customer_match.go:69), so provisioning and reconcile agree and the sweep will not fight itself. It returns "" for an empty master or hive id, and the existing fail-safe indesiredPerHiveEnvskips such hives rather than writing an empty var.- The key is HKDF-style per-hive (
infoCustomerMatchKey), not the master, so a spoke compromise does not expose other tenants' keys. It matches theHIVE_INVITE_KEYpattern the issue (#19246) asked for. - The tests update the exact-count rotation and reconcile tests (
hub_generations_f19_wiring_test.go,perhive_env_reconcile_test.go), so a dropped entry inperHiveEnvNamesfails.
What a maintainer should know:
- Adding the var to
perHiveEnvNames()makes every existing spoke show drift (var absent), so the rate-limited reconciler will patch and roll every hub-hosted spoke once (3 per 15-minute cycle per the comment inperhive_env_reconcile.go). That is expected for this design but is a fleet-wide pod roll to ship an import that is off by default. - Minor: the comments at
perhive_env_reconcile.go:77("five security env vars") and:184("five ALWAYS-PRESENT") are now stale; the list has six entries. - Self-service
byo-hives get no key; the design doc states they cannot use the import in v1, matching option 3 in the issue.
-- hive: agent=reviewer-2 backend=claude model=claude-sonnet-5-5 claude=2.1.328
|
Needs a decision, not a merge:
Head: verdict requires_human @60bd2a1, 79/79 checks green, DCO yes, soak 0s of 10m0s. What to do: approve this head ( How to release it:
Clear the cause and the hive re-evaluates on its next pass; the stage moves to |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
/approve Posted by @clubanderson from the Hive dashboard; the merge gate decides from here. |
|
/hive decision approve #19249: green head, reviewer question answered with the reversible default — proceed as implemented Rationale: no owner rule holds this back; a merge is reversible and keeps work moving. Hive decided: Approved for merge. Decided by the hive at @clubanderson's request as the owner's delegate under the owner-delegate policy (rule |
|
Approved by @clubanderson for Hive auto-merge on green CI. |
Hub-hosted spokes never hold the master, so the customers hub import found no match key and stayed inert. The hub now derives customerMatchKey(currentMaster, hive) and injects it as HIVE_CUSTOMER_MATCH_KEY at provisioning and in the per-hive env reconcile, so a rotation converges spokes to the current generation. Tests pin the injected key to customerMatchKey and the reconcile set. Self-service byo- hives hold no master; decision: they cannot use the hub import in v1, documented in the design doc. Default behaviour is unchanged (import stays off unless enabled and consented). Closes #19246
-- hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.328