1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-06 00:13:28 +00:00

[PS-1879] Fix Key Connector Migration Flow (#4080)

* Move OrganizationService to fullSync

* Add Tech Debt Tracking Link

* Remove Commented out code

* Add InternalOrganizationService

* Use InternalOrganization in services that get to update state
This commit is contained in:
Justin Baur
2022-11-18 16:38:28 -05:00
committed by GitHub
parent 80f5a883e0
commit 076e605f10
9 changed files with 54 additions and 106 deletions

View File

@@ -17,7 +17,7 @@ import { KeyConnectorService as KeyConnectorServiceAbstraction } from "@bitwarde
import { LogService as LogServiceAbstraction } from "@bitwarden/common/abstractions/log.service";
import { MessagingService as MessagingServiceAbstraction } from "@bitwarden/common/abstractions/messaging.service";
import { NotificationsService as NotificationsServiceAbstraction } from "@bitwarden/common/abstractions/notifications.service";
import { OrganizationService as OrganizationServiceAbstraction } from "@bitwarden/common/abstractions/organization/organization.service.abstraction";
import { InternalOrganizationService as InternalOrganizationServiceAbstraction } from "@bitwarden/common/abstractions/organization/organization.service.abstraction";
import { PasswordGenerationService as PasswordGenerationServiceAbstraction } from "@bitwarden/common/abstractions/passwordGeneration.service";
import { PlatformUtilsService as PlatformUtilsServiceAbstraction } from "@bitwarden/common/abstractions/platformUtils.service";
import { PolicyApiServiceAbstraction } from "@bitwarden/common/abstractions/policy/policy-api.service.abstraction";
@@ -153,7 +153,7 @@ export default class MainBackground {
popupUtilsService: PopupUtilsService;
sendService: SendServiceAbstraction;
fileUploadService: FileUploadServiceAbstraction;
organizationService: OrganizationServiceAbstraction;
organizationService: InternalOrganizationServiceAbstraction;
providerService: ProviderServiceAbstraction;
keyConnectorService: KeyConnectorServiceAbstraction;
userVerificationService: UserVerificationServiceAbstraction;
@@ -317,7 +317,7 @@ export default class MainBackground {
this.stateService
);
this.syncNotifierService = new SyncNotifierService();
this.organizationService = new OrganizationService(this.stateService, this.syncNotifierService);
this.organizationService = new OrganizationService(this.stateService);
this.policyService = new PolicyService(this.stateService, this.organizationService);
this.policyApiService = new PolicyApiService(
this.policyService,
@@ -409,7 +409,7 @@ export default class MainBackground {
this.stateService,
this.providerService,
this.folderApiService,
this.syncNotifierService,
this.organizationService,
logoutCallback
);
this.eventService = new EventService(

View File

@@ -3,15 +3,10 @@ import { OrganizationService } from "@bitwarden/common/services/organization/org
import { FactoryOptions, CachedServices, factory } from "./factory-options";
import { stateServiceFactory, StateServiceInitOptions } from "./state-service.factory";
import {
syncNotifierServiceFactory,
SyncNotifierServiceInitOptions,
} from "./sync-notifier-service.factory";
type OrganizationServiceFactoryOptions = FactoryOptions;
export type OrganizationServiceInitOptions = OrganizationServiceFactoryOptions &
SyncNotifierServiceInitOptions &
StateServiceInitOptions;
export function organizationServiceFactory(
@@ -22,10 +17,6 @@ export function organizationServiceFactory(
cache,
"organizationService",
opts,
async () =>
new OrganizationService(
await stateServiceFactory(cache, opts),
await syncNotifierServiceFactory(cache, opts)
)
async () => new OrganizationService(await stateServiceFactory(cache, opts))
);
}

View File

@@ -240,7 +240,7 @@ export class Main {
this.providerService = new ProviderService(this.stateService);
this.organizationService = new OrganizationService(this.stateService, this.syncNotifierService);
this.organizationService = new OrganizationService(this.stateService);
this.policyService = new PolicyService(this.stateService, this.organizationService);
@@ -322,7 +322,7 @@ export class Main {
this.stateService,
this.providerService,
this.folderApiService,
this.syncNotifierService,
this.organizationService,
async (expired: boolean) => await this.logout()
);

View File

@@ -273,6 +273,7 @@ const devServer =
https://quack.duckduckgo.com/api/email/addresses
https://app.anonaddy.com/api/v1/aliases
https://api.fastmail.com
http://localhost:5000
;object-src
'self'
blob: