1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-15 07:54:55 +00:00

feat(browser-approval): [PM-23620] Auth Request Answering Service - Getting the messaging correct.

This commit is contained in:
Patrick Pimentel
2025-08-12 09:02:06 -04:00
parent a61bd546b2
commit 450fc11b17
8 changed files with 35 additions and 15 deletions

View File

@@ -4380,7 +4380,7 @@
},
"uriMatchDefaultStrategyHint": {
"message": "URI match detection is how Bitwarden identifies autofill suggestions.",
"description": "Explains to the user that URI match detection determines how Bitwarden suggests autofill options, and clarifies that this default strategy applies when no specific match detection is set for a login item."
"description": "Explains to the user that URI match detection determines how Bitwarden suggests autofill options, and clarifies that this default strategy applies when no specific match detection is set for a login item."
},
"regExAdvancedOptionWarning": {
"message": "\"Regular expression\" is an advanced option with increased risk of exposing credentials.",
@@ -5117,6 +5117,18 @@
"showNumberOfAutofillSuggestions": {
"message": "Show number of login autofill suggestions on extension icon"
},
"accountAccessRequested": {
"message": "Account access requested"
},
"confirmAccessAttempt": {
"message": "Confirm access attempt for $EMAIL$",
"placeholders": {
"email": {
"content": "$1",
"example": "name@example.com"
}
}
},
"showQuickCopyActions": {
"message": "Show quick copy actions on Vault"
},

View File

@@ -35,7 +35,7 @@ class AutofillInit implements AutofillInitInterface {
* @param domElementVisibilityService - Used to check if an element is viewable.
* @param autofillOverlayContentService - The autofill overlay content service, potentially undefined.
* @param autofillInlineMenuContentService - The inline menu content service, potentially undefined.
* @param overlayNotificationsContentService - The overlay server notifications content service, potentially undefined.
* @param overlayNotificationsContentService - The overlay notifications content service, potentially undefined.
*/
constructor(
domQueryService: DomQueryService,

View File

@@ -1131,10 +1131,7 @@ export default class MainBackground {
this.actionsService = new BrowserActionsService(this.logService, this.platformUtilsService);
if ("notifications" in chrome) {
this.systemNotificationService = new BrowserSystemNotificationService(
this.logService,
this.platformUtilsService,
);
this.systemNotificationService = new BrowserSystemNotificationService();
} else {
this.systemNotificationService = new UnsupportedSystemNotificationsService();
}
@@ -1143,6 +1140,7 @@ export default class MainBackground {
this.accountService,
this.actionsService,
this.authService,
this.i18nService,
this.masterPasswordService,
this.platformUtilsService,
this.systemNotificationService,

View File

@@ -1,7 +1,5 @@
import { map, merge, Observable } from "rxjs";
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import {
ButtonLocation,
SystemNotificationClearInfo,
@@ -15,10 +13,7 @@ import { fromChromeEvent } from "../browser/from-chrome-event";
export class BrowserSystemNotificationService implements SystemNotificationsService {
notificationClicked$: Observable<SystemNotificationEvent>;
constructor(
private logService: LogService,
private platformUtilsService: PlatformUtilsService,
) {
constructor() {
this.notificationClicked$ = merge(
fromChromeEvent(chrome.notifications.onButtonClicked).pipe(
map(([notificationId, buttonIndex]) => ({

View File

@@ -596,7 +596,7 @@ const safeProviders: SafeProvider[] = [
safeProvider({
provide: SystemNotificationsService,
useClass: BrowserSystemNotificationService,
deps: [LogService, PlatformUtilsService],
deps: [],
}),
safeProvider({
provide: Fido2UserVerificationService,
@@ -630,7 +630,7 @@ const safeProviders: SafeProvider[] = [
safeProvider({
provide: SystemNotificationsService,
useClass: BrowserSystemNotificationService,
deps: [LogService, PlatformUtilsService],
deps: [],
}),
safeProvider({
provide: LoginComponentService,

View File

@@ -5426,6 +5426,18 @@
}
}
},
"accountAccessRequested": {
"message": "Account access requested"
},
"confirmAccessAttempt": {
"message": "Confirm access attempt for $EMAIL$",
"placeholders": {
"email": {
"content": "$1",
"example": "name@example.com"
}
}
},
"organizationDataOwnership": {
"message": "Enforce organization data ownership"
},

View File

@@ -970,6 +970,7 @@ const safeProviders: SafeProvider[] = [
AccountServiceAbstraction,
ActionsService,
AuthServiceAbstraction,
I18nServiceAbstraction,
MasterPasswordServiceAbstraction,
PlatformUtilsServiceAbstraction,
SystemNotificationsService,

View File

@@ -6,6 +6,7 @@ import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authenticatio
import { ForceSetPasswordReason } from "@bitwarden/common/auth/models/domain/force-set-password-reason";
import { getUserId } from "@bitwarden/common/auth/services/account.service";
import { MasterPasswordServiceAbstraction } from "@bitwarden/common/key-management/master-password/abstractions/master-password.service.abstraction";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { ActionsService } from "@bitwarden/common/platform/actions";
import {
@@ -22,6 +23,7 @@ export class AuthRequestAnsweringService implements AuthRequestAnsweringServiceA
private readonly accountService: AccountService,
private readonly actionService: ActionsService,
private readonly authService: AuthService,
private readonly i18nService: I18nService,
private readonly masterPasswordService: MasterPasswordServiceAbstraction,
private readonly platformUtilsService: PlatformUtilsService,
private readonly systemNotificationsService: SystemNotificationsService,
@@ -54,7 +56,7 @@ export class AuthRequestAnsweringService implements AuthRequestAnsweringServiceA
} else {
await this.systemNotificationsService.create({
id: `authRequest_${authRequestId}`,
title: "Test (i18n)",
title: this.i18nService.t("accountAccessRequested"),
body: "Pending Auth Request to Approve (i18n)",
buttons: [],
});