mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 07:43:35 +00:00
[EC-598] feat: add basic support for managing passkeys
This commit is contained in:
@@ -1198,6 +1198,9 @@
|
|||||||
"typeIdentity": {
|
"typeIdentity": {
|
||||||
"message": "Identity"
|
"message": "Identity"
|
||||||
},
|
},
|
||||||
|
"typePasskey": {
|
||||||
|
"message": "Passkey"
|
||||||
|
},
|
||||||
"passwordHistory": {
|
"passwordHistory": {
|
||||||
"message": "Password history"
|
"message": "Password history"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -112,6 +112,19 @@
|
|||||||
<span class="row-sub-label">{{ typeCounts.get(cipherType.SecureNote) || 0 }}</span>
|
<span class="row-sub-label">{{ typeCounts.get(cipherType.SecureNote) || 0 }}</span>
|
||||||
<span><i class="bwi bwi-angle-right bwi-lg row-sub-icon"></i></span>
|
<span><i class="bwi bwi-angle-right bwi-lg row-sub-icon"></i></span>
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="box-content-row"
|
||||||
|
appStopClick
|
||||||
|
(click)="selectType(cipherType.Fido2Key)"
|
||||||
|
>
|
||||||
|
<div class="row-main">
|
||||||
|
<div class="icon"><i class="bwi bwi-fw bwi-lg bwi-key"></i></div>
|
||||||
|
<span class="text">{{ "typePasskey" | i18n }}</span>
|
||||||
|
</div>
|
||||||
|
<span class="row-sub-label">{{ typeCounts.get(cipherType.Fido2Key) || 0 }}</span>
|
||||||
|
<span><i class="bwi bwi-angle-right bwi-lg row-sub-icon"></i></span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="box list" *ngIf="nestedFolders?.length">
|
<div class="box list" *ngIf="nestedFolders?.length">
|
||||||
|
|||||||
@@ -555,7 +555,12 @@
|
|||||||
class="box-content-row"
|
class="box-content-row"
|
||||||
appStopClick
|
appStopClick
|
||||||
(click)="fillCipher()"
|
(click)="fillCipher()"
|
||||||
*ngIf="cipher.type !== cipherType.SecureNote && !cipher.isDeleted && !inPopout"
|
*ngIf="
|
||||||
|
cipher.type !== cipherType.SecureNote &&
|
||||||
|
!cipher.isDeleted &&
|
||||||
|
!inPopout &&
|
||||||
|
cipher.type != cipherType.Fido2Key
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<div class="row-main text-primary">
|
<div class="row-main text-primary">
|
||||||
<div class="icon text-primary" aria-hidden="true">
|
<div class="icon text-primary" aria-hidden="true">
|
||||||
@@ -569,7 +574,12 @@
|
|||||||
class="box-content-row"
|
class="box-content-row"
|
||||||
appStopClick
|
appStopClick
|
||||||
(click)="fillCipherAndSave()"
|
(click)="fillCipherAndSave()"
|
||||||
*ngIf="cipher.type === cipherType.Login && !cipher.isDeleted && !inPopout"
|
*ngIf="
|
||||||
|
cipher.type === cipherType.Login &&
|
||||||
|
!cipher.isDeleted &&
|
||||||
|
!inPopout &&
|
||||||
|
cipher.type != cipherType.Fido2Key
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<div class="row-main text-primary">
|
<div class="row-main text-primary">
|
||||||
<div class="icon text-primary" aria-hidden="true">
|
<div class="icon text-primary" aria-hidden="true">
|
||||||
@@ -583,7 +593,7 @@
|
|||||||
class="box-content-row"
|
class="box-content-row"
|
||||||
appStopClick
|
appStopClick
|
||||||
(click)="clone()"
|
(click)="clone()"
|
||||||
*ngIf="!cipher.organizationId && !cipher.isDeleted"
|
*ngIf="!cipher.organizationId && !cipher.isDeleted && cipher.type != cipherType.Fido2Key"
|
||||||
>
|
>
|
||||||
<div class="row-main text-primary">
|
<div class="row-main text-primary">
|
||||||
<div class="icon text-primary" aria-hidden="true">
|
<div class="icon text-primary" aria-hidden="true">
|
||||||
|
|||||||
@@ -65,6 +65,9 @@ export class IconComponent implements OnChanges {
|
|||||||
case CipherType.Identity:
|
case CipherType.Identity:
|
||||||
this.icon = "bwi-id-card";
|
this.icon = "bwi-id-card";
|
||||||
break;
|
break;
|
||||||
|
case CipherType.Fido2Key:
|
||||||
|
this.icon = "bwi-key"; // TODO: Verify if this icon should be classified as "Bitwarden Object"
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,6 +78,8 @@ export class CipherView implements View, InitializerMetadata {
|
|||||||
return this.card;
|
return this.card;
|
||||||
case CipherType.Identity:
|
case CipherType.Identity:
|
||||||
return this.identity;
|
return this.identity;
|
||||||
|
case CipherType.Fido2Key:
|
||||||
|
return this.fido2Key;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
export class Fido2KeyView {
|
import { ItemView } from "./item.view";
|
||||||
|
|
||||||
|
export class Fido2KeyView extends ItemView {
|
||||||
key: string;
|
key: string;
|
||||||
rpId: string;
|
rpId: string;
|
||||||
origin: string;
|
origin: string;
|
||||||
userHandle: string;
|
userHandle: string;
|
||||||
|
|
||||||
|
get subTitle(): string {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -172,6 +172,10 @@ export class Fido2Service implements Fido2ServiceAbstraction {
|
|||||||
for (const allowedCredential of allowedCredentialIds) {
|
for (const allowedCredential of allowedCredentialIds) {
|
||||||
cipher = await this.cipherService.get(allowedCredential);
|
cipher = await this.cipherService.get(allowedCredential);
|
||||||
|
|
||||||
|
if (cipher.deletedDate != undefined) {
|
||||||
|
cipher = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
if (cipher != undefined) {
|
if (cipher != undefined) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -211,7 +215,7 @@ export class Fido2Service implements Fido2ServiceAbstraction {
|
|||||||
private async getCredentialByRp(rpId: string): Promise<BitCredential | undefined> {
|
private async getCredentialByRp(rpId: string): Promise<BitCredential | undefined> {
|
||||||
const allCipherViews = await this.cipherService.getAllDecrypted();
|
const allCipherViews = await this.cipherService.getAllDecrypted();
|
||||||
const cipherView = allCipherViews.find(
|
const cipherView = allCipherViews.find(
|
||||||
(cv) => cv.type === CipherType.Fido2Key && cv.fido2Key?.rpId === rpId
|
(cv) => !cv.isDeleted && cv.type === CipherType.Fido2Key && cv.fido2Key?.rpId === rpId
|
||||||
);
|
);
|
||||||
|
|
||||||
if (cipherView == undefined) {
|
if (cipherView == undefined) {
|
||||||
|
|||||||
Reference in New Issue
Block a user