mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 16:53:34 +00:00
[PM-3155] CLI: Editing a cipher with a non-discoverable passkey causes the passkey to be removed (#6055)
* Added fido2keyexport for the CLI and added the fido2key field to the login response for the CLI * Added fido2keyexport for the CLI and added the fido2key field to the login response for the CLI * Removed unneccesary code * Added non discoverable passkey to template
This commit is contained in:
@@ -2,6 +2,7 @@ import { EncString } from "../../platform/models/domain/enc-string";
|
||||
import { Login as LoginDomain } from "../../vault/models/domain/login";
|
||||
import { LoginView } from "../../vault/models/view/login.view";
|
||||
|
||||
import { Fido2KeyExport } from "./fido2key.export";
|
||||
import { LoginUriExport } from "./login-uri.export";
|
||||
|
||||
export class LoginExport {
|
||||
@@ -11,6 +12,7 @@ export class LoginExport {
|
||||
req.username = "jdoe";
|
||||
req.password = "myp@ssword123";
|
||||
req.totp = "JBSWY3DPEHPK3PXP";
|
||||
req.fido2Key = Fido2KeyExport.template();
|
||||
return req;
|
||||
}
|
||||
|
||||
@@ -21,6 +23,9 @@ export class LoginExport {
|
||||
view.username = req.username;
|
||||
view.password = req.password;
|
||||
view.totp = req.totp;
|
||||
if (req.fido2Key != null) {
|
||||
view.fido2Key = Fido2KeyExport.toView(req.fido2Key);
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
@@ -31,6 +36,7 @@ export class LoginExport {
|
||||
domain.username = req.username != null ? new EncString(req.username) : null;
|
||||
domain.password = req.password != null ? new EncString(req.password) : null;
|
||||
domain.totp = req.totp != null ? new EncString(req.totp) : null;
|
||||
//left out fido2Key for now
|
||||
return domain;
|
||||
}
|
||||
|
||||
@@ -38,6 +44,7 @@ export class LoginExport {
|
||||
username: string;
|
||||
password: string;
|
||||
totp: string;
|
||||
fido2Key: Fido2KeyExport = null;
|
||||
|
||||
constructor(o?: LoginView | LoginDomain) {
|
||||
if (o == null) {
|
||||
@@ -52,6 +59,10 @@ export class LoginExport {
|
||||
}
|
||||
}
|
||||
|
||||
if (o.fido2Key != null) {
|
||||
this.fido2Key = new Fido2KeyExport(o.fido2Key);
|
||||
}
|
||||
|
||||
if (o instanceof LoginView) {
|
||||
this.username = o.username;
|
||||
this.password = o.password;
|
||||
|
||||
Reference in New Issue
Block a user