diff --git a/bitwarden_license/src/app/organizations/manage/sso.component.html b/bitwarden_license/src/app/organizations/manage/sso.component.html index 07ee1ffe335..6f03b034ec1 100644 --- a/bitwarden_license/src/app/organizations/manage/sso.component.html +++ b/bitwarden_license/src/app/organizations/manage/sso.component.html @@ -7,14 +7,50 @@ {{'loading' | i18n}} -
+ +

+ {{'ssoPolicyHelpStart' | i18n}} + {{'ssoPolicyHelpLink' | i18n}} + {{'ssoPolicyHelpEnd' | i18n}} +

+
- + +
+ {{'allowSsoDesc' | i18n}} +
+ +
+ +
+ + +
+
+ +
+ + + {{'keyConnectorWarning' | i18n}} + + +
+ + +
+
+
-
-
- - -
-
- -
- - -
-
@@ -67,24 +91,24 @@
- - + +
- - + +
- - + +
- - + +
- - @@ -99,28 +123,31 @@
- - + +
- - + +
- - + +
- - + +
- - + +
- - + +
@@ -174,8 +201,8 @@
- - @@ -188,35 +215,43 @@
- -
- -
- -
- - + +
- - + +
@@ -226,36 +261,39 @@

{{'samlIdpConfig' | i18n}}

