@@ -74,7 +74,7 @@
{{ orgDomain.lastCheckedDate | date: "medium" }}
- |
+ |
@@ -95,7 +95,7 @@
+
diff --git a/libs/vault/src/cipher-form/components/sshkey-section/sshkey-section.component.ts b/libs/vault/src/cipher-form/components/sshkey-section/sshkey-section.component.ts
index 773ddd4ad66..500bb886f7a 100644
--- a/libs/vault/src/cipher-form/components/sshkey-section/sshkey-section.component.ts
+++ b/libs/vault/src/cipher-form/components/sshkey-section/sshkey-section.component.ts
@@ -7,7 +7,8 @@ import { FormBuilder, ReactiveFormsModule } from "@angular/forms";
import { firstValueFrom } from "rxjs";
import { JslibModule } from "@bitwarden/angular/jslib.module";
-import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
+import { ClientType } from "@bitwarden/common/enums";
+import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { SdkService } from "@bitwarden/common/platform/abstractions/sdk/sdk.service";
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
import { SshKeyView } from "@bitwarden/common/vault/models/view/ssh-key.view";
@@ -22,6 +23,7 @@ import {
} from "@bitwarden/components";
import { generate_ssh_key } from "@bitwarden/sdk-internal";
+import { SshImportPromptService } from "../../../services/ssh-import-prompt.service";
import { CipherFormContainer } from "../../cipher-form-container";
@Component({
@@ -60,11 +62,14 @@ export class SshKeySectionComponent implements OnInit {
keyFingerprint: [""],
});
+ showImport = false;
+
constructor(
private cipherFormContainer: CipherFormContainer,
private formBuilder: FormBuilder,
- private i18nService: I18nService,
private sdkService: SdkService,
+ private sshImportPromptService: SshImportPromptService,
+ private platformUtilsService: PlatformUtilsService,
) {
this.cipherFormContainer.registerChildForm("sshKeyDetails", this.sshKeyForm);
this.sshKeyForm.valueChanges.pipe(takeUntilDestroyed()).subscribe((value) => {
@@ -87,6 +92,11 @@ export class SshKeySectionComponent implements OnInit {
}
this.sshKeyForm.disable();
+
+ // Web does not support clipboard access
+ if (this.platformUtilsService.getClientType() !== ClientType.Web) {
+ this.showImport = true;
+ }
}
/** Set form initial form values from the current cipher */
@@ -100,6 +110,17 @@ export class SshKeySectionComponent implements OnInit {
});
}
+ async importSshKeyFromClipboard() {
+ const key = await this.sshImportPromptService.importSshKeyFromClipboard();
+ if (key != null) {
+ this.sshKeyForm.setValue({
+ privateKey: key.privateKey,
+ publicKey: key.publicKey,
+ keyFingerprint: key.keyFingerprint,
+ });
+ }
+ }
+
private async generateSshKey() {
await firstValueFrom(this.sdkService.client$);
const sshKey = generate_ssh_key("Ed25519");
diff --git a/libs/vault/src/icons/browser-extension.ts b/libs/vault/src/icons/browser-extension.ts
index f0f9b781491..ac54322292f 100644
--- a/libs/vault/src/icons/browser-extension.ts
+++ b/libs/vault/src/icons/browser-extension.ts
@@ -1,7 +1,7 @@
import { svgIcon } from "@bitwarden/components";
export const BrowserExtensionIcon = svgIcon`
- |