feat(driver): add adminToken parameter to PolicySet (PILOT-233)#8
Merged
Conversation
Mirrors the change that landed in TeoSlayer/pilotprotocol#172 — the managed.policy.set IPC is a network-admin operation; without an adminToken parameter, the gate that PR #172 added to the daemon side has no caller-side support. Wire format: [cmd][sub][action=0x01][netID(2)][tokenLen(2)][token...][policyJSON...] Threat model alignment (per PILOT-347): - Only the network administrators hold the admin token. - managed.policy.set is correctly admin-gated. - User-owned IPC ops (rotate_key, handshake approve/reject/revoke, set_webhook) belong on a SO_PEERCRED check, not admin-token — see TeoSlayer/pilotprotocol#176 for that pattern. Empty adminToken is fine for solo-mode daemons (no AdminToken configured); managed-mode daemons reject empty. Tests updated to pass empty token. go test ./driver/... PASS.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Caller-side companion to TeoSlayer/pilotprotocol#172. Without this, web4 v0.2+ siblings can't compile against current web4 main because the PolicySet signature differs.
Threat model is the one we settled on in PILOT-347: admin-token gates network-admin ops (this one); user-owned ops use SO_PEERCRED instead.
Tested locally — go test ./driver/... PASS.