1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 14:23:32 +00:00

[PM-16171] Simplelogin alias generation only generate random words instead the domain name (#13024)

* Exposes URI property from the cipher form.
* Updates credential generator to accept the URI using a `website` attribute

---------

Co-authored-by:  Audrey  <audrey@audreyality.com>
This commit is contained in:
albertboyd5
2025-02-20 10:33:40 -06:00
committed by GitHub
parent d5764a2b5e
commit ca41ecba29
24 changed files with 282 additions and 51 deletions

View File

@@ -3038,6 +3038,30 @@
}
}
},
"forwaderInvalidOperation": {
"message": "$SERVICENAME$ refused your request. Please contact your service provider for assistance.",
"description": "Displayed when the user is forbidden from using the API by the forwarding service.",
"placeholders": {
"servicename": {
"content": "$1",
"example": "SimpleLogin"
}
}
},
"forwaderInvalidOperationWithMessage": {
"message": "$SERVICENAME$ refused your request: $ERRORMESSAGE$",
"description": "Displayed when the user is forbidden from using the API by the forwarding service with an error message.",
"placeholders": {
"servicename": {
"content": "$1",
"example": "SimpleLogin"
},
"errormessage": {
"content": "$2",
"example": "Please verify your email address to continue."
}
}
},
"forwarderNoAccountId": {
"message": "Unable to obtain $SERVICENAME$ masked email account ID.",
"description": "Displayed when the forwarding service fails to return an account ID.",

View File

@@ -8,6 +8,7 @@
<vault-cipher-form-generator
[type]="params.type"
[uri]="uri"
(valueGenerated)="onValueGenerated($event)"
></vault-cipher-form-generator>

View File

@@ -22,6 +22,7 @@ import {
})
class MockCipherFormGenerator {
@Input() type: "password" | "username";
@Input() uri: string;
@Output() valueGenerated = new EventEmitter<string>();
}

View File

@@ -15,6 +15,7 @@ import { PopupPageComponent } from "../../../../../platform/popup/layout/popup-p
export interface GeneratorDialogParams {
type: "password" | "username";
uri?: string;
}
export interface GeneratorDialogResult {
@@ -60,11 +61,15 @@ export class VaultGeneratorDialogComponent {
*/
protected generatedValue: string = "";
protected uri: string;
constructor(
@Inject(DIALOG_DATA) protected params: GeneratorDialogParams,
private dialogRef: DialogRef<GeneratorDialogResult>,
private i18nService: I18nService,
) {}
) {
this.uri = params.uri;
}
/**
* Close the dialog without selecting a value.

View File

@@ -28,9 +28,9 @@ export class BrowserCipherFormGenerationService implements CipherFormGenerationS
return result.generatedValue;
}
async generateUsername(): Promise<string> {
async generateUsername(uri: string): Promise<string> {
const dialogRef = VaultGeneratorDialogComponent.open(this.dialogService, this.overlay, {
data: { type: "username" },
data: { type: "username", uri: uri },
});
const result = await firstValueFrom(dialogRef.closed);

View File

@@ -111,6 +111,30 @@
}
}
},
"forwaderInvalidOperation": {
"message": "$SERVICENAME$ refused your request. Please contact your service provider for assistance.",
"description": "Displayed when the user is forbidden from using the API by the forwarding service.",
"placeholders": {
"servicename": {
"content": "$1",
"example": "SimpleLogin"
}
}
},
"forwaderInvalidOperationWithMessage": {
"message": "$SERVICENAME$ refused your request: $ERRORMESSAGE$",
"description": "Displayed when the user is forbidden from using the API by the forwarding service with an error message.",
"placeholders": {
"servicename": {
"content": "$1",
"example": "SimpleLogin"
},
"errormessage": {
"content": "$2",
"example": "Please verify your email address to continue."
}
}
},
"forwarderNoAccountId": {
"message": "Unable to obtain $SERVICENAME$ masked email account ID.",
"description": "Displayed when the forwarding service fails to return an account ID.",

View File

@@ -2640,6 +2640,30 @@
}
}
},
"forwaderInvalidOperation": {
"message": "$SERVICENAME$ refused your request. Please contact your service provider for assistance.",
"description": "Displayed when the user is forbidden from using the API by the forwarding service.",
"placeholders": {
"servicename": {
"content": "$1",
"example": "SimpleLogin"
}
}
},
"forwaderInvalidOperationWithMessage": {
"message": "$SERVICENAME$ refused your request: $ERRORMESSAGE$",
"description": "Displayed when the user is forbidden from using the API by the forwarding service with an error message.",
"placeholders": {
"servicename": {
"content": "$1",
"example": "SimpleLogin"
},
"errormessage": {
"content": "$2",
"example": "Please verify your email address to continue."
}
}
},
"forwarderNoAccountId": {
"message": "Unable to obtain $SERVICENAME$ masked email account ID.",
"description": "Displayed when the forwarding service fails to return an account ID.",

View File

@@ -5,6 +5,7 @@
<ng-container bitDialogContent>
<vault-cipher-form-generator
[type]="params.type"
[uri]="uri"
(valueGenerated)="onValueGenerated($event)"
disableMargin
></vault-cipher-form-generator>

View File

@@ -23,6 +23,7 @@ import {
})
class MockCipherFormGenerator {
@Input() type: "password" | "username";
@Input() uri?: string;
@Output() valueGenerated = new EventEmitter<string>();
}

View File

@@ -10,6 +10,7 @@ import { CipherFormGeneratorComponent } from "@bitwarden/vault";
export interface WebVaultGeneratorDialogParams {
type: "password" | "username";
uri?: string;
}
export interface WebVaultGeneratorDialogResult {
@@ -48,11 +49,15 @@ export class WebVaultGeneratorDialogComponent {
*/
protected generatedValue: string = "";
protected uri: string;
constructor(
@Inject(DIALOG_DATA) protected params: WebVaultGeneratorDialogParams,
private dialogRef: DialogRef<WebVaultGeneratorDialogResult>,
private i18nService: I18nService,
) {}
) {
this.uri = params.uri;
}
/**
* Close the dialog without selecting a value.

View File

@@ -26,9 +26,9 @@ export class WebCipherFormGenerationService implements CipherFormGenerationServi
return result.generatedValue;
}
async generateUsername(): Promise<string> {
async generateUsername(uri: string): Promise<string> {
const dialogRef = WebVaultGeneratorDialogComponent.open(this.dialogService, {
data: { type: "username" },
data: { type: "username", uri: uri },
});
const result = await firstValueFrom(dialogRef.closed);

View File

@@ -6967,6 +6967,30 @@
}
}
},
"forwaderInvalidOperation": {
"message": "$SERVICENAME$ refused your request. Please contact your service provider for assistance.",
"description": "Displayed when the user is forbidden from using the API by the forwarding service.",
"placeholders": {
"servicename": {
"content": "$1",
"example": "SimpleLogin"
}
}
},
"forwaderInvalidOperationWithMessage": {
"message": "$SERVICENAME$ refused your request: $ERRORMESSAGE$",
"description": "Displayed when the user is forbidden from using the API by the forwarding service with an error message.",
"placeholders": {
"servicename": {
"content": "$1",
"example": "SimpleLogin"
},
"errormessage": {
"content": "$2",
"example": "Please verify your email address to continue."
}
}
},
"forwarderNoAccountId": {
"message": "Unable to obtain $SERVICENAME$ masked email account ID.",
"description": "Displayed when the forwarding service fails to return an account ID.",