mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
[PM-2270] Renamed Fido2Key.userName to Fido2Key.userDisplayName (#6005)
* Renamed fido2key property username to userDisplayName * Renamed username property on fido2key object to userdisplayname * updated username to userDisplayName in fido2 export
This commit is contained in:
@@ -120,9 +120,9 @@
|
||||
appStopClick
|
||||
appStopProp
|
||||
appA11yTitle="{{ 'copyUsername' | i18n }}"
|
||||
(click)="copy(cipher, cipher.fido2Key.userName, 'username', 'Username')"
|
||||
[ngClass]="{ disabled: !cipher.fido2Key.userName }"
|
||||
[attr.disabled]="!cipher.fido2Key.userName ? '' : null"
|
||||
(click)="copy(cipher, cipher.fido2Key.userDisplayName, 'username', 'Username')"
|
||||
[ngClass]="{ disabled: !cipher.fido2Key.userDisplayName }"
|
||||
[attr.disabled]="!cipher.fido2Key.userDisplayName ? '' : null"
|
||||
>
|
||||
<i class="bwi bwi-lg bwi-user" aria-hidden="true"></i>
|
||||
</button>
|
||||
|
||||
@@ -84,7 +84,7 @@ export class Fido2Component implements OnInit, OnDestroy {
|
||||
cipher.name = message.credentialName;
|
||||
cipher.type = CipherType.Fido2Key;
|
||||
cipher.fido2Key = new Fido2KeyView();
|
||||
cipher.fido2Key.userName = message.userName;
|
||||
cipher.fido2Key.userDisplayName = message.userName;
|
||||
this.ciphers = [cipher];
|
||||
} else if (message.type === "PickCredentialRequest") {
|
||||
this.ciphers = await Promise.all(
|
||||
|
||||
@@ -478,12 +478,12 @@
|
||||
<!-- Fido2Key -->
|
||||
<div *ngIf="cipher.type === cipherType.Fido2Key">
|
||||
<div class="box-content-row" appBoxRow>
|
||||
<label for="fido2KeyUsername">{{ "username" | i18n }}</label>
|
||||
<label for="fido2KeyUserDisplayName">{{ "username" | i18n }}</label>
|
||||
<input
|
||||
id="fido2KeyUsername"
|
||||
id="fido2KeyUserDisplayName"
|
||||
type="text"
|
||||
name="Fido2Key.Username"
|
||||
[(ngModel)]="cipher.fido2Key.userName"
|
||||
name="Fido2Key.UserDisplayName"
|
||||
[(ngModel)]="cipher.fido2Key.userDisplayName"
|
||||
appInputVerbatim
|
||||
[readonly]="!cipher.edit && editMode"
|
||||
/>
|
||||
|
||||
@@ -428,7 +428,7 @@
|
||||
<div *ngIf="cipher.type == cipherType.Fido2Key">
|
||||
<div class="box-content-row">
|
||||
<span class="row-label">{{ "username" | i18n }}</span>
|
||||
{{ cipher.fido2Key.userName }}
|
||||
{{ cipher.fido2Key.userDisplayName }}
|
||||
</div>
|
||||
<div class="box-content-row">
|
||||
<span class="row-label">{{ "typePasskey" | i18n }}</span>
|
||||
|
||||
@@ -461,12 +461,12 @@
|
||||
<!-- Fido2Key -->
|
||||
<div *ngIf="cipher.type === cipherType.Fido2Key">
|
||||
<div class="box-content-row" appBoxRow>
|
||||
<label for="fido2KeyUsername">{{ "username" | i18n }}</label>
|
||||
<label for="fido2KeyUserDisplayName">{{ "username" | i18n }}</label>
|
||||
<input
|
||||
id="fido2KeyUsername"
|
||||
id="fido2KeyUserDisplayName"
|
||||
type="text"
|
||||
name="Fido2Key.Username"
|
||||
[(ngModel)]="cipher.fido2Key.userName"
|
||||
name="Fido2Key.UserDisplayName"
|
||||
[(ngModel)]="cipher.fido2Key.userDisplayName"
|
||||
appInputVerbatim
|
||||
[readonly]="!cipher.edit && editMode"
|
||||
/>
|
||||
|
||||
@@ -399,7 +399,7 @@
|
||||
<div class="box-content-row">
|
||||
<div class="row-main">
|
||||
<span class="row-label">{{ "username" | i18n }}</span>
|
||||
{{ cipher.fido2Key.userName }}
|
||||
{{ cipher.fido2Key.userDisplayName }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-content-row">
|
||||
|
||||
@@ -836,14 +836,14 @@
|
||||
<ng-container *ngIf="cipher.type === cipherType.Fido2Key">
|
||||
<div class="row">
|
||||
<div class="col-6 form-group">
|
||||
<label for="fido2keyUsername">{{ "username" | i18n }}</label>
|
||||
<label for="fido2KeyUserDisplayName">{{ "username" | i18n }}</label>
|
||||
<div class="input-group">
|
||||
<input
|
||||
id="fido2keyUsername"
|
||||
id="fido2KeyUserDisplayName"
|
||||
class="form-control"
|
||||
type="text"
|
||||
name="Fido2key.Username"
|
||||
[(ngModel)]="cipher.fido2Key.userName"
|
||||
name="Fido2key.UserDisplayName"
|
||||
[(ngModel)]="cipher.fido2Key.userDisplayName"
|
||||
appInputVerbatim
|
||||
[disabled]="cipher.isDeleted || viewOnly"
|
||||
[readonly]="!cipher.edit && editMode"
|
||||
@@ -853,7 +853,7 @@
|
||||
type="button"
|
||||
class="btn btn-outline-secondary"
|
||||
appA11yTitle="{{ 'copyUsername' | i18n }}"
|
||||
(click)="copy(cipher.fido2Key.userName, 'username', 'Username')"
|
||||
(click)="copy(cipher.fido2Key.userDisplayName, 'username', 'Username')"
|
||||
>
|
||||
<i class="bwi bwi-lg bwi-clone" aria-hidden="true"></i>
|
||||
</button>
|
||||
|
||||
@@ -15,7 +15,7 @@ export class Fido2KeyExport {
|
||||
req.userHandle = "userHandle";
|
||||
req.counter = "counter";
|
||||
req.rpName = "rpName";
|
||||
req.userName = "userName";
|
||||
req.userDisplayName = "userDisplayName";
|
||||
return req;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ export class Fido2KeyExport {
|
||||
view.userHandle = req.userHandle;
|
||||
view.counter = parseInt(req.counter);
|
||||
view.rpName = req.rpName;
|
||||
view.userName = req.userName;
|
||||
view.userDisplayName = req.userDisplayName;
|
||||
return view;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,8 @@ export class Fido2KeyExport {
|
||||
domain.userHandle = req.userHandle != null ? new EncString(req.userHandle) : null;
|
||||
domain.counter = req.counter != null ? new EncString(req.counter) : null;
|
||||
domain.rpName = req.rpName != null ? new EncString(req.rpName) : null;
|
||||
domain.userName = req.userName != null ? new EncString(req.userName) : null;
|
||||
domain.userDisplayName =
|
||||
req.userDisplayName != null ? new EncString(req.userDisplayName) : null;
|
||||
return domain;
|
||||
}
|
||||
|
||||
@@ -57,7 +58,7 @@ export class Fido2KeyExport {
|
||||
userHandle: string;
|
||||
counter: string;
|
||||
rpName: string;
|
||||
userName: string;
|
||||
userDisplayName: string;
|
||||
|
||||
constructor(o?: Fido2KeyView | Fido2KeyDomain) {
|
||||
if (o == null) {
|
||||
@@ -74,7 +75,7 @@ export class Fido2KeyExport {
|
||||
this.userHandle = o.userHandle;
|
||||
this.counter = String(o.counter);
|
||||
this.rpName = o.rpName;
|
||||
this.userName = o.userName;
|
||||
this.userDisplayName = o.userDisplayName;
|
||||
} else {
|
||||
this.nonDiscoverableId = o.nonDiscoverableId?.encryptedString;
|
||||
this.keyType = o.keyType?.encryptedString;
|
||||
@@ -85,7 +86,7 @@ export class Fido2KeyExport {
|
||||
this.userHandle = o.userHandle?.encryptedString;
|
||||
this.counter = o.counter?.encryptedString;
|
||||
this.rpName = o.rpName?.encryptedString;
|
||||
this.userName = o.userName?.encryptedString;
|
||||
this.userDisplayName = o.userDisplayName?.encryptedString;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ export class Fido2KeyApi extends BaseResponse {
|
||||
|
||||
// Extras
|
||||
rpName: string;
|
||||
userName: string;
|
||||
userDisplayName: string;
|
||||
|
||||
constructor(data: any = null) {
|
||||
super(data);
|
||||
@@ -29,6 +29,6 @@ export class Fido2KeyApi extends BaseResponse {
|
||||
this.userHandle = this.getResponseProperty("UserHandle");
|
||||
this.counter = this.getResponseProperty("Counter");
|
||||
this.rpName = this.getResponseProperty("RpName");
|
||||
this.userName = this.getResponseProperty("UserName");
|
||||
this.userDisplayName = this.getResponseProperty("UserDisplayName");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ export class Fido2KeyData {
|
||||
|
||||
// Extras
|
||||
rpName: string;
|
||||
userName: string;
|
||||
userDisplayName: string;
|
||||
|
||||
constructor(data?: Fido2KeyApi) {
|
||||
if (data == null) {
|
||||
@@ -28,6 +28,6 @@ export class Fido2KeyData {
|
||||
this.userHandle = data.userHandle;
|
||||
this.counter = data.counter;
|
||||
this.rpName = data.rpName;
|
||||
this.userName = data.userName;
|
||||
this.userDisplayName = data.userDisplayName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ export class Fido2Key extends Domain {
|
||||
|
||||
// Extras
|
||||
rpName: EncString;
|
||||
userName: EncString;
|
||||
userDisplayName: EncString;
|
||||
origin: EncString;
|
||||
|
||||
constructor(obj?: Fido2KeyData) {
|
||||
@@ -40,7 +40,7 @@ export class Fido2Key extends Domain {
|
||||
userHandle: null,
|
||||
counter: null,
|
||||
rpName: null,
|
||||
userName: null,
|
||||
userDisplayName: null,
|
||||
origin: null,
|
||||
},
|
||||
[]
|
||||
@@ -59,7 +59,7 @@ export class Fido2Key extends Domain {
|
||||
rpId: null,
|
||||
userHandle: null,
|
||||
rpName: null,
|
||||
userName: null,
|
||||
userDisplayName: null,
|
||||
origin: null,
|
||||
},
|
||||
orgId,
|
||||
@@ -92,7 +92,7 @@ export class Fido2Key extends Domain {
|
||||
userHandle: null,
|
||||
counter: null,
|
||||
rpName: null,
|
||||
userName: null,
|
||||
userDisplayName: null,
|
||||
origin: null,
|
||||
});
|
||||
return i;
|
||||
@@ -112,7 +112,7 @@ export class Fido2Key extends Domain {
|
||||
const userHandle = EncString.fromJSON(obj.userHandle);
|
||||
const counter = EncString.fromJSON(obj.counter);
|
||||
const rpName = EncString.fromJSON(obj.rpName);
|
||||
const userName = EncString.fromJSON(obj.userName);
|
||||
const userDisplayName = EncString.fromJSON(obj.userDisplayName);
|
||||
const origin = EncString.fromJSON(obj.origin);
|
||||
|
||||
return Object.assign(new Fido2Key(), obj, {
|
||||
@@ -125,7 +125,7 @@ export class Fido2Key extends Domain {
|
||||
userHandle,
|
||||
counter,
|
||||
rpName,
|
||||
userName,
|
||||
userDisplayName,
|
||||
origin,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ describe("Login DTO", () => {
|
||||
userHandle: "userHandle" as EncryptedString,
|
||||
counter: "counter" as EncryptedString,
|
||||
rpName: "rpName" as EncryptedString,
|
||||
userName: "userName" as EncryptedString,
|
||||
userDisplayName: "userDisplayName" as EncryptedString,
|
||||
origin: "origin" as EncryptedString,
|
||||
},
|
||||
});
|
||||
@@ -143,7 +143,7 @@ describe("Login DTO", () => {
|
||||
userHandle: "userHandle_fromJSON",
|
||||
counter: "counter_fromJSON",
|
||||
rpName: "rpName_fromJSON",
|
||||
userName: "userName_fromJSON",
|
||||
userDisplayName: "userDisplayName_fromJSON",
|
||||
origin: "origin_fromJSON",
|
||||
},
|
||||
});
|
||||
|
||||
@@ -100,9 +100,9 @@ export class CipherRequest {
|
||||
cipher.login.fido2Key.userHandle != null
|
||||
? cipher.login.fido2Key.userHandle.encryptedString
|
||||
: null;
|
||||
this.login.fido2Key.userName =
|
||||
cipher.login.fido2Key.userName != null
|
||||
? cipher.login.fido2Key.userName.encryptedString
|
||||
this.login.fido2Key.userDisplayName =
|
||||
cipher.login.fido2Key.userDisplayName != null
|
||||
? cipher.login.fido2Key.userDisplayName.encryptedString
|
||||
: null;
|
||||
}
|
||||
break;
|
||||
@@ -193,8 +193,10 @@ export class CipherRequest {
|
||||
cipher.fido2Key.counter != null ? cipher.fido2Key.counter.encryptedString : null;
|
||||
this.fido2Key.userHandle =
|
||||
cipher.fido2Key.userHandle != null ? cipher.fido2Key.userHandle.encryptedString : null;
|
||||
this.fido2Key.userName =
|
||||
cipher.fido2Key.userName != null ? cipher.fido2Key.userName.encryptedString : null;
|
||||
this.fido2Key.userDisplayName =
|
||||
cipher.fido2Key.userDisplayName != null
|
||||
? cipher.fido2Key.userDisplayName.encryptedString
|
||||
: null;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -14,10 +14,10 @@ export class Fido2KeyView extends ItemView {
|
||||
|
||||
// Extras
|
||||
rpName: string;
|
||||
userName: string;
|
||||
userDisplayName: string;
|
||||
|
||||
get subTitle(): string {
|
||||
return this.userName;
|
||||
return this.userDisplayName;
|
||||
}
|
||||
|
||||
get canLaunch(): boolean {
|
||||
|
||||
@@ -1103,7 +1103,7 @@ export class CipherService implements CipherServiceAbstraction {
|
||||
rpId: null,
|
||||
rpName: null,
|
||||
userHandle: null,
|
||||
userName: null,
|
||||
userDisplayName: null,
|
||||
origin: null,
|
||||
},
|
||||
key
|
||||
@@ -1175,7 +1175,7 @@ export class CipherService implements CipherServiceAbstraction {
|
||||
rpId: null,
|
||||
rpName: null,
|
||||
userHandle: null,
|
||||
userName: null,
|
||||
userDisplayName: null,
|
||||
origin: null,
|
||||
},
|
||||
key
|
||||
|
||||
@@ -320,7 +320,7 @@ describe("FidoAuthenticatorService", () => {
|
||||
rpName: params.rpEntity.name,
|
||||
userHandle: Fido2Utils.bufferToString(params.userEntity.id),
|
||||
counter: 0,
|
||||
userName: params.userEntity.displayName,
|
||||
userDisplayName: params.userEntity.displayName,
|
||||
}),
|
||||
})
|
||||
);
|
||||
@@ -419,7 +419,7 @@ describe("FidoAuthenticatorService", () => {
|
||||
rpName: params.rpEntity.name,
|
||||
userHandle: Fido2Utils.bufferToString(params.userEntity.id),
|
||||
counter: 0,
|
||||
userName: params.userEntity.displayName,
|
||||
userDisplayName: params.userEntity.displayName,
|
||||
}),
|
||||
}),
|
||||
})
|
||||
|
||||
@@ -427,7 +427,7 @@ async function createKeyView(
|
||||
fido2Key.userHandle = Fido2Utils.bufferToString(params.userEntity.id);
|
||||
fido2Key.counter = 0;
|
||||
fido2Key.rpName = params.rpEntity.name;
|
||||
fido2Key.userName = params.userEntity.displayName;
|
||||
fido2Key.userDisplayName = params.userEntity.displayName;
|
||||
|
||||
return fido2Key;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user