- - + +
- -
- - + +
- - + +
- - + +
- - + +
- -
diff --git a/bitwarden_license/src/app/organizations/manage/sso.component.ts b/bitwarden_license/src/app/organizations/manage/sso.component.ts index 8c47b0cb52f..1b711909db3 100644 --- a/bitwarden_license/src/app/organizations/manage/sso.component.ts +++ b/bitwarden_license/src/app/organizations/manage/sso.component.ts @@ -37,8 +37,8 @@ export class SsoComponent implements OnInit { data = this.fb.group({ configType: [], - useCryptoAgent: [], - cryptoAgentUrl: [], + useKeyConnector: [], + keyConnectorUrl: [], // OpenId authority: [], diff --git a/jslib b/jslib index 2db9e1ce0d7..8f177e2d3a8 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 2db9e1ce0d7a702f07f20ecb916dd8191ff617e1 +Subproject commit 8f177e2d3a879b854db5c6e6d7d386b24d637a66 diff --git a/src/app/accounts/lock.component.ts b/src/app/accounts/lock.component.ts index 5ce77d9fcf3..5cb83878589 100644 --- a/src/app/accounts/lock.component.ts +++ b/src/app/accounts/lock.component.ts @@ -5,6 +5,7 @@ import { ApiService } from 'jslib-common/abstractions/api.service'; import { CryptoService } from 'jslib-common/abstractions/crypto.service'; import { EnvironmentService } from 'jslib-common/abstractions/environment.service'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; +import { KeyConnectorService } from 'jslib-common/abstractions/keyConnector.service'; import { LogService } from 'jslib-common/abstractions/log.service'; import { MessagingService } from 'jslib-common/abstractions/messaging.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; @@ -27,9 +28,11 @@ export class LockComponent extends BaseLockComponent { userService: UserService, cryptoService: CryptoService, storageService: StorageService, vaultTimeoutService: VaultTimeoutService, environmentService: EnvironmentService, private routerService: RouterService, - stateService: StateService, apiService: ApiService, logService: LogService) { + stateService: StateService, apiService: ApiService, logService: LogService, + keyConnectorService: KeyConnectorService) { super(router, i18nService, platformUtilsService, messagingService, userService, cryptoService, - storageService, vaultTimeoutService, environmentService, stateService, apiService, logService); + storageService, vaultTimeoutService, environmentService, stateService, apiService, logService, + keyConnectorService); } async ngOnInit() { diff --git a/src/app/accounts/remove-password.component.html b/src/app/accounts/remove-password.component.html new file mode 100644 index 00000000000..67c9caba184 --- /dev/null +++ b/src/app/accounts/remove-password.component.html @@ -0,0 +1,31 @@ +
+
+ +

+ + {{'loading' | i18n}} +

+
+
+
+
+
+

{{'removeMasterPassword' | i18n}}

+
+
+
+

{{'convertOrganizationEncryptionDesc' | i18n : organization.name}}

+ + + +
+
+
+
+
diff --git a/src/app/accounts/remove-password.component.ts b/src/app/accounts/remove-password.component.ts new file mode 100644 index 00000000000..c83269494a9 --- /dev/null +++ b/src/app/accounts/remove-password.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +import { RemovePasswordComponent as BaseRemovePasswordComponent } from 'jslib-angular/components/remove-password.component'; + +@Component({ + selector: 'app-remove-password', + templateUrl: 'remove-password.component.html', +}) +export class RemovePasswordComponent extends BaseRemovePasswordComponent { +} diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 9d3207e4a4a..f01ecb6956b 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -32,6 +32,7 @@ import { CryptoService } from 'jslib-common/abstractions/crypto.service'; import { EventService } from 'jslib-common/abstractions/event.service'; import { FolderService } from 'jslib-common/abstractions/folder.service'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; +import { KeyConnectorService } from 'jslib-common/abstractions/keyConnector.service'; import { NotificationsService } from 'jslib-common/abstractions/notifications.service'; import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service'; import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service'; @@ -92,7 +93,8 @@ export class AppComponent implements OnDestroy, OnInit { private sanitizer: DomSanitizer, private searchService: SearchService, private notificationsService: NotificationsService, private routerService: RouterService, private stateService: StateService, private eventService: EventService, - private policyService: PolicyService, protected policyListService: PolicyListService) { } + private policyService: PolicyService, protected policyListService: PolicyListService, + private keyConnectorService: KeyConnectorService) { } ngOnInit() { this.ngZone.runOutsideAngular(() => { @@ -163,6 +165,10 @@ export class AppComponent implements OnDestroy, OnInit { case 'setFullWidth': this.setFullWidth(); break; + case 'convertAccountToKeyConnector': + this.keyConnectorService.setConvertAccountRequired(true); + this.router.navigate(['/remove-password']); + break; default: break; } @@ -218,6 +224,7 @@ export class AppComponent implements OnDestroy, OnInit { this.policyService.clear(userId), this.passwordGenerationService.clear(), this.stateService.purge(), + this.keyConnectorService.clear(), ]); this.searchService.clearIndex(); diff --git a/src/app/organizations/policies/master-password.component.html b/src/app/organizations/policies/master-password.component.html index 830d8ac57a3..f8709803876 100644 --- a/src/app/organizations/policies/master-password.component.html +++ b/src/app/organizations/policies/master-password.component.html @@ -1,3 +1,7 @@ + + {{'keyConnectorPolicyRestriction' | i18n}} + +
diff --git a/src/app/organizations/policies/master-password.component.ts b/src/app/organizations/policies/master-password.component.ts index 626732177a4..36f368ce39a 100644 --- a/src/app/organizations/policies/master-password.component.ts +++ b/src/app/organizations/policies/master-password.component.ts @@ -2,6 +2,7 @@ import { Component } from '@angular/core'; import { FormBuilder } from '@angular/forms'; import { I18nService } from 'jslib-common/abstractions/i18n.service'; +import { UserService } from 'jslib-common/abstractions/user.service'; import { PolicyType } from 'jslib-common/enums/policyType'; @@ -30,8 +31,9 @@ export class MasterPasswordPolicyComponent extends BasePolicyComponent { }); passwordScores: { name: string; value: number; }[]; + showKeyConnectorInfo: boolean = false; - constructor(private fb: FormBuilder, i18nService: I18nService) { + constructor(private fb: FormBuilder, i18nService: I18nService, private userService: UserService) { super(); this.passwordScores = [ @@ -43,4 +45,10 @@ export class MasterPasswordPolicyComponent extends BasePolicyComponent { { name: i18nService.t('strong') + ' (4)', value: 4 }, ]; } + + async ngOnInit() { + super.ngOnInit(); + const organization = await this.userService.getOrganization(this.policyResponse.organizationId); + this.showKeyConnectorInfo = organization.usesKeyConnector; + } } diff --git a/src/app/organizations/policies/reset-password.component.html b/src/app/organizations/policies/reset-password.component.html index c36a60039dd..c2988718db3 100644 --- a/src/app/organizations/policies/reset-password.component.html +++ b/src/app/organizations/policies/reset-password.component.html @@ -1,3 +1,7 @@ + + {{'keyConnectorPolicyRestriction' | i18n}} + + {{'resetPasswordPolicyWarning' | i18n}} diff --git a/src/app/organizations/policies/reset-password.component.ts b/src/app/organizations/policies/reset-password.component.ts index 7ec8a86d62e..5ebebbc5713 100644 --- a/src/app/organizations/policies/reset-password.component.ts +++ b/src/app/organizations/policies/reset-password.component.ts @@ -1,5 +1,6 @@ import { Component } from '@angular/core'; import { FormBuilder } from '@angular/forms'; +import { UserService } from 'jslib-common/abstractions/user.service'; import { PolicyType } from 'jslib-common/enums/policyType'; @@ -29,8 +30,15 @@ export class ResetPasswordPolicyComponent extends BasePolicyComponent { }); defaultTypes: { name: string; value: string; }[]; + showKeyConnectorInfo: boolean = false; - constructor(private fb: FormBuilder) { + constructor(private fb: FormBuilder, private userService: UserService) { super(); } + + async ngOnInit() { + super.ngOnInit(); + const organization = await this.userService.getOrganization(this.policyResponse.organizationId); + this.showKeyConnectorInfo = organization.usesKeyConnector; + } } diff --git a/src/app/organizations/settings/delete-organization.component.html b/src/app/organizations/settings/delete-organization.component.html index a9b24a028ae..18cd32c23a7 100644 --- a/src/app/organizations/settings/delete-organization.component.html +++ b/src/app/organizations/settings/delete-organization.component.html @@ -10,9 +10,8 @@ -
-

{{'changeEmail' | i18n}}

-
- -
-

{{'changeMasterPassword' | i18n}}

-
- -
-

{{'encKeySettings' | i18n}}

-
- + +
+

{{'changeEmail' | i18n}}

+
+ +
+ +
+

{{'changeMasterPassword' | i18n}}

+
+ +
+ +
+

{{'encKeySettings' | i18n}}

+
+ +

{{'apiKey' | i18n}}

diff --git a/src/app/settings/account.component.ts b/src/app/settings/account.component.ts index aa7e706fd0f..cef60b7f5bb 100644 --- a/src/app/settings/account.component.ts +++ b/src/app/settings/account.component.ts @@ -10,6 +10,7 @@ import { DeleteAccountComponent } from './delete-account.component'; import { PurgeVaultComponent } from './purge-vault.component'; import { ApiService } from 'jslib-common/abstractions/api.service'; +import { KeyConnectorService } from 'jslib-common/abstractions/keyConnector.service'; import { UserService } from 'jslib-common/abstractions/user.service'; import { ModalService } from 'jslib-angular/services/modal.service'; @@ -25,8 +26,17 @@ export class AccountComponent { @ViewChild('viewUserApiKeyTemplate', { read: ViewContainerRef, static: true }) viewUserApiKeyModalRef: ViewContainerRef; @ViewChild('rotateUserApiKeyTemplate', { read: ViewContainerRef, static: true }) rotateUserApiKeyModalRef: ViewContainerRef; + showChangePassword = true; + showChangeKdf = true; + showChangeEmail = true; + constructor(private modalService: ModalService, private apiService: ApiService, - private userService: UserService) { } + private userService: UserService, private keyConnectorService: KeyConnectorService) { } + + async ngOnInit() { + this.showChangeEmail = this.showChangeKdf = this.showChangePassword = + !await this.keyConnectorService.getUsesKeyConnector(); + } async deauthorizeSessions() { await this.modalService.openViewRef(DeauthorizeSessionsComponent, this.deauthModalRef); diff --git a/src/app/settings/api-key.component.html b/src/app/settings/api-key.component.html index fc413cb020a..0c610939418 100644 --- a/src/app/settings/api-key.component.html +++ b/src/app/settings/api-key.component.html @@ -9,11 +9,9 @@