Skip to content

Conversation

@saeedvaziry
Copy link
Member

closes #924

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds the ability to deploy SSH keys to specific users on servers, rather than only to the default SSH user. This allows for more granular control when managing SSH access across different system users.

  • Added user selection when deploying SSH keys through both web UI and API
  • Updated SSH key deployment and deletion scripts to work with user-specific authorized_keys files
  • Added validation to ensure keys are only deployed to valid server users

Reviewed Changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/Feature/ServerKeysTest.php Added test coverage for deploying keys to specific users and validating invalid users
tests/Feature/API/ServerSshKeysTest.php Added API test coverage for user-specific key deployment and validation
resources/views/ssh/os/deploy-ssh-key.blade.php Updated deployment script to work with user-specific SSH directories without sudo
resources/views/ssh/os/delete-ssh-key.blade.php Improved deletion script to safely remove keys from user-specific authorized_keys files
resources/js/types/ssh-key.d.ts Added deployment_user field to TypeScript interface
resources/js/pages/server-ssh-keys/components/deploy-key.tsx Added user selection dropdown to deployment form
resources/js/pages/server-ssh-keys/components/columns.tsx Added "Deployed to User" column to display which user has the key
public/api-docs/openapi/ssh-keys.yaml Added comprehensive API documentation for SSH key endpoints
public/api-docs/openapi/schemas/SshKey.yaml Updated schema to include deployment_user field
database/migrations/2025_11_13_185811_add_user_to_server_ssh_keys_table.php Added user column to track which user each key is deployed to
app/SSH/OS/OS.php Updated deploySSHKey and deleteSSHKey methods to accept user parameter
app/Models/SshKey.php Added user to pivot attributes
app/Models/Server.php Added user to pivot attributes
app/Http/Resources/SshKeyResource.php Added deployment_user to API response
app/Http/Controllers/ServerSshKeyController.php Updated to pass user input to deployment action
app/Http/Controllers/API/ServerSSHKeyController.php Updated to pass user input to deployment action
app/Actions/SshKey/DeployKeyToServer.php Added validation and handling for user parameter with backward compatibility
app/Actions/SshKey/DeleteKeyFromServer.php Updated to retrieve and use the correct user when deleting keys

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

saeedvaziry and others added 2 commits November 13, 2025 23:55
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@saeedvaziry saeedvaziry merged commit 944d48e into 3.x Nov 13, 2025
3 checks passed
@saeedvaziry saeedvaziry deleted the ssh-key-user branch November 13, 2025 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to upload an SSH key to an isolated user?

2 participants