From 58d9ac5ebcba8651dcf63cc71ffc59dd1ad2c624 Mon Sep 17 00:00:00 2001 From: Gbubemi Smith Date: Fri, 20 May 2022 15:22:44 +0100 Subject: [PATCH 01/22] [ps-136] Igonre accented characters in vault search (#1690) * removed accented character from serach input field * updated jslib --- src/app/modules/vault-filter/vault-filter.component.ts | 2 +- src/app/settings/billing-sync-key.component.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app/modules/vault-filter/vault-filter.component.ts b/src/app/modules/vault-filter/vault-filter.component.ts index 4442e0ab..56b72172 100644 --- a/src/app/modules/vault-filter/vault-filter.component.ts +++ b/src/app/modules/vault-filter/vault-filter.component.ts @@ -25,7 +25,7 @@ export class VaultFilterComponent extends BaseVaultFilterComponent { } searchTextChanged() { - this.onSearchTextChanged.emit(this.searchText); + this.onSearchTextChanged.emit(this.searchText.normalize("NFD").replace(/[\u0300-\u036f]/g, "")); } async initCollections() { diff --git a/src/app/settings/billing-sync-key.component.ts b/src/app/settings/billing-sync-key.component.ts index 9b80037c..929d8aaf 100644 --- a/src/app/settings/billing-sync-key.component.ts +++ b/src/app/settings/billing-sync-key.component.ts @@ -3,7 +3,6 @@ import { Component } from "@angular/core"; import { ApiService } from "jslib-common/abstractions/api.service"; import { LogService } from "jslib-common/abstractions/log.service"; import { OrganizationConnectionType } from "jslib-common/enums/organizationConnectionType"; -import { Utils } from "jslib-common/misc/utils"; import { BillingSyncConfigApi } from "jslib-common/models/api/billingSyncConfigApi"; import { BillingSyncConfigRequest } from "jslib-common/models/request/billingSyncConfigRequest"; import { OrganizationConnectionRequest } from "jslib-common/models/request/organizationConnectionRequest"; From 681ace4b1bb2877a7d1180424b2cea92ec32ad6d Mon Sep 17 00:00:00 2001 From: Robyn MacCallum Date: Mon, 23 May 2022 16:09:52 -0400 Subject: [PATCH 02/22] Use vaultFilter cipher type (#1701) --- .../modules/individual-vault/individual-vault.component.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts b/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts index 47e1906a..ababbd8a 100644 --- a/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts +++ b/src/app/modules/vault/modules/individual-vault/individual-vault.component.ts @@ -58,7 +58,6 @@ export class IndividualVaultComponent implements OnInit, OnDestroy { updateKeyModalRef: ViewContainerRef; favorites = false; - type: CipherType = null; folderId: string = null; collectionId: string = null; organizationId: string = null; @@ -327,7 +326,7 @@ export class IndividualVaultComponent implements OnInit, OnDestroy { async addCipher() { const component = await this.editCipher(null); - component.type = this.type; + component.type = this.activeFilter.cipherType; component.folderId = this.folderId === "none" ? null : this.folderId; if (this.activeFilter.selectedCollectionId != null) { const collection = this.filterComponent.collections.fullList.filter( @@ -399,7 +398,7 @@ export class IndividualVaultComponent implements OnInit, OnDestroy { if (queryParams == null) { queryParams = { favorites: this.favorites ? true : null, - type: this.type, + type: this.activeFilter.cipherType, folderId: this.folderId, collectionId: this.collectionId, deleted: this.deleted ? true : null, From 57b647bde52fc5f43551b570c9bcd3773b7e0a00 Mon Sep 17 00:00:00 2001 From: Robyn MacCallum Date: Mon, 23 May 2022 19:41:21 -0400 Subject: [PATCH 03/22] Fix 'Link SSO' not appearing (#1702) --- src/app/modules/loose-components.module.ts | 3 --- .../vault-filter/components}/link-sso.component.html | 0 .../vault-filter/components}/link-sso.component.ts | 0 src/app/modules/vault-filter/vault-filter.module.ts | 2 ++ 4 files changed, 2 insertions(+), 3 deletions(-) rename src/app/{settings => modules/vault-filter/components}/link-sso.component.html (100%) rename src/app/{settings => modules/vault-filter/components}/link-sso.component.ts (100%) diff --git a/src/app/modules/loose-components.module.ts b/src/app/modules/loose-components.module.ts index 9dc1a0d0..8f01eb40 100644 --- a/src/app/modules/loose-components.module.ts +++ b/src/app/modules/loose-components.module.ts @@ -114,7 +114,6 @@ import { EmergencyAccessTakeoverComponent } from "../settings/emergency-access-t import { EmergencyAccessViewComponent } from "../settings/emergency-access-view.component"; import { EmergencyAccessComponent } from "../settings/emergency-access.component"; import { EmergencyAddEditComponent } from "../settings/emergency-add-edit.component"; -import { LinkSsoComponent } from "../settings/link-sso.component"; import { OrganizationPlansComponent } from "../settings/organization-plans.component"; import { PaymentMethodComponent } from "../settings/payment-method.component"; import { PaymentComponent } from "../settings/payment.component"; @@ -223,7 +222,6 @@ import { OrganizationBadgeModule } from "./vault/modules/organization-badge/orga HintComponent, ImportComponent, InactiveTwoFactorReportComponent, - LinkSsoComponent, LockComponent, LoginComponent, MasterPasswordPolicyComponent, @@ -383,7 +381,6 @@ import { OrganizationBadgeModule } from "./vault/modules/organization-badge/orga HintComponent, ImportComponent, InactiveTwoFactorReportComponent, - LinkSsoComponent, LockComponent, LoginComponent, MasterPasswordPolicyComponent, diff --git a/src/app/settings/link-sso.component.html b/src/app/modules/vault-filter/components/link-sso.component.html similarity index 100% rename from src/app/settings/link-sso.component.html rename to src/app/modules/vault-filter/components/link-sso.component.html diff --git a/src/app/settings/link-sso.component.ts b/src/app/modules/vault-filter/components/link-sso.component.ts similarity index 100% rename from src/app/settings/link-sso.component.ts rename to src/app/modules/vault-filter/components/link-sso.component.ts diff --git a/src/app/modules/vault-filter/vault-filter.module.ts b/src/app/modules/vault-filter/vault-filter.module.ts index 07daba9b..bf7cb3d5 100644 --- a/src/app/modules/vault-filter/vault-filter.module.ts +++ b/src/app/modules/vault-filter/vault-filter.module.ts @@ -12,6 +12,7 @@ import { SharedModule } from "../shared.module"; import { CollectionFilterComponent } from "./components/collection-filter.component"; import { FolderFilterComponent } from "./components/folder-filter.component"; +import { LinkSsoComponent } from "./components/link-sso.component"; import { OrganizationFilterComponent } from "./components/organization-filter.component"; import { OrganizationOptionsComponent } from "./components/organization-options.component"; import { StatusFilterComponent } from "./components/status-filter.component"; @@ -28,6 +29,7 @@ import { VaultFilterComponent } from "./vault-filter.component"; OrganizationOptionsComponent, StatusFilterComponent, TypeFilterComponent, + LinkSsoComponent, ], exports: [VaultFilterComponent], providers: [ From 8ef27713f14a07cfcd628341c3b1aa09b35ccbda Mon Sep 17 00:00:00 2001 From: Robyn MacCallum Date: Wed, 25 May 2022 10:18:00 -0400 Subject: [PATCH 04/22] [SG-345] Switch in-line "+" add org button to more explicit version (#1703) * switch in-line plus add org button to more explicit version * Add spaces to line up text better --- .../organization-filter.component.html | 35 +++++++++---------- src/scss/vault-filters.scss | 8 ----- 2 files changed, 17 insertions(+), 26 deletions(-) diff --git a/src/app/modules/vault-filter/components/organization-filter.component.html b/src/app/modules/vault-filter/components/organization-filter.component.html index e45db370..0c4bf90e 100644 --- a/src/app/modules/vault-filter/components/organization-filter.component.html +++ b/src/app/modules/vault-filter/components/organization-filter.component.html @@ -14,7 +14,7 @@ - {{ "newOrganization" | i18n }} +  {{ "newOrganization" | i18n }} @@ -45,14 +45,6 @@ >  {{ organizationGrouping.name | i18n }} - - - @@ -110,15 +110,6 @@ >  {{ organizationGrouping.name | i18n }} - - - diff --git a/src/scss/vault-filters.scss b/src/scss/vault-filters.scss index 292eff57..301497ea 100644 --- a/src/scss/vault-filters.scss +++ b/src/scss/vault-filters.scss @@ -14,14 +14,6 @@ font-size: $font-size-base; } - a.create-organization-link { - &:hover { - @include themify($themes) { - color: themed("iconHover") !important; - } - } - } - button { @extend .no-btn; } From 42cd1716854c4705abc2d8246ca650dda3f6cc35 Mon Sep 17 00:00:00 2001 From: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com> Date: Wed, 25 May 2022 15:10:13 -0500 Subject: [PATCH 05/22] Swap to heading tags on presented headings (#1707) --- src/app/accounts/register.component.html | 2 +- src/app/send/access.component.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/accounts/register.component.html b/src/app/accounts/register.component.html index d86e0a43..970c2c13 100644 --- a/src/app/accounts/register.component.html +++ b/src/app/accounts/register.component.html @@ -101,7 +101,7 @@
-

{{ "createAccount" | i18n }}

+

{{ "createAccount" | i18n }}

-

Bitwarden Send

+

Bitwarden Send

{{ "sendCreatorIdentifier" | i18n: creatorIdentifier }}

From eefcda7e419537e528dceebfebe33790ba2fba8d Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Thu, 26 May 2022 07:00:59 +1000 Subject: [PATCH 06/22] [EC-177] Update Key Connector error message (#1705) * Update Key Connector error message * Update jslib --- jslib | 2 +- src/locales/en/messages.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jslib b/jslib index 3cb94623..a6fe5c79 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 3cb94623e2c6a3ac6cf6dbcd516ba23b03a7aee7 +Subproject commit a6fe5c79002370d7ac8e52f2ff16154b853b7974 diff --git a/src/locales/en/messages.json b/src/locales/en/messages.json index bb37b09b..1b62eec2 100644 --- a/src/locales/en/messages.json +++ b/src/locales/en/messages.json @@ -4674,8 +4674,8 @@ "removeSponsorshipSuccess": { "message": "Sponsorship Removed" }, - "ssoKeyConnectorUnavailable": { - "message": "Unable to reach the Key Connector, try again later." + "ssoKeyConnectorError": { + "message": "Key Connector error: make sure Key Connector is available and working correctly." }, "keyConnectorUrl": { "message": "Key Connector URL" From f195aee90c49f0d6f122e1bee23af4b3e2389146 Mon Sep 17 00:00:00 2001 From: Gbubemi Smith Date: Thu, 26 May 2022 10:05:36 +0100 Subject: [PATCH 07/22] Revert "[ps-136] Igonre accented characters in vault search (#1690)" (#1706) This reverts commit 58d9ac5ebcba8651dcf63cc71ffc59dd1ad2c624. --- src/app/modules/vault-filter/vault-filter.component.ts | 2 +- src/app/settings/billing-sync-key.component.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/modules/vault-filter/vault-filter.component.ts b/src/app/modules/vault-filter/vault-filter.component.ts index 56b72172..4442e0ab 100644 --- a/src/app/modules/vault-filter/vault-filter.component.ts +++ b/src/app/modules/vault-filter/vault-filter.component.ts @@ -25,7 +25,7 @@ export class VaultFilterComponent extends BaseVaultFilterComponent { } searchTextChanged() { - this.onSearchTextChanged.emit(this.searchText.normalize("NFD").replace(/[\u0300-\u036f]/g, "")); + this.onSearchTextChanged.emit(this.searchText); } async initCollections() { diff --git a/src/app/settings/billing-sync-key.component.ts b/src/app/settings/billing-sync-key.component.ts index 929d8aaf..9b80037c 100644 --- a/src/app/settings/billing-sync-key.component.ts +++ b/src/app/settings/billing-sync-key.component.ts @@ -3,6 +3,7 @@ import { Component } from "@angular/core"; import { ApiService } from "jslib-common/abstractions/api.service"; import { LogService } from "jslib-common/abstractions/log.service"; import { OrganizationConnectionType } from "jslib-common/enums/organizationConnectionType"; +import { Utils } from "jslib-common/misc/utils"; import { BillingSyncConfigApi } from "jslib-common/models/api/billingSyncConfigApi"; import { BillingSyncConfigRequest } from "jslib-common/models/request/billingSyncConfigRequest"; import { OrganizationConnectionRequest } from "jslib-common/models/request/organizationConnectionRequest"; From b98b39128363baf5da7eb891ce27d060438081ee Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Fri, 27 May 2022 13:11:41 +1000 Subject: [PATCH 08/22] Update jslib (#1710) --- jslib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jslib b/jslib index a6fe5c79..77ca5762 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit a6fe5c79002370d7ac8e52f2ff16154b853b7974 +Subproject commit 77ca5762e10d1892ee09186bccec2f3a025977f6 From dfb03a53c088b4be34997229fb5005e4a095a925 Mon Sep 17 00:00:00 2001 From: Gbubemi Smith Date: Fri, 27 May 2022 17:28:16 +0100 Subject: [PATCH 09/22] sync jslib master (#1711) --- jslib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jslib b/jslib index 77ca5762..1ea2824c 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 77ca5762e10d1892ee09186bccec2f3a025977f6 +Subproject commit 1ea2824c24aeb7188046d3cc4313b3550c90bb07 From bde9a28f2b1af4cc182733b6fe0e7fc821066918 Mon Sep 17 00:00:00 2001 From: Gbubemi Smith Date: Mon, 30 May 2022 10:56:14 +0100 Subject: [PATCH 10/22] sync jslib master (#1712) --- jslib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jslib b/jslib index 1ea2824c..0d658ba2 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 1ea2824c24aeb7188046d3cc4313b3550c90bb07 +Subproject commit 0d658ba26dfb539f15e33f396e597e6727070bc2 From 5d09ddbc8d9e14c9db93202276abe281e925a080 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 31 May 2022 15:41:37 -0700 Subject: [PATCH 11/22] Bumped version to 2022.05.0 (#1715) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1106cb2e..8e689363 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@bitwarden/web-vault", - "version": "2.28.1", + "version": "2022.05.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@bitwarden/web-vault", - "version": "2.28.1", + "version": "2022.05.0", "hasInstallScript": true, "license": "GPL-3.0", "dependencies": { diff --git a/package.json b/package.json index 29da7318..9fe29fcd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bitwarden/web-vault", - "version": "2.28.1", + "version": "2022.05.0", "license": "GPL-3.0", "repository": "https://github.com/bitwarden/web", "scripts": { From b8aa25b9818473a0fe152365ee05bc7d663e5c1a Mon Sep 17 00:00:00 2001 From: Joseph Flinn <58369717+joseph-flinn@users.noreply.github.com> Date: Tue, 31 May 2022 16:11:26 -0700 Subject: [PATCH 12/22] Updating the version check to the new Github action (#1714) * Updating the version check to the new Github action * Update .github/workflows/release.yml Co-authored-by: Micaiah Martin <77340197+mimartin12@users.noreply.github.com> * switching action branch tag to commit tag Co-authored-by: Micaiah Martin <77340197+mimartin12@users.noreply.github.com> --- .github/workflows/release.yml | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 97b43a21..fb788f14 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,20 +38,11 @@ jobs: - name: Check Release Version id: version - run: | - version=$( jq -r ".version" package.json) - previous_release_tag_version=$( - curl -sL https://api.github.com/repos/$GITHUB_REPOSITORY/releases/latest | jq -r ".tag_name" - ) - - if [ "v$version" == "$previous_release_tag_version" ] && \ - [ "${{ github.event.inputs.release_type }}" == "Initial Release" ]; then - echo "[!] Already released v$version. Please bump version to continue" - exit 1 - fi - - echo "::set-output name=package::$version" - echo "::set-output name=tag::v$version" + uses: bitwarden/gh-actions@ea9fab01d76940267b4147cc1c4542431246b9f6 + with: + release-type: ${{ github.event.inputs.release_type }} + project-type: ts + file: package.json - name: Get branch name id: branch From 8fe9504cd13227cdedf35efdc247a4c29c8f7ee5 Mon Sep 17 00:00:00 2001 From: Joseph Flinn <58369717+joseph-flinn@users.noreply.github.com> Date: Tue, 31 May 2022 17:48:59 -0700 Subject: [PATCH 13/22] Updating the path for the Release Version Check (#1716) --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fb788f14..7dc7ec91 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,7 +38,7 @@ jobs: - name: Check Release Version id: version - uses: bitwarden/gh-actions@ea9fab01d76940267b4147cc1c4542431246b9f6 + uses: bitwarden/gh-actions/release-version-check@ea9fab01d76940267b4147cc1c4542431246b9f6 with: release-type: ${{ github.event.inputs.release_type }} project-type: ts From ad0512e344d24ab4232a6a3d3fd88f904f99003b Mon Sep 17 00:00:00 2001 From: Joseph Flinn <58369717+joseph-flinn@users.noreply.github.com> Date: Tue, 31 May 2022 18:08:32 -0700 Subject: [PATCH 14/22] Version check typo (#1717) * fixing dumb issue * Fixing another dumb mistake --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7dc7ec91..af81eb73 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,8 +19,8 @@ jobs: name: Setup runs-on: ubuntu-20.04 outputs: - release_version: ${{ steps.version.outputs.package }} - tag_version: ${{ steps.version.outputs.tag }} + release_version: ${{ steps.version.outputs.version }} + tag_version: ${{ steps.version.outputs.version }} branch_name: ${{ steps.branch.outputs.branch_name }} steps: - name: Branch check From 95d177da38309faf0fa30332ffbbac24cdce21be Mon Sep 17 00:00:00 2001 From: Daniel James Smith Date: Wed, 1 Jun 2022 14:46:48 +0200 Subject: [PATCH 15/22] Fix expanding/collapsing of nested collections (#1722) --- .../vault-filter/components/collection-filter.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/modules/vault-filter/components/collection-filter.component.html b/src/app/modules/vault-filter/components/collection-filter.component.html index 436cda99..24463dca 100644 --- a/src/app/modules/vault-filter/components/collection-filter.component.html +++ b/src/app/modules/vault-filter/components/collection-filter.component.html @@ -31,7 +31,7 @@ +
+ + + +
+
diff --git a/src/app/modules/organizations/users/enroll-master-password-reset.component.ts b/src/app/modules/organizations/users/enroll-master-password-reset.component.ts new file mode 100644 index 00000000..b996493d --- /dev/null +++ b/src/app/modules/organizations/users/enroll-master-password-reset.component.ts @@ -0,0 +1,97 @@ +import { Component } from "@angular/core"; + +import { ModalRef } from "jslib-angular/components/modal/modal.ref"; +import { ModalConfig } from "jslib-angular/services/modal.service"; +import { ApiService } from "jslib-common/abstractions/api.service"; +import { CryptoService } from "jslib-common/abstractions/crypto.service"; +import { I18nService } from "jslib-common/abstractions/i18n.service"; +import { LogService } from "jslib-common/abstractions/log.service"; +import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service"; +import { SyncService } from "jslib-common/abstractions/sync.service"; +import { UserVerificationService } from "jslib-common/abstractions/userVerification.service"; +import { Utils } from "jslib-common/misc/utils"; +import { Organization } from "jslib-common/models/domain/organization"; +import { OrganizationUserResetPasswordEnrollmentRequest } from "jslib-common/models/request/organizationUserResetPasswordEnrollmentRequest"; +import { Verification } from "jslib-common/types/verification"; + +@Component({ + selector: "app-enroll-master-password-reset", + templateUrl: "enroll-master-password-reset.component.html", +}) +export class EnrollMasterPasswordReset { + organization: Organization; + + verification: Verification; + formPromise: Promise; + + constructor( + private userVerificationService: UserVerificationService, + private apiService: ApiService, + private platformUtilsService: PlatformUtilsService, + private i18nService: I18nService, + private cryptoService: CryptoService, + private syncService: SyncService, + private logService: LogService, + private modalRef: ModalRef, + config: ModalConfig + ) { + this.organization = config.data.organization; + } + + async submit() { + let toastStringRef = "withdrawPasswordResetSuccess"; + + this.formPromise = this.userVerificationService + .buildRequest(this.verification, OrganizationUserResetPasswordEnrollmentRequest) + .then(async (request) => { + // Set variables + let keyString: string = null; + + // Enrolling + if (!this.organization.resetPasswordEnrolled) { + // Retrieve Public Key + const orgKeys = await this.apiService.getOrganizationKeys(this.organization.id); + if (orgKeys == null) { + throw new Error(this.i18nService.t("resetPasswordOrgKeysError")); + } + + const publicKey = Utils.fromB64ToArray(orgKeys.publicKey); + + // RSA Encrypt user's encKey.key with organization public key + const encKey = await this.cryptoService.getEncKey(); + const encryptedKey = await this.cryptoService.rsaEncrypt(encKey.key, publicKey.buffer); + keyString = encryptedKey.encryptedString; + toastStringRef = "enrollPasswordResetSuccess"; + + // Create request and execute enrollment + request.resetPasswordKey = keyString; + await this.apiService.putOrganizationUserResetPasswordEnrollment( + this.organization.id, + this.organization.userId, + request + ); + } else { + // Withdrawal + request.resetPasswordKey = keyString; + await this.apiService.putOrganizationUserResetPasswordEnrollment( + this.organization.id, + this.organization.userId, + request + ); + } + + await this.syncService.fullSync(true); + }); + try { + await this.formPromise; + this.platformUtilsService.showToast("success", null, this.i18nService.t(toastStringRef)); + this.modalRef.close(); + } catch (e) { + this.logService.error(e); + } + } + + get isEnrolled(): boolean { + return this.organization.resetPasswordEnrolled; + } +} diff --git a/src/app/modules/organizations/users/organization-user.module.ts b/src/app/modules/organizations/users/organization-user.module.ts new file mode 100644 index 00000000..aed0ac66 --- /dev/null +++ b/src/app/modules/organizations/users/organization-user.module.ts @@ -0,0 +1,14 @@ +import { ScrollingModule } from "@angular/cdk/scrolling"; +import { NgModule } from "@angular/core"; + +import { LooseComponentsModule } from "../../loose-components.module"; +import { SharedModule } from "../../shared.module"; + +import { EnrollMasterPasswordReset } from "./enroll-master-password-reset.component"; + +@NgModule({ + imports: [SharedModule, ScrollingModule, LooseComponentsModule], + declarations: [EnrollMasterPasswordReset], + exports: [EnrollMasterPasswordReset], +}) +export class OrganizationUserModule {} diff --git a/src/app/modules/vault-filter/components/organization-options.component.ts b/src/app/modules/vault-filter/components/organization-options.component.ts index 3e025611..fb256acd 100644 --- a/src/app/modules/vault-filter/components/organization-options.component.ts +++ b/src/app/modules/vault-filter/components/organization-options.component.ts @@ -1,17 +1,17 @@ import { Component, Input } from "@angular/core"; +import { ModalService } from "jslib-angular/services/modal.service"; import { ApiService } from "jslib-common/abstractions/api.service"; -import { CryptoService } from "jslib-common/abstractions/crypto.service"; import { I18nService } from "jslib-common/abstractions/i18n.service"; import { LogService } from "jslib-common/abstractions/log.service"; import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service"; import { PolicyService } from "jslib-common/abstractions/policy.service"; import { SyncService } from "jslib-common/abstractions/sync.service"; import { PolicyType } from "jslib-common/enums/policyType"; -import { Utils } from "jslib-common/misc/utils"; import { Organization } from "jslib-common/models/domain/organization"; import { Policy } from "jslib-common/models/domain/policy"; -import { OrganizationUserResetPasswordEnrollmentRequest } from "jslib-common/models/request/organizationUserResetPasswordEnrollmentRequest"; + +import { EnrollMasterPasswordReset } from "../../organizations/users/enroll-master-password-reset.component"; @Component({ selector: "app-organization-options", @@ -29,8 +29,8 @@ export class OrganizationOptionsComponent { private i18nService: I18nService, private apiService: ApiService, private syncService: SyncService, - private cryptoService: CryptoService, private policyService: PolicyService, + private modalService: ModalService, private logService: LogService ) {} @@ -113,70 +113,11 @@ export class OrganizationOptionsComponent { } async toggleResetPasswordEnrollment(org: Organization) { - // Set variables - let keyString: string = null; - let toastStringRef = "withdrawPasswordResetSuccess"; - - // Enrolling - if (!org.resetPasswordEnrolled) { - // Alert user about enrollment - const confirmed = await this.platformUtilsService.showDialog( - this.i18nService.t("resetPasswordEnrollmentWarning"), - null, - this.i18nService.t("yes"), - this.i18nService.t("no"), - "warning" - ); - if (!confirmed) { - return; - } - - // Retrieve Public Key - this.actionPromise = this.apiService - .getOrganizationKeys(org.id) - .then(async (response) => { - if (response == null) { - throw new Error(this.i18nService.t("resetPasswordOrgKeysError")); - } - - const publicKey = Utils.fromB64ToArray(response.publicKey); - - // RSA Encrypt user's encKey.key with organization public key - const encKey = await this.cryptoService.getEncKey(); - const encryptedKey = await this.cryptoService.rsaEncrypt(encKey.key, publicKey.buffer); - keyString = encryptedKey.encryptedString; - toastStringRef = "enrollPasswordResetSuccess"; - - // Create request and execute enrollment - const request = new OrganizationUserResetPasswordEnrollmentRequest(); - request.resetPasswordKey = keyString; - return this.apiService.putOrganizationUserResetPasswordEnrollment( - org.id, - org.userId, - request - ); - }) - .then(() => { - return this.syncService.fullSync(true); - }); - } else { - // Withdrawal - const request = new OrganizationUserResetPasswordEnrollmentRequest(); - request.resetPasswordKey = keyString; - this.actionPromise = this.apiService - .putOrganizationUserResetPasswordEnrollment(org.id, org.userId, request) - .then(() => { - return this.syncService.fullSync(true); - }); - } - - try { - await this.actionPromise; - this.platformUtilsService.showToast("success", null, this.i18nService.t(toastStringRef)); - await this.load(); - } catch (e) { - this.platformUtilsService.showToast("error", this.i18nService.t("errorOccurred"), e.message); - this.logService.error(e); - } + this.modalService.open(EnrollMasterPasswordReset, { + allowMultipleModals: true, + data: { + organization: org, + }, + }); } } diff --git a/src/app/oss.module.ts b/src/app/oss.module.ts index 88311f9d..cd4d3d9d 100644 --- a/src/app/oss.module.ts +++ b/src/app/oss.module.ts @@ -2,6 +2,7 @@ import { NgModule } from "@angular/core"; import { LooseComponentsModule } from "./modules/loose-components.module"; import { OrganizationManageModule } from "./modules/organizations/manage/organization-manage.module"; +import { OrganizationUserModule } from "./modules/organizations/users/organization-user.module"; import { PipesModule } from "./modules/pipes/pipes.module"; import { SharedModule } from "./modules/shared.module"; import { VaultFilterModule } from "./modules/vault-filter/vault-filter.module"; @@ -15,6 +16,7 @@ import { OrganizationBadgeModule } from "./modules/vault/modules/organization-ba OrganizationBadgeModule, PipesModule, OrganizationManageModule, + OrganizationUserModule, ], exports: [LooseComponentsModule, VaultFilterModule, OrganizationBadgeModule, PipesModule], bootstrap: [], diff --git a/src/locales/en/messages.json b/src/locales/en/messages.json index 1b62eec2..6cd0bbd0 100644 --- a/src/locales/en/messages.json +++ b/src/locales/en/messages.json @@ -4163,7 +4163,7 @@ "message": "Password reset success!" }, "resetPasswordEnrollmentWarning": { - "message": "Enrollment will allow organization administrators to change your master password. Are you sure you want to enroll?" + "message": "Enrollment will allow organization administrators to change your master password" }, "resetPasswordPolicy": { "message": "Master Password Reset" From d7dd2435fccde346551f0eb5d35ed3843577d48b Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Thu, 2 Jun 2022 07:20:07 +1000 Subject: [PATCH 18/22] Fix Manage SSO permissions (#1709) --- .../src/app/organizations/organizations-routing.module.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bitwarden_license/src/app/organizations/organizations-routing.module.ts b/bitwarden_license/src/app/organizations/organizations-routing.module.ts index c300da14..691feda3 100644 --- a/bitwarden_license/src/app/organizations/organizations-routing.module.ts +++ b/bitwarden_license/src/app/organizations/organizations-routing.module.ts @@ -22,14 +22,16 @@ const routes: Routes = [ component: ManageComponent, canActivate: [PermissionsGuard], data: { - permissions: NavigationPermissionsService.getPermissions("manage").concat( - Permissions.ManageSso - ), + permissions: NavigationPermissionsService.getPermissions("manage"), }, children: [ { path: "sso", component: SsoComponent, + canActivate: [PermissionsGuard], + data: { + permissions: [Permissions.ManageSso], + }, }, ], }, From 52406bc9690f72e744a24e37e4cbb847ed3ee99a Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 1 Jun 2022 20:33:06 -0400 Subject: [PATCH 19/22] Allow firefox relay service in generator (#1723) * Allow firefox relay service in generator * Update generator.component.ts * Update generator.component.ts * make pretty --- src/app/tools/generator.component.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/app/tools/generator.component.ts b/src/app/tools/generator.component.ts index 5917c8ee..ad825ba5 100644 --- a/src/app/tools/generator.component.ts +++ b/src/app/tools/generator.component.ts @@ -40,11 +40,13 @@ export class GeneratorComponent extends BaseGeneratorComponent { route, window ); - // Cannot use Firefox Relay on the web vault yet due to CORS issues with Firefox Relay API - this.forwardOptions.splice( - this.forwardOptions.findIndex((o) => o.value === "firefoxrelay"), - 1 - ); + if (platformUtilsService.isSelfHost()) { + // Cannot use Firefox Relay on self hosted web vaults due to CORS issues with Firefox Relay API + this.forwardOptions.splice( + this.forwardOptions.findIndex((o) => o.value === "firefoxrelay"), + 1 + ); + } } async history() { From b6b72989808f042552afc9c5187984dbc2ab94e2 Mon Sep 17 00:00:00 2001 From: dwbit <98768076+dwbit@users.noreply.github.com> Date: Thu, 2 Jun 2022 05:23:48 -0400 Subject: [PATCH 20/22] Adding missing code for Serbian Latin (#1713) --- crowdin.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/crowdin.yml b/crowdin.yml index e99016fc..821f35d2 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -15,3 +15,4 @@ files: en-GB: en_GB en-IN: en_IN sr-CY: sr_CY + sr-CS: sr_CS From fb35805202733e984dec04f8daf503141ec2a5c7 Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Thu, 2 Jun 2022 11:34:27 +0200 Subject: [PATCH 21/22] [CL-38] Follow Angular styleguide naming convention (#1655) --- jslib | 2 +- .../organization-switcher.component.html | 4 ++-- src/app/components/premium-badge.component.ts | 2 +- src/app/layouts/navbar.component.html | 10 ++++----- ...nroll-master-password-reset.component.html | 4 ++-- .../organization-name-badge.component.html | 2 +- src/app/reports/breach-report.component.html | 8 +------ .../exposed-passwords-report.component.html | 2 +- src/app/reports/report-card.component.html | 2 +- src/app/reports/reports.component.html | 2 +- src/app/send/send.component.html | 16 +++++--------- src/app/settings/account.component.html | 6 ++--- src/app/settings/change-kdf.component.html | 2 +- .../settings/change-password.component.html | 2 +- .../settings/payment-method.component.html | 6 ++--- src/app/settings/premium.component.html | 12 +++------- src/app/settings/security-keys.component.html | 4 ++-- .../settings/two-factor-setup.component.html | 4 ++-- .../user-billing-history.component.html | 2 +- .../settings/user-subscription.component.html | 16 +++++++------- src/app/vault/ciphers.component.html | 22 +++++++++---------- 21 files changed, 57 insertions(+), 73 deletions(-) diff --git a/jslib b/jslib index 0d658ba2..2b647df0 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 0d658ba26dfb539f15e33f396e597e6727070bc2 +Subproject commit 2b647df001f6bdfbeb6f272a0b7b56396ac9564d diff --git a/src/app/components/organization-switcher.component.html b/src/app/components/organization-switcher.component.html index 7975fd9e..221985a6 100644 --- a/src/app/components/organization-switcher.component.html +++ b/src/app/components/organization-switcher.component.html @@ -46,7 +46,7 @@
  • - +
  • - + {{ "newOrganization" | i18n }} diff --git a/src/app/components/premium-badge.component.ts b/src/app/components/premium-badge.component.ts index 86a88d51..0628621f 100644 --- a/src/app/components/premium-badge.component.ts +++ b/src/app/components/premium-badge.component.ts @@ -5,7 +5,7 @@ import { MessagingService } from "jslib-common/abstractions/messaging.service"; @Component({ selector: "app-premium-badge", template: ` - `, diff --git a/src/app/layouts/navbar.component.html b/src/app/layouts/navbar.component.html index 9bbd8d2e..edc5d34d 100644 --- a/src/app/layouts/navbar.component.html +++ b/src/app/layouts/navbar.component.html @@ -65,24 +65,24 @@
- + {{ "accountSettings" | i18n }} - + {{ "getHelp" | i18n }} - + {{ "getApps" | i18n }} - - diff --git a/src/app/modules/organizations/users/enroll-master-password-reset.component.html b/src/app/modules/organizations/users/enroll-master-password-reset.component.html index e1e389ca..c8d15a39 100644 --- a/src/app/modules/organizations/users/enroll-master-password-reset.component.html +++ b/src/app/modules/organizations/users/enroll-master-password-reset.component.html @@ -32,7 +32,7 @@
- diff --git a/src/app/reports/exposed-passwords-report.component.html b/src/app/reports/exposed-passwords-report.component.html index 496cd108..f0a882f7 100644 --- a/src/app/reports/exposed-passwords-report.component.html +++ b/src/app/reports/exposed-passwords-report.component.html @@ -3,7 +3,7 @@

{{ "exposedPasswordsReportDesc" | i18n }}

@@ -38,7 +38,7 @@
  • - - - - - diff --git a/src/app/settings/change-kdf.component.html b/src/app/settings/change-kdf.component.html index e3899586..f5eae39b 100644 --- a/src/app/settings/change-kdf.component.html +++ b/src/app/settings/change-kdf.component.html @@ -71,7 +71,7 @@ - diff --git a/src/app/settings/change-password.component.html b/src/app/settings/change-password.component.html index f8a4dd4c..990d9506 100644 --- a/src/app/settings/change-password.component.html +++ b/src/app/settings/change-password.component.html @@ -87,7 +87,7 @@ - diff --git a/src/app/settings/payment-method.component.html b/src/app/settings/payment-method.component.html index aca7b115..bae22bf4 100644 --- a/src/app/settings/payment-method.component.html +++ b/src/app/settings/payment-method.component.html @@ -3,7 +3,7 @@ {{ "paymentMethod" | i18n }} - diff --git a/src/app/settings/security-keys.component.html b/src/app/settings/security-keys.component.html index 9c9b8df5..58201014 100644 --- a/src/app/settings/security-keys.component.html +++ b/src/app/settings/security-keys.component.html @@ -8,10 +8,10 @@

    {{ "userApiKeyDesc" | i18n }}

    - - diff --git a/src/app/settings/two-factor-setup.component.html b/src/app/settings/two-factor-setup.component.html index 549636f8..27fc2990 100644 --- a/src/app/settings/two-factor-setup.component.html +++ b/src/app/settings/two-factor-setup.component.html @@ -5,7 +5,7 @@

    {{ "twoStepLoginOrganizationDesc" | i18n }}

    {{ "twoStepLoginRecoveryWarning" | i18n }}

    -
    @@ -45,7 +45,7 @@
    -
    - - - - - -