Unify git credentials under drive credential + remote per-principal management#102
Merged
Conversation
….51.0)
Replace the node-host-local `omnyshell node git-credential` with a single
`omnyshell drive credential {add,list,remove}` group, mode chosen explicitly:
- `--local` — manage credentials on this node host (~/.omnyshell/git-credentials.json),
with --global (default) or --for-principal <p>; supports --ssh-key.
- `--node <node>` — manage YOUR OWN credentials on a remote node over the hub
(HTTPS only). Scoped to the calling principal.
Transport is a hub-brokered control-RPC (DriveCredentialRequest → hub →
NodeDriveCredentialRequest → response), mirroring the sessions screen/kill RPCs.
The hub stamps the authenticated principal, so a client can only ever read or
modify its own credentials on the node — never the global scope or another
principal's. The hub authorizes it exactly like opening a drive session
(canOpenSession, mode: drive); the node additionally requires driveEnabled and
only ever mutates scopeFor(principal: <stamped principal>). Concurrent RPCs are
serialized on the node to avoid load/save races.
NodeConfig gains an optional gitCredentialsHome (used for both the drive-open
resolver load and the RPC handler) so a node's store is relocatable — enabling
per-node test isolation.
Tests: codec round-trip for the new message quartet; end-to-end TestCluster
integration proving per-principal scoping (add/list/remove; one principal never
sees another's; stored under the caller, never global). Bumps to 1.51.0.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Replaces the node-host-local
omnyshell node git-credential(shipped in v1.50.0) with a singleomnyshell drive credential {add,list,remove}group, and adds remote management of a client's own git credentials on a node over the hub.Mode is chosen explicitly:
--local— manage credentials on this node host (~/.omnyshell/git-credentials.json), with--global(default) or--for-principal <p>; supports--ssh-key/--passphrase.--node <node>— manage your own credentials on a remote node, over the hub (HTTPS only:--pat,--username/--password), using the shared connect flags.Security model
Remote management is a hub-brokered control-RPC (
DriveCredentialRequest→ hub →NodeDriveCredentialRequest→ response), mirroring the existingsessions screen/killRPCs. The hub stamps the authenticated principal (peer.principal), so a client can only ever read/modify its own credentials on the node — never the global scope or another principal's. The hub authorizes it exactly like opening a drive (canOpenSession(mode: drive)); the node additionally requiresdriveEnabledand only ever mutatesscopeFor(principal: <stamped>). Concurrent RPCs are serialized node-side to avoid load/save races.NodeConfiggains an optionalgitCredentialsHome(used by both the drive-open resolver load and the RPC handler) so a node's store is relocatable — enabling per-node test isolation.Changes
DriveCredentialRequest/NodeDriveCredentialRequest/NodeDriveCredentialResponse/DriveCredentialResponse+DriveCredentialEntry(control_message.dart), registered in frame_codec._handleDriveCredentialRequest(authorize + stamp principal + relay); response →_completeNodeRpc._onDriveCredentialRequest(serialized; scopes toreq.principal;driveEnabledgate);NodeConfig.gitCredentialsHome.driveCredentialAdd/List/Remove+DriveCredentialResult.node git-credential; addeddrive credential(local + remote).Test plan
dart analyze+dart format --set-exit-if-changed .— clean.listsees nothing of alice's; remove affects only the caller.Requires omnydrive ^1.10.0 (no omnydrive change).
🤖 Generated with Claude Code