-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat/gen ssh key #3656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
feat/gen ssh key #3656
Changes from all commits
2a741b7
186b1b8
3463fbb
1fc0245
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -109,15 +109,47 @@ | |||||||||||||||||||||||||||||||||||||||||||||||
| dense | ||||||||||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| <v-checkbox | ||||||||||||||||||||||||||||||||||||||||||||||||
| v-model="item.generate_ssh_key" | ||||||||||||||||||||||||||||||||||||||||||||||||
| label="Generate SSH Key" | ||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
| label="Generate SSH Key" | |
| :label="$t('generateSshKey')" |
Copilot
AI
Feb 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The checkbox for generating SSH keys is only disabled when canEditSecrets is false, but it should also be disabled for existing keys where override_secret is required. When editing an existing key without override_secret checked, users can toggle generate_ssh_key, but this won't have any effect because the secret won't be updated. This creates a confusing user experience.
Consider adding || (!isNew && !item.override_secret) to the disabled condition to make it clear that SSH key generation only works when secrets can be edited.
| :disabled="formSaving || !canEditSecrets" | |
| :disabled="formSaving || !canEditSecrets || (!isNew && !item.override_secret)" |
Copilot
AI
Feb 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline styles are used extensively for the public key display section. Consider extracting these styles to a scoped <style> section or using CSS classes for better maintainability and consistency. This makes it easier to maintain and update styling across the application.
| <div style="position: relative"> | |
| <pre | |
| style=" | |
| overflow: auto; | |
| background: gray; | |
| color: white; | |
| border-radius: 10px; | |
| margin-top: 5px; | |
| " | |
| class="pa-2" | |
| >{{ publicKey }}</pre | |
| > | |
| <CopyClipboardButton | |
| style="position: absolute; right: 0; top: 0; transform: scale(0.9);" | |
| <div class="public-key-container"> | |
| <pre | |
| class="pa-2 public-key-display" | |
| >{{ publicKey }}</pre | |
| > | |
| <CopyClipboardButton | |
| class="public-key-copy-button" |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -5,7 +5,7 @@ | |||||||||||||||||||
| :save-button-text="itemId === 'new' ? $t('create') : $t('save')" | ||||||||||||||||||||
| :title="`${itemId === 'new' ? $t('nnew') : $t('edit')} Key`" | ||||||||||||||||||||
| :max-width="450" | ||||||||||||||||||||
| @save="loadItems()" | ||||||||||||||||||||
| @save="loadItemsAndShowPublicKey($event)" | ||||||||||||||||||||
| > | ||||||||||||||||||||
| <template v-slot:form="{ onSave, onError, needSave, needReset }"> | ||||||||||||||||||||
| <KeyForm | ||||||||||||||||||||
|
|
@@ -20,6 +20,37 @@ | |||||||||||||||||||
| </template> | ||||||||||||||||||||
| </EditDialog> | ||||||||||||||||||||
|
|
||||||||||||||||||||
| <EditDialog | ||||||||||||||||||||
| :max-width="700" | ||||||||||||||||||||
| v-model="createdPublicKeyDialog" | ||||||||||||||||||||
| :save-button-text="null" | ||||||||||||||||||||
| title="Generated SSH Public Key" | ||||||||||||||||||||
|
||||||||||||||||||||
| title="Generated SSH Public Key" | |
| :title="$t('generatedSshPublicKey')" |
Copilot
AI
Feb 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline styles are duplicated between KeyForm.vue and Keys.vue for displaying the public key. The same styling is applied to the <pre> element in both files (gray background, white color, border-radius, etc.). Consider creating a reusable component or shared styles to avoid this duplication and ensure consistency.
| style=" | |
| overflow: auto; | |
| background: gray; | |
| color: white; | |
| border-radius: 10px; | |
| margin-top: 5px; | |
| " | |
| class="pa-2" | |
| class="pa-2 mt-1 rounded overflow-auto grey darken-3 white--text" |
Copilot
AI
Feb 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for determining if a public key should be shown on update (line 156) assumes that if generate_ssh_key is true, a key was generated. However, this flag comes from the request body, not the response. If the backend fails to generate the key (but doesn't return an error), or if the key generation is skipped for some reason, the dialog may still appear with an empty public key. Consider adding an additional check to ensure the public key was actually generated before showing the dialog.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SSH key generation functionality introduced by this PR lacks automated test coverage. Consider adding tests to verify that maybeGenerateSSHPrivateKey correctly generates keys when GenerateSSHKey is true, sets the Plain field with the public key, and properly handles the case when GenerateSSHKey is false. Tests should also verify that the generated private key is valid and properly encrypted.
Example test cases to add: