feat(user): add SSH key management#338
Merged
Merged
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Add ListKeys, AddKey, and RemoveKey methods to the user Provider interface for managing SSH authorized_keys files. Includes Debian implementation with fingerprint-based idempotency, Darwin/Linux ErrUnsupported stubs, regenerated mocks, and 100% test coverage. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add SSH key operation constants (list, add, remove) to the SDK and job packages, create the agent processor to dispatch SSH key sub-operations via the existing user provider, and wire the new "sshKey" case into the node processor. All functions have 100% test coverage. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add GET/POST /node/{hostname}/user/{name}/ssh-key and
DELETE /node/{hostname}/user/{name}/ssh-key/{fingerprint}
endpoints to the user OpenAPI spec. Regenerate server code,
combined spec, SDK client, and docs. Include stub handler
methods so the project compiles (implementation in Task 5).
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Replace stub SSH key handlers with full implementations for list, add, and remove operations. Each handler supports single-target and broadcast routing with proper validation, skipped/failed status handling, and comprehensive test coverage (unit, HTTP wiring, RBAC). 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add ListKeys, AddKey, and RemoveKey methods to UserService with SSH key types, gen-to-SDK conversion functions, export bridges, and full httptest coverage for all status code paths. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add ssh-key subcommand under user with list, add, and remove operations for managing SSH authorized keys. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Fix Go naming convention violations flagged by revive linter. OpenAPI operationIds changed from SshKey to SSHKey, then regenerated all code and updated Go identifiers across handlers, processors, CLI commands, SDK client, and tests. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #338 +/- ##
========================================
Coverage 99.89% 99.90%
========================================
Files 410 415 +5
Lines 18979 19569 +590
========================================
+ Hits 18960 19550 +590
Misses 11 11
Partials 8 8
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
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
~/.ssh/authorized_keysfor any system user/node/{hostname}/user/{name}/ssh-keyuser:read/user:writepermissions — no new permissionschanged: falseif fingerprint already presentTest plan
just go::unit)just go::vet)osapi client node user ssh-key list --target _any --name rootosapi client node user ssh-key add --target _any --name testuser --key "ssh-ed25519 AAAA... test"--jsonoutput for all commands--target _all🤖 Generated with Claude Code