From e287715251880641f79f68e5e187fe29bbaca22f Mon Sep 17 00:00:00 2001 From: CarleyDiaz-Bitwarden <103955722+CarleyDiaz-Bitwarden@users.noreply.github.com> Date: Wed, 3 Aug 2022 14:20:15 -0400 Subject: [PATCH] merging master into feature branch --- .eslintignore | 1 + .github/workflows/build-browser.yml | 4 +- .github/workflows/build-cli.yml | 2 +- .github/workflows/build-desktop.yml | 134 +- .github/workflows/build-web.yml | 2 +- .github/workflows/release-browser.yml | 36 +- .github/workflows/release-cli.yml | 38 +- .github/workflows/release-desktop-beta.yml | 155 +- .github/workflows/release-desktop.yml | 35 +- .github/workflows/release-qa-web.yml | 35 + .github/workflows/release-web.yml | 46 +- .github/workflows/version-auto-bump.yml | 68 + .gitignore | 1 + .prettierignore | 1 + .storybook/tsconfig.json | 9 +- angular.json | 129 +- apps/browser/src/_locales/eu/messages.json | 56 +- apps/browser/src/_locales/pl/messages.json | 2 +- .../browser/src/background/main.background.ts | 2 +- apps/browser/src/browser/browserApi.ts | 2 +- apps/browser/src/notification/bar.scss | 2 +- .../popup/accounts/environment.component.html | 4 +- .../src/popup/accounts/hint.component.html | 4 +- .../src/popup/accounts/home.component.html | 14 +- .../src/popup/accounts/lock.component.html | 3 +- .../src/popup/accounts/login.component.html | 7 +- .../popup/accounts/register.component.html | 33 +- .../src/popup/accounts/register.component.ts | 7 +- .../accounts/set-password.component.html | 32 +- .../popup/accounts/set-password.component.ts | 30 - .../two-factor-options.component.html | 2 +- .../popup/accounts/two-factor.component.html | 3 +- .../update-temp-password.component.html | 30 +- .../update-temp-password.component.ts | 36 - apps/browser/src/popup/app.module.ts | 1 - .../password-reprompt.component.html | 3 +- .../popup/components/set-pin.component.html | 3 +- .../popup/generator/generator.component.html | 6 +- .../password-generator-history.component.html | 4 +- apps/browser/src/popup/polyfills.ts | 1 - apps/browser/src/popup/scss/pages.scss | 2 +- apps/browser/src/popup/scss/popup.scss | 2 +- .../popup/send/send-add-edit.component.html | 6 +- .../popup/send/send-groupings.component.html | 3 - .../src/popup/send/send-type.component.html | 3 +- .../settings/excluded-domains.component.html | 7 +- .../settings/excluded-domains.component.ts | 37 +- .../src/popup/settings/export.component.html | 6 +- .../src/popup/settings/export.component.ts | 4 +- .../settings/folder-add-edit.component.html | 5 +- .../src/popup/settings/folders.component.html | 11 +- .../src/popup/settings/options.component.html | 4 +- .../src/popup/settings/premium.component.html | 9 +- .../popup/settings/settings.component.html | 48 +- .../src/popup/settings/settings.component.ts | 4 +- .../src/popup/settings/sync.component.html | 4 +- apps/browser/src/popup/tabs.component.html | 5 + .../add-edit-custom-fields.component.html | 1 - .../src/popup/vault/add-edit.component.html | 14 +- .../popup/vault/attachments.component.html | 7 +- .../src/popup/vault/ciphers.component.html | 6 +- .../popup/vault/collections.component.html | 4 +- .../popup/vault/current-tab.component.html | 3 +- .../vault/password-history.component.html | 2 +- .../src/popup/vault/share.component.html | 3 +- .../popup/vault/vault-filter.component.html | 16 +- .../popup/vault/vault-select.component.html | 2 +- .../src/popup/vault/view.component.html | 17 +- .../services/browserFileDownloadService.ts | 4 +- apps/browser/store/locales/eu/copy.resx | 2 +- apps/browser/webpack.config.js | 17 +- apps/cli/package-lock.json | 254 +- apps/cli/src/bw.ts | 2 +- apps/cli/src/commands/download.command.ts | 5 +- .../services/nodeEnvSecureStorage.service.ts | 7 +- apps/desktop/desktop_native/.cargo/config | 8 + apps/desktop/desktop_native/Cargo.toml | 2 + apps/desktop/desktop_native/build.js | 2 +- apps/desktop/desktop_native/index.d.ts | 4 + apps/desktop/desktop_native/index.js | 91 +- apps/desktop/desktop_native/package-lock.json | 41 - apps/desktop/desktop_native/package.json | 7 +- .../desktop_native/src/biometric/macos.rs | 9 + .../desktop_native/src/biometric/mod.rs | 5 + .../desktop_native/src/biometric/unix.rs | 9 + .../desktop_native/src/biometric/windows.rs | 51 + apps/desktop/desktop_native/src/lib.rs | 19 + apps/desktop/electron-builder.json | 7 +- .../accessibility-cookie.component.ts | 6 +- .../accounts/delete-account.component.html | 38 + .../app/accounts/delete-account.component.ts | 48 + .../src/app/accounts/register.component.html | 27 +- .../src/app/accounts/register.component.ts | 4 +- .../app/accounts/set-password.component.html | 28 +- .../app/accounts/set-password.component.ts | 30 - .../src/app/accounts/settings.component.html | 8 + .../src/app/accounts/settings.component.ts | 10 +- .../update-temp-password.component.html | 26 +- .../update-temp-password.component.ts | 35 - apps/desktop/src/app/app.component.ts | 30 +- apps/desktop/src/app/app.module.ts | 2 + .../src/app/components/set-pin.component.html | 2 +- .../layout/account-switcher.component.html | 2 +- .../src/app/layout/search/search.component.ts | 4 +- .../collection-filter.component.html | 37 +- .../components/folder-filter.component.html | 37 +- .../organization-filter.component.html | 40 +- .../components/type-filter.component.html | 43 +- apps/desktop/src/app/send/send.component.html | 13 +- .../desktop/src/app/vault/export.component.ts | 4 +- apps/desktop/src/locales/en/messages.json | 17 +- apps/desktop/src/locales/uk/messages.json | 2 +- .../main/biometric/biometric.darwin.main.ts | 2 - .../src/main/biometric/biometric.main.ts | 1 - .../main/biometric/biometric.windows.main.ts | 123 +- .../main/desktopCredentialStorageListener.ts | 29 +- apps/desktop/src/main/menu/menu.account.ts | 15 + apps/desktop/src/package-lock.json | 1288 +- apps/desktop/src/package.json | 4 +- apps/desktop/src/scss/base.scss | 6 + apps/desktop/src/scss/box.scss | 4 + apps/desktop/src/scss/environment.scss | 15 - apps/desktop/src/scss/left-nav.scss | 13 +- apps/desktop/src/scss/misc.scss | 19 + apps/desktop/src/scss/pages.scss | 31 - apps/desktop/src/scss/styles.scss | 2 +- apps/desktop/webpack.main.js | 5 +- apps/desktop/webpack.renderer.js | 14 +- apps/web/.eslintrc.json | 8 + apps/web/package.json | 2 +- apps/web/src/abstractions/state.service.ts | 9 - apps/web/src/app/accounts/lock.component.ts | 2 +- apps/web/src/app/accounts/login.component.ts | 3 +- .../src/app/accounts/register.component.ts | 6 +- .../app/accounts/set-password.component.html | 8 +- .../src/app/accounts/two-factor.component.ts | 2 +- .../accounts/update-password.component.html | 4 +- .../update-temp-password.component.html | 7 +- apps/web/src/app/app.component.ts | 5 +- apps/web/src/app/app.module.ts | 4 +- .../src/app/common/base.events.component.ts | 2 +- .../src/app/common/base.people.component.ts | 32 +- .../organization-switcher.component.html | 10 +- .../components/password-strength.component.ts | 40 - .../core/broadcaster-messaging.service.ts} | 0 .../core.module.ts} | 57 +- .../app/{services => core}/event.service.ts | 12 +- .../core/html-storage.service.ts} | 0 .../{services => app/core}/i18n.service.ts | 0 apps/web/src/app/core/index.ts | 5 + .../app/{services => core}/init.service.ts | 4 +- .../app/{services => core}/modal.service.ts | 0 .../core/password-reprompt.service.ts} | 2 +- .../{services => core}/policy-list.service.ts | 0 .../app/{services => core}/router.service.ts | 0 .../core/state-migration.service.ts} | 4 +- .../src/{models => app/core/state}/account.ts | 0 .../core/state/global-state.ts} | 0 apps/web/src/app/core/state/index.ts | 3 + .../core/state}/state.service.ts | 45 +- .../web-file-download.service.ts} | 0 .../core/web-platform-utils.service.ts} | 0 apps/web/src/app/guards/home.guard.ts | 4 +- .../web/src/app/layouts/navbar.component.html | 6 +- .../app/modules/loose-components.module.ts | 6 +- .../organization-information.component.ts | 4 +- .../register-form.component.html | 19 +- .../register-form/register-form.component.ts | 6 +- apps/web/src/app/modules/shared.module.ts | 4 +- .../trial-initiation/billing.component.html | 10 +- .../trial-initiation/billing.component.ts | 8 +- .../enterprise-content.component.html | 2 +- .../families-content.component.html | 2 +- .../teams-content.component.html | 2 +- .../trial-initiation.component.html | 18 +- .../trial-initiation.component.ts | 18 +- .../organization-filter.component.html | 12 +- .../organization-options.component.html | 13 +- .../vertical-step-content.component.html | 18 +- .../vertical-step.component.html | 2 +- .../vertical-stepper.component.html | 4 +- .../organizations/guards/permissions.guard.ts | 4 +- ...tml => bulk-restore-revoke.component.html} | 2 +- ...nt.ts => bulk-restore-revoke.component.ts} | 20 +- .../manage/entity-events.component.ts | 2 +- .../organizations/manage/events.component.ts | 2 +- .../manage/people.component.html | 20 +- .../organizations/manage/people.component.ts | 28 +- .../manage/policies.component.ts | 2 +- .../manage/reset-password.component.html | 3 +- .../manage/reset-password.component.ts | 38 +- .../manage/user-add-edit.component.html | 10 +- .../manage/user-add-edit.component.ts | 24 +- .../policies/base-policy.component.ts | 6 +- .../policies/master-password.component.ts | 4 +- .../policies/password-generator.component.ts | 4 +- .../policies/reset-password.component.ts | 7 +- .../policies/send-options.component.ts | 4 +- .../import-export/org-export.component.ts | 13 +- apps/web/src/app/oss-routing.module.ts | 8 +- .../app/reports/report-card.component.html | 6 +- apps/web/src/app/send/access.component.ts | 5 +- .../settings/change-password.component.html | 8 +- .../settings/delete-account.component.html | 3 +- .../app/settings/delete-account.component.ts | 23 +- .../emergency-access-takeover.component.html | 8 +- .../settings/organization-plans.component.ts | 6 +- .../src/app/settings/preferences.component.ts | 4 +- .../src/app/settings/settings.component.ts | 2 +- .../settings/sponsored-families.component.ts | 6 +- .../tools/import-export/export.component.ts | 4 +- apps/web/src/locales/af/messages.json | 3 + apps/web/src/locales/ar/messages.json | 3 + apps/web/src/locales/az/messages.json | 3 + apps/web/src/locales/be/messages.json | 3 + apps/web/src/locales/bg/messages.json | 3 + apps/web/src/locales/bn/messages.json | 3 + apps/web/src/locales/bs/messages.json | 3 + apps/web/src/locales/ca/messages.json | 3 + apps/web/src/locales/cs/messages.json | 3 + apps/web/src/locales/da/messages.json | 3 + apps/web/src/locales/de/messages.json | 3 + apps/web/src/locales/el/messages.json | 3 + apps/web/src/locales/en/messages.json | 5 +- apps/web/src/locales/en_GB/messages.json | 3 + apps/web/src/locales/en_IN/messages.json | 3 + apps/web/src/locales/eo/messages.json | 99 +- apps/web/src/locales/es/messages.json | 3 + apps/web/src/locales/et/messages.json | 3 + apps/web/src/locales/eu/messages.json | 633 +- apps/web/src/locales/fi/messages.json | 3 + apps/web/src/locales/fil/messages.json | 3 + apps/web/src/locales/fr/messages.json | 3 + apps/web/src/locales/he/messages.json | 3 + apps/web/src/locales/hi/messages.json | 3 + apps/web/src/locales/hr/messages.json | 3 + apps/web/src/locales/hu/messages.json | 3 + apps/web/src/locales/id/messages.json | 3 + apps/web/src/locales/it/messages.json | 3 + apps/web/src/locales/ja/messages.json | 3 + apps/web/src/locales/ka/messages.json | 3 + apps/web/src/locales/km/messages.json | 3 + apps/web/src/locales/kn/messages.json | 3 + apps/web/src/locales/ko/messages.json | 3 + apps/web/src/locales/lv/messages.json | 3 + apps/web/src/locales/ml/messages.json | 3 + apps/web/src/locales/nb/messages.json | 3 + apps/web/src/locales/nl/messages.json | 3 + apps/web/src/locales/nn/messages.json | 3 + apps/web/src/locales/pl/messages.json | 7 +- apps/web/src/locales/pt_BR/messages.json | 3 + apps/web/src/locales/pt_PT/messages.json | 3 + apps/web/src/locales/ro/messages.json | 3 + apps/web/src/locales/ru/messages.json | 7 +- apps/web/src/locales/si/messages.json | 3 + apps/web/src/locales/sk/messages.json | 31 +- apps/web/src/locales/sl/messages.json | 3 + apps/web/src/locales/sr/messages.json | 3 + apps/web/src/locales/sr_CS/messages.json | 3 + apps/web/src/locales/sv/messages.json | 9 +- apps/web/src/locales/tr/messages.json | 3 + apps/web/src/locales/uk/messages.json | 3 + apps/web/src/locales/vi/messages.json | 3 + apps/web/src/locales/zh_CN/messages.json | 15 +- apps/web/src/locales/zh_TW/messages.json | 7 +- apps/web/src/{app => }/main.ts | 6 +- apps/web/src/{app => }/polyfills.ts | 0 apps/web/src/scss/base.scss | 3 +- apps/web/src/scss/vault-filters.scss | 8 + apps/web/tsconfig.json | 14 +- apps/web/webpack.config.js | 29 +- .../bit-web/src/app/app.module.ts | 4 +- .../components/base-cva.component.ts | 4 +- .../organizations/manage/scim.component.ts | 4 +- .../app/organizations/manage/sso.component.ts | 12 +- .../maximum-vault-timeout.component.ts | 4 +- .../providers/clients/clients.component.html | 15 + .../app/providers/manage/events.component.ts | 2 +- .../app/providers/manage/people.component.ts | 4 +- .../src/app/sm/layout/layout.component.html | 4 +- .../bit-web/src/app/sm/sm-routing.module.ts | 1 + .../bit-web/src/{app => }/main.ts | 2 +- bitwarden_license/bit-web/webpack.config.js | 2 +- libs/angular/jest.config.js | 1 - .../src/components/attachments.component.ts | 9 +- .../components/change-password.component.ts | 46 +- .../src/components/export.component.ts | 4 +- .../src/components/register.component.ts | 83 +- .../components/send/efflux-dates.component.ts | 52 +- .../settings/vault-timeout-input.component.ts | 4 +- .../components/user-verification.component.ts | 7 +- libs/angular/src/components/view.component.ts | 5 +- libs/angular/src/jslib.module.ts | 3 + .../src/services/jslib-services.module.ts | 19 + libs/angular/src/services/modal.service.ts | 20 +- .../password-strength.component.html | 0 .../password-strength.component.ts | 133 + .../validators/inputsFieldMatch.validator.ts | 4 +- libs/common/jest.config.js | 1 - .../common/spec/domain/encArrayBuffer.spec.ts | 76 + .../spec/matchers/toEqualBuffer.spec.ts | 25 + libs/common/spec/matchers/toEqualBuffer.ts | 34 + .../spec/services/cipher.service.spec.ts | 3 +- .../spec/services/crypto.service.spec.ts | 38 + .../spec/services/encrypt.service.spec.ts | 163 + .../spec/services/folder.service.spec.ts | 23 +- libs/common/spec/test.setup.ts | 22 + libs/common/spec/utils.ts | 4 +- .../abstractions/abstractEncrypt.service.ts | 10 +- .../account-api.service.abstraction.ts | 5 + .../account/account.service.abstraction.ts | 5 + libs/common/src/abstractions/api.service.ts | 11 +- .../common/src/abstractions/crypto.service.ts | 2 +- libs/common/src/abstractions/event.service.ts | 7 +- libs/common/src/enums/eventType.ts | 6 +- .../src/enums/organizationUserStatusType.ts | 2 +- .../src/enums/providerUserStatusType.ts | 2 +- libs/common/src/interfaces/IEncrypted.ts | 8 + libs/common/src/models/data/eventData.ts | 1 + .../src/models/domain/encArrayBuffer.ts | 74 +- libs/common/src/models/domain/encString.ts | 16 +- .../common/src/models/request/eventRequest.ts | 1 + .../response/organizationExportResponse.ts | 15 + .../provider/providerOrganizationResponse.ts | 6 + .../services/account/account-api.service.ts | 11 + .../src/services/account/account.service.ts | 27 + libs/common/src/services/api.service.ts | 32 +- libs/common/src/services/cipher.service.ts | 4 +- libs/common/src/services/container.service.ts | 5 - libs/common/src/services/crypto.service.ts | 146 +- libs/common/src/services/encrypt.service.ts | 78 +- libs/common/src/services/event.service.ts | 10 +- libs/common/src/services/export.service.ts | 59 +- .../services/formValidationErrors.service.ts | 4 +- .../services/passwordGeneration.service.ts | 1 + libs/common/src/services/state.service.ts | 8 +- libs/components/jest.config.js | 1 - .../src/banner/banner.component.html | 6 +- .../src/callout/callout.component.html | 2 +- .../src/form-field/error-summary.component.ts | 8 +- .../src/form-field/error-summary.stories.ts | 4 +- .../src/form-field/form-field.component.html | 2 +- .../src/form-field/form-field.stories.ts | 4 +- libs/components/src/index.ts | 1 + .../src/menu/menu-divider.component.html | 2 +- libs/components/src/menu/menu.component.html | 2 +- libs/components/src/modal/index.ts | 3 + .../src/modal/modal-simple.component.html | 19 + .../src/modal/modal-simple.component.ts | 16 + .../src/modal/modal-simple.stories.ts | 85 + .../components/src/modal/modal.component.html | 25 + libs/components/src/modal/modal.component.ts | 23 + libs/components/src/modal/modal.module.ts | 12 + libs/components/src/modal/modal.stories.ts | 80 + .../components/src/stories/colors.stories.mdx | 2 +- libs/components/src/table/cell.directive.ts | 10 + libs/components/src/table/index.ts | 1 + libs/components/src/table/row.directive.ts | 17 + .../components/src/table/table.component.html | 10 + libs/components/src/table/table.component.ts | 7 + libs/components/src/table/table.module.ts | 13 + libs/components/src/table/table.stories.ts | 53 + .../src/tabs/tab-group.component.html | 2 +- .../components/src/tabs/tab-item.component.ts | 12 +- .../src/toggle-group/toggle.component.ts | 2 +- .../services/electronPlatformUtils.service.ts | 11 +- .../electronRendererSecureStorage.service.ts | 14 +- package-lock.json | 31600 +++++++--------- package.json | 68 +- tailwind.config.js | 11 + tsconfig.json | 6 +- 371 files changed, 16725 insertions(+), 22348 deletions(-) create mode 100644 .github/workflows/version-auto-bump.yml create mode 100644 apps/desktop/desktop_native/.cargo/config delete mode 100644 apps/desktop/desktop_native/package-lock.json create mode 100644 apps/desktop/desktop_native/src/biometric/macos.rs create mode 100644 apps/desktop/desktop_native/src/biometric/mod.rs create mode 100644 apps/desktop/desktop_native/src/biometric/unix.rs create mode 100644 apps/desktop/desktop_native/src/biometric/windows.rs create mode 100644 apps/desktop/src/app/accounts/delete-account.component.html create mode 100644 apps/desktop/src/app/accounts/delete-account.component.ts delete mode 100644 apps/web/src/abstractions/state.service.ts delete mode 100644 apps/web/src/app/components/password-strength.component.ts rename apps/web/src/{services/broadcasterMessaging.service.ts => app/core/broadcaster-messaging.service.ts} (100%) rename apps/web/src/app/{services/services.module.ts => core/core.module.ts} (74%) rename apps/web/src/app/{services => core}/event.service.ts (98%) rename apps/web/src/{services/htmlStorage.service.ts => app/core/html-storage.service.ts} (100%) rename apps/web/src/{services => app/core}/i18n.service.ts (100%) create mode 100644 apps/web/src/app/core/index.ts rename apps/web/src/app/{services => core}/init.service.ts (95%) rename apps/web/src/app/{services => core}/modal.service.ts (100%) rename apps/web/src/{services/passwordReprompt.service.ts => app/core/password-reprompt.service.ts} (77%) rename apps/web/src/app/{services => core}/policy-list.service.ts (100%) rename apps/web/src/app/{services => core}/router.service.ts (100%) rename apps/web/src/{services/stateMigration.service.ts => app/core/state-migration.service.ts} (85%) rename apps/web/src/{models => app/core/state}/account.ts (100%) rename apps/web/src/{models/globalState.ts => app/core/state/global-state.ts} (100%) create mode 100644 apps/web/src/app/core/state/index.ts rename apps/web/src/{services => app/core/state}/state.service.ts (72%) rename apps/web/src/app/{services/webFileDownload.service.ts => core/web-file-download.service.ts} (100%) rename apps/web/src/{services/webPlatformUtils.service.ts => app/core/web-platform-utils.service.ts} (100%) rename apps/web/src/app/organizations/manage/bulk/{bulk-deactivate.component.html => bulk-restore-revoke.component.html} (99%) rename apps/web/src/app/organizations/manage/bulk/{bulk-deactivate.component.ts => bulk-restore-revoke.component.ts} (70%) rename apps/web/src/{app => }/main.ts (75%) rename apps/web/src/{app => }/polyfills.ts (100%) rename bitwarden_license/bit-web/src/{app => }/main.ts (89%) rename {apps/web/src/app/components => libs/angular/src/shared/components/password-strength}/password-strength.component.html (100%) create mode 100644 libs/angular/src/shared/components/password-strength/password-strength.component.ts create mode 100644 libs/common/spec/domain/encArrayBuffer.spec.ts create mode 100644 libs/common/spec/matchers/toEqualBuffer.spec.ts create mode 100644 libs/common/spec/matchers/toEqualBuffer.ts create mode 100644 libs/common/spec/services/crypto.service.spec.ts create mode 100644 libs/common/spec/services/encrypt.service.spec.ts create mode 100644 libs/common/src/abstractions/account/account-api.service.abstraction.ts create mode 100644 libs/common/src/abstractions/account/account.service.abstraction.ts create mode 100644 libs/common/src/interfaces/IEncrypted.ts create mode 100644 libs/common/src/models/response/organizationExportResponse.ts create mode 100644 libs/common/src/services/account/account-api.service.ts create mode 100644 libs/common/src/services/account/account.service.ts create mode 100644 libs/components/src/modal/index.ts create mode 100644 libs/components/src/modal/modal-simple.component.html create mode 100644 libs/components/src/modal/modal-simple.component.ts create mode 100644 libs/components/src/modal/modal-simple.stories.ts create mode 100644 libs/components/src/modal/modal.component.html create mode 100644 libs/components/src/modal/modal.component.ts create mode 100644 libs/components/src/modal/modal.module.ts create mode 100644 libs/components/src/modal/modal.stories.ts create mode 100644 libs/components/src/table/cell.directive.ts create mode 100644 libs/components/src/table/index.ts create mode 100644 libs/components/src/table/row.directive.ts create mode 100644 libs/components/src/table/table.component.html create mode 100644 libs/components/src/table/table.component.ts create mode 100644 libs/components/src/table/table.module.ts create mode 100644 libs/components/src/table/table.stories.ts create mode 100644 tailwind.config.js diff --git a/.eslintignore b/.eslintignore index 1a4673e357f..4e2b3a58fd6 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,5 +1,6 @@ **/build **/dist +.angular **/node_modules diff --git a/.github/workflows/build-browser.yml b/.github/workflows/build-browser.yml index aae03489235..a1229db88a5 100644 --- a/.github/workflows/build-browser.yml +++ b/.github/workflows/build-browser.yml @@ -16,7 +16,7 @@ on: branches: - 'master' - 'rc' - - 'hotfix-rc/**' + - 'hotfix-rc' paths: - 'apps/browser/**' - 'libs/**' @@ -347,7 +347,7 @@ jobs: trigger-desktop-build: name: Trigger desktop build - if: ${{ (github.ref == 'refs/heads/master') || (github.ref == 'refs/heads/rc') || contains(github.ref, 'hotfix-rc') }} + if: ${{ (github.ref == 'refs/heads/master') || (github.ref == 'refs/heads/rc') || github.ref != 'refs/heads/hotfix-rc' }} runs-on: ubuntu-20.04 needs: - build diff --git a/.github/workflows/build-cli.yml b/.github/workflows/build-cli.yml index ee56ed5be4d..7a355f997a3 100644 --- a/.github/workflows/build-cli.yml +++ b/.github/workflows/build-cli.yml @@ -17,7 +17,7 @@ on: branches: - 'master' - 'rc' - - 'hotfix-rc/**' + - 'hotfix-rc' paths: - 'apps/cli/**' - 'libs/**' diff --git a/.github/workflows/build-desktop.yml b/.github/workflows/build-desktop.yml index ee571b2592a..78a7c5f79da 100644 --- a/.github/workflows/build-desktop.yml +++ b/.github/workflows/build-desktop.yml @@ -159,7 +159,7 @@ jobs: - name: Set up environment run: | sudo apt-get update - sudo apt-get -y install pkg-config libxss-dev libsecret-1-dev rpm + sudo apt-get -y install pkg-config libxss-dev libsecret-1-dev rpm musl-dev musl-tools - name: Set up Snap run: sudo snap install snapcraft --classic @@ -175,6 +175,27 @@ jobs: run: npm ci working-directory: ./ + - name: Cache Native Module + uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09 # v3.0.2 + id: cache + with: + path: | + apps/desktop/desktop_native/*.node + ${{ env.RUNNER_TEMP }}/.cargo/registry + ${{ env.RUNNER_TEMP }}/.cargo/git + key: rust-${{ runner.os }}-${{ hashFiles('apps/desktop/desktop_native/**/*') }} + + - name: Build Native Module + if: steps.cache.outputs.cache-hit != 'true' + working-directory: apps/desktop/desktop_native + env: + PKG_CONFIG_ALLOW_CROSS: true + PKG_CONFIG_ALL_STATIC: true + TARGET: musl + run: | + rustup target add x86_64-unknown-linux-musl + npm run build:cross-platform + - name: Build application run: npm run dist:lin @@ -256,11 +277,18 @@ jobs: - name: Set up environment run: choco install checksum --no-progress + - name: Rust + shell: pwsh + run: | + rustup target install i686-pc-windows-msvc + rustup target install aarch64-pc-windows-msvc + - name: Print environment run: | node --version npm --version choco --version + rustup show - name: Login to Azure uses: Azure/login@1f63701bf3e6892515f1b7ce2d2bf1708b46beaf @@ -282,6 +310,19 @@ jobs: run: npm ci working-directory: ./ + - name: Cache Native Module + uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09 # v3.0.2 + id: cache + with: + path: apps/desktop/desktop_native/*.node + key: rust-${{ runner.os }}-${{ hashFiles('apps/desktop/desktop_native/**/*') }} + + - name: Build Native Module + if: steps.cache.outputs.cache-hit != 'true' + working-directory: apps/desktop/desktop_native + run: | + npm run build:cross-platform + - name: Build & Sign (dev) env: ELECTRON_BUILDER_SIGN: 1 @@ -443,10 +484,15 @@ jobs: npm install -g node-gyp node-gyp install $(node -v) + - name: Rust + shell: pwsh + run: rustup target install aarch64-apple-darwin + - name: Print environment run: | node --version npm --version + rustup show echo "GitHub ref: $GITHUB_REF" echo "GitHub event: $GITHUB_EVENT" @@ -536,6 +582,19 @@ jobs: run: npm ci working-directory: ./ + - name: Cache Native Module + uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09 # v3.0.2 + id: cache + with: + path: apps/desktop/desktop_native/*.node + key: rust-${{ runner.os }}-${{ hashFiles('apps/desktop/desktop_native/**/*') }} + + - name: Build Native Module + if: steps.cache.outputs.cache-hit != 'true' + working-directory: apps/desktop/desktop_native + run: | + npm run build:cross-platform + - name: Build application (dev) run: npm run build @@ -570,10 +629,15 @@ jobs: npm install -g node-gyp node-gyp install $(node -v) + - name: Rust + shell: pwsh + run: rustup target install aarch64-apple-darwin + - name: Print environment run: | node --version npm --version + rustup show echo "GitHub ref: $GITHUB_REF" echo "GitHub event: $GITHUB_EVENT" @@ -663,23 +727,30 @@ jobs: run: npm ci working-directory: ./ + - name: Cache Native Module + uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09 # v3.0.2 + id: cache + with: + path: apps/desktop/desktop_native/*.node + key: rust-${{ runner.os }}-${{ hashFiles('apps/desktop/desktop_native/**/*') }} + + - name: Build Native Module + if: steps.cache.outputs.cache-hit != 'true' + working-directory: apps/desktop/desktop_native + run: | + npm run build:cross-platform + - name: Build if: steps.build-cache.outputs.cache-hit != 'true' run: npm run build - - name: Extract branch name - if: contains(github.ref, 'hotfix-rc') - id: extract_branch - shell: bash - run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - - name: Download artifact from hotfix-rc - if: contains(github.ref, 'hotfix-rc') + if: github.ref == 'refs/heads/hotfix-rc' uses: dawidd6/action-download-artifact@b2abf1705491048a2d7074f7d90513044fd25d39 # v2.19.0 with: workflow: build-browser.yml workflow_conclusion: success - branch: ${{ steps.extract_branch.outputs.branch }} + branch: hotfix-rc path: ${{ github.workspace }}/browser-build-artifacts - name: Download artifact from rc @@ -692,7 +763,7 @@ jobs: path: ${{ github.workspace }}/browser-build-artifacts - name: Download artifact from master - if: ${{ github.ref != 'refs/heads/rc' && !contains(github.ref, 'hotfix-rc') }} + if: ${{ github.ref != 'refs/heads/rc' && github.ref != 'refs/heads/hotfix-rc' }} uses: dawidd6/action-download-artifact@b2abf1705491048a2d7074f7d90513044fd25d39 # v2.19.0 with: workflow: build-browser.yml @@ -776,10 +847,15 @@ jobs: npm install -g node-gyp node-gyp install $(node -v) + - name: Rust + shell: pwsh + run: rustup target install aarch64-apple-darwin + - name: Print environment run: | node --version npm --version + rustup show echo "GitHub ref: $GITHUB_REF" echo "GitHub event: $GITHUB_EVENT" @@ -869,23 +945,30 @@ jobs: run: npm ci working-directory: ./ + - name: Cache Native Module + uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09 # v3.0.2 + id: cache + with: + path: apps/desktop/desktop_native/*.node + key: rust-${{ runner.os }}-${{ hashFiles('apps/desktop/desktop_native/**/*') }} + + - name: Build Native Module + if: steps.cache.outputs.cache-hit != 'true' + working-directory: apps/desktop/desktop_native + run: | + npm run build:cross-platform + - name: Build if: steps.build-cache.outputs.cache-hit != 'true' run: npm run build - - name: Extract branch name - if: contains(github.ref, 'hotfix-rc') - id: extract_branch - shell: bash - run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - - name: Download artifact from hotfix-rc - if: contains(github.ref, 'hotfix-rc') + if: github.ref == 'refs/heads/hotfix-rc' uses: dawidd6/action-download-artifact@b2abf1705491048a2d7074f7d90513044fd25d39 # v2.19.0 with: workflow: build-browser.yml workflow_conclusion: success - branch: ${{ steps.extract_branch.outputs.branch }} + branch: hotfix-rc path: ${{ github.workspace }}/browser-build-artifacts - name: Download artifact from rc @@ -898,7 +981,7 @@ jobs: path: ${{ github.workspace }}/browser-build-artifacts - name: Download artifact from master - if: ${{ github.ref != 'refs/heads/rc' && !contains(github.ref, 'hotfix-rc') }} + if: ${{ github.ref != 'refs/heads/rc' && github.ref != 'refs/heads/hotfix-rc' }} uses: dawidd6/action-download-artifact@b2abf1705491048a2d7074f7d90513044fd25d39 # v2.19.0 with: workflow: build-browser.yml @@ -1067,6 +1150,19 @@ jobs: run: npm ci working-directory: ./ + - name: Cache Native Module + uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09 # v3.0.2 + id: cache + with: + path: apps/desktop/desktop_native/*.node + key: rust-${{ runner.os }}-${{ hashFiles('apps/desktop/desktop_native/**/*') }} + + - name: Build Native Module + if: steps.cache.outputs.cache-hit != 'true' + working-directory: apps/desktop/desktop_native + run: | + npm run build:cross-platform + - name: Build if: steps.build-cache.outputs.cache-hit != 'true' run: npm run build diff --git a/.github/workflows/build-web.yml b/.github/workflows/build-web.yml index 6f3ffb1257c..26144ff9c9e 100644 --- a/.github/workflows/build-web.yml +++ b/.github/workflows/build-web.yml @@ -17,7 +17,7 @@ on: branches: - 'master' - 'rc' - - 'hotfix-rc/**' + - 'hotfix-rc' paths: - 'apps/web/**' - 'libs/**' diff --git a/.github/workflows/release-browser.yml b/.github/workflows/release-browser.yml index da8780599c9..4cb10afb9d3 100644 --- a/.github/workflows/release-browser.yml +++ b/.github/workflows/release-browser.yml @@ -31,9 +31,9 @@ jobs: - name: Branch check if: ${{ github.event.inputs.release_type != 'Dry Run' }} run: | - if [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ $GITHUB_REF != refs/heads/hotfix-rc/* ]]; then + if [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ $GITHUB_REF != refs/heads/hotfix-rc ]]; then echo "===================================" - echo "[!] Can only release from the 'rc' or 'hotfix-rc/*' branches" + echo "[!] Can only release from the 'rc' or 'hotfix-rc' branches" echo "===================================" exit 1 fi @@ -90,6 +90,22 @@ jobs: - setup - locales-test steps: + - name: Create GitHub deployment + uses: chrnorm/deployment-action@1b599fe41a0ef1f95191e7f2eec4743f2d7dfc48 + id: deployment + with: + token: '${{ secrets.GITHUB_TOKEN }}' + environment: 'Browser - Production' + description: 'Deployment ${{ needs.setup.outputs.release-version }} from branch ${{ github.ref_name }}' + task: release + + - name: Update deployment status to In Progress + uses: chrnorm/deployment-status@07b3930847f65e71c9c6802ff5a402f6dfb46b86 + with: + token: '${{ secrets.GITHUB_TOKEN }}' + state: 'in_progress' + deployment-id: ${{ steps.deployment.outputs.deployment_id }} + - name: Download latest Release build artifacts if: ${{ github.event.inputs.release_type != 'Dry Run' }} uses: bitwarden/gh-actions/download-artifacts@c1fa8e09871a860862d6bbe36184b06d2c7e35a8 @@ -141,3 +157,19 @@ jobs: body: "" token: ${{ secrets.GITHUB_TOKEN }} draft: true + + - name: Update deployment status to Success + if: success() + uses: chrnorm/deployment-status@07b3930847f65e71c9c6802ff5a402f6dfb46b86 + with: + token: '${{ secrets.GITHUB_TOKEN }}' + state: 'success' + deployment-id: ${{ steps.deployment.outputs.deployment_id }} + + - name: Update deployment status to Failure + if: failure() + uses: chrnorm/deployment-status@07b3930847f65e71c9c6802ff5a402f6dfb46b86 + with: + token: '${{ secrets.GITHUB_TOKEN }}' + state: 'failure' + deployment-id: ${{ steps.deployment.outputs.deployment_id }} diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index 31b5f058c8f..0ce438d0d42 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -47,9 +47,9 @@ jobs: - name: Branch check if: ${{ github.event.inputs.release_type != 'Dry Run' }} run: | - if [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ $GITHUB_REF != refs/heads/hotfix-rc/* ]]; then + if [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ $GITHUB_REF != refs/heads/hotfix-rc ]]; then echo "===================================" - echo "[!] Can only release from the 'rc' or 'hotfix-rc/*' branches" + echo "[!] Can only release from the 'rc' or 'hotfix-rc' branches" echo "===================================" exit 1 fi @@ -64,6 +64,22 @@ jobs: monorepo: true monorepo-project: cli + - name: Create GitHub deployment for Snap + uses: chrnorm/deployment-action@1b599fe41a0ef1f95191e7f2eec4743f2d7dfc48 + id: deployment + with: + token: '${{ secrets.GITHUB_TOKEN }}' + environment: 'CLI - Production' + description: 'Deployment ${{ steps.version.outputs.version }} from branch ${{ github.ref_name }}' + task: release + + - name: Update deployment status to In Progress + uses: chrnorm/deployment-status@07b3930847f65e71c9c6802ff5a402f6dfb46b86 + with: + token: '${{ secrets.GITHUB_TOKEN }}' + state: 'in_progress' + deployment-id: ${{ steps.deployment.outputs.deployment_id }} + - name: Download all Release artifacts if: ${{ github.event.inputs.release_type != 'Dry Run' }} uses: bitwarden/gh-actions/download-artifacts@c1fa8e09871a860862d6bbe36184b06d2c7e35a8 @@ -104,6 +120,21 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} draft: true + - name: Update deployment status to Success + if: success() + uses: chrnorm/deployment-status@07b3930847f65e71c9c6802ff5a402f6dfb46b86 + with: + token: '${{ secrets.GITHUB_TOKEN }}' + state: 'success' + deployment-id: ${{ steps.deployment.outputs.deployment_id }} + + - name: Update deployment status to Failure + if: failure() + uses: chrnorm/deployment-status@07b3930847f65e71c9c6802ff5a402f6dfb46b86 + with: + token: '${{ secrets.GITHUB_TOKEN }}' + state: 'failure' + deployment-id: ${{ steps.deployment.outputs.deployment_id }} snap: name: Deploy Snap @@ -159,7 +190,6 @@ jobs: snapcraft push bw_${{ env._PKG_VERSION }}_amd64.snap --release stable snapcraft logout - choco: name: Deploy Choco runs-on: windows-2019 @@ -219,7 +249,6 @@ jobs: cd dist choco push - npm: name: Publish NPM runs-on: ubuntu-20.04 @@ -274,3 +303,4 @@ jobs: - name: Publish NPM if: ${{ github.event.inputs.release_type != 'Dry Run' }} run: npm publish --access public + diff --git a/.github/workflows/release-desktop-beta.yml b/.github/workflows/release-desktop-beta.yml index b898955709b..832178af0c0 100644 --- a/.github/workflows/release-desktop-beta.yml +++ b/.github/workflows/release-desktop-beta.yml @@ -19,18 +19,19 @@ jobs: outputs: release-version: ${{ steps.version.outputs.version }} release-channel: ${{ steps.release-channel.outputs.channel }} + branch-name: ${{ steps.branch.outputs.branch-name }} steps: - name: Checkout repo uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 - # - name: Branch check - # run: | - # if [[ "$GITHUB_REF" != "refs/heads/master" ]] && [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ $GITHUB_REF != refs/heads/hotfix-rc/* ]]; then - # echo "===================================" - # echo "[!] Can only release from the 'master', 'rc' or 'hotfix-rc/*' branches" - # echo "===================================" - # exit 1 - # fi + - name: Branch check + run: | + if [[ "$GITHUB_REF" != "refs/heads/master" ]] && [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ $GITHUB_REF != "refs/heads/hotfix-rc" ]]; then + echo "===================================" + echo "[!] Can only release from the 'master', 'rc' or 'hotfix-rc' branches" + echo "===================================" + exit 1 + fi - name: Bump Desktop Version - Root env: @@ -70,18 +71,45 @@ jobs: ;; esac + - name: Setup git config + run: | + git config --global user.name "GitHub Action Bot" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --global url."https://github.com/".insteadOf ssh://git@github.com/ + git config --global url."https://".insteadOf ssh:// + + - name: Create desktop-beta-release branch + id: branch + env: + VERSION: ${{ github.event.inputs.version_number }} + run: | + find="." + replace="_" + ver=${VERSION//$find/$replace} + branch_name=desktop-beta-release-$ver-beta + + git switch -c $branch_name + git add . + git commit -m "Bump desktop version to $VERSION-beta" + + git push -u origin $branch_name + + echo "::set-output name=branch-name::$branch_name" + linux: name: Linux Build runs-on: ubuntu-20.04 needs: setup env: - _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} + _PACKAGE_VERSION: ${{ needs.setup.outputs.release-version }} defaults: run: working-directory: apps/desktop steps: - name: Checkout repo uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 + with: + ref: ${{ needs.setup.outputs.branch-name }} - name: Set up Node uses: actions/setup-node@9ced9a43a244f3ac94f13bfd896db8c8f30da67a # v3.0.0 @@ -158,8 +186,8 @@ jobs: - name: Upload auto-update artifact uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 with: - name: ${{ needs.setup.outputs.release_channel }}-linux.yml - path: apps/desktop/dist/${{ needs.setup.outputs.release_channel }}-linux.yml + name: ${{ needs.setup.outputs.release-channel }}-linux.yml + path: apps/desktop/dist/${{ needs.setup.outputs.release-channel }}-linux.yml if-no-files-found: error @@ -172,10 +200,12 @@ jobs: shell: pwsh working-directory: apps/desktop env: - _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} + _PACKAGE_VERSION: ${{ needs.setup.outputs.release-version }} steps: - name: Checkout repo uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 + with: + ref: ${{ needs.setup.outputs.branch-name }} - name: Set up Node uses: actions/setup-node@9ced9a43a244f3ac94f13bfd896db8c8f30da67a # v3.0.0 @@ -352,8 +382,8 @@ jobs: - name: Upload auto-update artifact uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 with: - name: ${{ needs.setup.outputs.release_channel }}.yml - path: apps/desktop/dist/nsis-web/${{ needs.setup.outputs.release_channel }}.yml + name: ${{ needs.setup.outputs.release-channel }}.yml + path: apps/desktop/dist/nsis-web/${{ needs.setup.outputs.release-channel }}.yml if-no-files-found: error @@ -362,13 +392,15 @@ jobs: runs-on: macos-11 needs: setup env: - _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} + _PACKAGE_VERSION: ${{ needs.setup.outputs.release-version }} defaults: run: working-directory: apps/desktop steps: - name: Checkout repo uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 + with: + ref: ${{ needs.setup.outputs.branch-name }} - name: Set up Node uses: actions/setup-node@9ced9a43a244f3ac94f13bfd896db8c8f30da67a # v3.0.0 @@ -489,13 +521,15 @@ jobs: - setup - macos-build env: - _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} + _PACKAGE_VERSION: ${{ needs.setup.outputs.release-version }} defaults: run: working-directory: apps/desktop steps: - name: Checkout repo uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 + with: + ref: ${{ needs.setup.outputs.branch-name }} - name: Set up Node uses: actions/setup-node@9ced9a43a244f3ac94f13bfd896db8c8f30da67a # v3.0.0 @@ -609,19 +643,13 @@ jobs: if: steps.build-cache.outputs.cache-hit != 'true' run: npm run build - - name: Extract branch name - if: contains(github.ref, 'hotfix-rc') - id: extract_branch - shell: bash - run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - - name: Download artifact from hotfix-rc - if: contains(github.ref, 'hotfix-rc') + if: github.ref == 'refs/heads/hotfix-rc') uses: dawidd6/action-download-artifact@b2abf1705491048a2d7074f7d90513044fd25d39 # v2.19.0 with: workflow: build-browser.yml workflow_conclusion: success - branch: ${{ steps.extract_branch.outputs.branch }} + branch: hotfix-rc path: ${{ github.workspace }}/browser-build-artifacts - name: Download artifact from rc @@ -634,7 +662,7 @@ jobs: path: ${{ github.workspace }}/browser-build-artifacts - name: Download artifact from master - if: ${{ github.ref != 'refs/heads/rc' && !contains(github.ref, 'hotfix-rc') }} + if: ${{ github.ref != 'refs/heads/rc' && github.ref != 'refs/heads/hotfix-rc' }} uses: dawidd6/action-download-artifact@b2abf1705491048a2d7074f7d90513044fd25d39 # v2.19.0 with: workflow: build-browser.yml @@ -683,8 +711,8 @@ jobs: - name: Upload auto-update artifact uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 with: - name: ${{ needs.setup.outputs.release_channel }}-mac.yml - path: apps/desktop/dist/${{ needs.setup.outputs.release_channel }}-mac.yml + name: ${{ needs.setup.outputs.release-channel }}-mac.yml + path: apps/desktop/dist/${{ needs.setup.outputs.release-channel }}-mac.yml if-no-files-found: error @@ -695,13 +723,15 @@ jobs: - setup - macos-build env: - _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} + _PACKAGE_VERSION: ${{ needs.setup.outputs.release-version }} defaults: run: working-directory: apps/desktop steps: - name: Checkout repo uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 + with: + ref: ${{ needs.setup.outputs.branch-name }} - name: Set up Node uses: actions/setup-node@9ced9a43a244f3ac94f13bfd896db8c8f30da67a # v3.0.0 @@ -815,19 +845,13 @@ jobs: if: steps.build-cache.outputs.cache-hit != 'true' run: npm run build - - name: Extract branch name - if: contains(github.ref, 'hotfix-rc') - id: extract_branch - shell: bash - run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - - name: Download artifact from hotfix-rc - if: contains(github.ref, 'hotfix-rc') + if: github.ref == 'refs/heads/hotfix-rc') uses: dawidd6/action-download-artifact@b2abf1705491048a2d7074f7d90513044fd25d39 # v2.19.0 with: workflow: build-browser.yml workflow_conclusion: success - branch: ${{ steps.extract_branch.outputs.branch }} + branch: hotfix-rc path: ${{ github.workspace }}/browser-build-artifacts - name: Download artifact from rc @@ -840,7 +864,7 @@ jobs: path: ${{ github.workspace }}/browser-build-artifacts - name: Download artifact from master - if: ${{ github.ref != 'refs/heads/rc' && !contains(github.ref, 'hotfix-rc') }} + if: ${{ github.ref != 'refs/heads/rc' && github.ref != 'refs/heads/hotfix-rc' }} uses: dawidd6/action-download-artifact@b2abf1705491048a2d7074f7d90513044fd25d39 # v2.19.0 with: workflow: build-browser.yml @@ -873,7 +897,7 @@ jobs: if-no-files-found: error release: - name: MacOS Package Prod Release Asset + name: Release beta channel to S3 runs-on: ubuntu-20.04 needs: - setup @@ -896,7 +920,7 @@ jobs: secrets: "aws-electron-access-id, aws-electron-access-key, aws-electron-bucket-name" - name: Download all artifacts - uses: bitwarden/gh-actions/download-artifacts@23433be15ed6fd046ce12b6889c5184a8d9c8783 + uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # v3.0.0 with: path: apps/desktop/artifacts @@ -906,15 +930,44 @@ jobs: working-directory: apps/desktop/artifacts run: mv Bitwarden-${{ env.PKG_VERSION }}-universal.pkg Bitwarden-${{ env.PKG_VERSION }}-universal.pkg.archive - # - name: Publish artifacts to S3 - # env: - # AWS_ACCESS_KEY_ID: ${{ steps.retrieve-secrets.outputs.aws-electron-access-id }} - # AWS_SECRET_ACCESS_KEY: ${{ steps.retrieve-secrets.outputs.aws-electron-access-key }} - # AWS_DEFAULT_REGION: 'us-west-2' - # AWS_S3_BUCKET_NAME: ${{ steps.retrieve-secrets.outputs.aws-electron-bucket-name }} - # working-directory: apps/desktop/artifacts - # run: | - # aws s3 cp ./ $AWS_S3_BUCKET_NAME/desktop/ \ - # --acl "public-read" \ - # --recursive \ - # --quiet \ No newline at end of file + - name: Publish artifacts to S3 + env: + AWS_ACCESS_KEY_ID: ${{ steps.retrieve-secrets.outputs.aws-electron-access-id }} + AWS_SECRET_ACCESS_KEY: ${{ steps.retrieve-secrets.outputs.aws-electron-access-key }} + AWS_DEFAULT_REGION: 'us-west-2' + AWS_S3_BUCKET_NAME: ${{ steps.retrieve-secrets.outputs.aws-electron-bucket-name }} + working-directory: apps/desktop/artifacts + run: | + aws s3 cp ./ $AWS_S3_BUCKET_NAME/desktop/ \ + --acl "public-read" \ + --recursive \ + --quiet + + + remove-branch: + name: Remove branch + runs-on: ubuntu-20.04 + if: always() + needs: + - setup + - linux + - windows + - macos-build + - macos-package-github + - macos-package-mas + - release + steps: + - name: Checkout repo + uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 + + - name: Setup git config + run: | + git config --global user.name "GitHub Action Bot" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --global url."https://github.com/".insteadOf ssh://git@github.com/ + git config --global url."https://".insteadOf ssh:// + - name: Remove branch + env: + BRANCH: ${{ needs.setup.outputs.branch-name }} + run: git push origin --delete $BRANCH + diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.yml index f6fd411a24a..b230fc92ed6 100644 --- a/.github/workflows/release-desktop.yml +++ b/.github/workflows/release-desktop.yml @@ -42,9 +42,9 @@ jobs: - name: Branch check if: ${{ github.event.inputs.release_type != 'Dry Run' }} run: | - if [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ $GITHUB_REF != refs/heads/hotfix-rc/* ]]; then + if [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ $GITHUB_REF != refs/heads/hotfix-rc ]]; then echo "===================================" - echo "[!] Can only release from the 'rc' or 'hotfix-rc/*' branches" + echo "[!] Can only release from the 'rc' or 'hotfix-rc' branches" echo "===================================" exit 1 fi @@ -76,6 +76,22 @@ jobs: ;; esac + - name: Create GitHub deployment + uses: chrnorm/deployment-action@1b599fe41a0ef1f95191e7f2eec4743f2d7dfc48 + id: deployment + with: + token: '${{ secrets.GITHUB_TOKEN }}' + environment: 'Desktop - Production' + description: 'Deployment ${{ steps.version.outputs.version }} to channel ${{ steps.release-channel.outputs.channel }} from branch ${{ github.ref_name }}' + task: release + + - name: Update deployment status to In Progress + uses: chrnorm/deployment-status@1b599fe41a0ef1f95191e7f2eec4743f2d7dfc48 + with: + token: '${{ secrets.GITHUB_TOKEN }}' + state: 'failure' + deployment-id: ${{ steps.deployment.outputs.deployment_id }} + - name: Login to Azure uses: Azure/login@ec3c14589bd3e9312b3cc8c41e6860e258df9010 with: @@ -164,6 +180,21 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} draft: true + - name: Update deployment status to Success + if: success() + uses: chrnorm/deployment-status@07b3930847f65e71c9c6802ff5a402f6dfb46b86 + with: + token: '${{ secrets.GITHUB_TOKEN }}' + state: 'success' + deployment-id: ${{ steps.deployment.outputs.deployment_id }} + + - name: Update deployment status to Failure + if: failure() + uses: chrnorm/deployment-status@07b3930847f65e71c9c6802ff5a402f6dfb46b86 + with: + token: '${{ secrets.GITHUB_TOKEN }}' + state: 'failure' + deployment-id: ${{ steps.deployment.outputs.deployment_id }} snap: name: Deploy Snap diff --git a/.github/workflows/release-qa-web.yml b/.github/workflows/release-qa-web.yml index d72783ec48a..d9a3fa3c1bb 100644 --- a/.github/workflows/release-qa-web.yml +++ b/.github/workflows/release-qa-web.yml @@ -72,6 +72,23 @@ jobs: name: Deploy Web Vault to QA CloudFlare Pages branch runs-on: ubuntu-20.04 steps: + - name: Create GitHub deployment + uses: chrnorm/deployment-action@1b599fe41a0ef1f95191e7f2eec4743f2d7dfc48 + id: deployment + with: + token: '${{ secrets.GITHUB_TOKEN }}' + environment-url: http://vault.qa.bitwarden.pw + environment: 'Web Vault - QA' + description: 'Deployment from branch ${{ github.ref_name }}' + + - name: Update deployment status to In Progress + uses: chrnorm/deployment-status@07b3930847f65e71c9c6802ff5a402f6dfb46b86 + with: + token: '${{ secrets.GITHUB_TOKEN }}' + environment-url: http://vault.qa.bitwarden.pw + state: 'in_progress' + deployment-id: ${{ steps.deployment.outputs.deployment_id }} + - name: Checkout Repo uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 @@ -118,3 +135,21 @@ jobs: echo "No changes to commit!"; fi working-directory: deployment + + - name: Update deployment status to Success + if: success() + uses: chrnorm/deployment-status@07b3930847f65e71c9c6802ff5a402f6dfb46b86 + with: + token: '${{ secrets.GITHUB_TOKEN }}' + environment-url: http://vault.qa.bitwarden.pw + state: 'success' + deployment-id: ${{ steps.deployment.outputs.deployment_id }} + + - name: Update deployment status to Failure + if: failure() + uses: chrnorm/deployment-status@07b3930847f65e71c9c6802ff5a402f6dfb46b86 + with: + token: '${{ secrets.GITHUB_TOKEN }}' + environment-url: http://vault.qa.bitwarden.pw + state: 'failure' + deployment-id: ${{ steps.deployment.outputs.deployment_id }} diff --git a/.github/workflows/release-web.yml b/.github/workflows/release-web.yml index 1db2b6dbe2a..665be527c01 100644 --- a/.github/workflows/release-web.yml +++ b/.github/workflows/release-web.yml @@ -28,9 +28,9 @@ jobs: - name: Branch check if: ${{ github.event.inputs.release_type != 'Dry Run' }} run: | - if [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ $GITHUB_REF != refs/heads/hotfix-rc/* ]]; then + if [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ $GITHUB_REF != "refs/heads/hotfix-rc" ]]; then echo "===================================" - echo "[!] Can only release from the 'rc' or 'hotfix-rc/*' branches" + echo "[!] Can only release from the 'rc' or 'hotfix-rc' branches" echo "===================================" exit 1 fi @@ -147,7 +147,7 @@ jobs: - self-host env: _RELEASE_VERSION: ${{ needs.setup.outputs.release_version }} - _TAG_VERSION: ${{ needs.setup.outputs.tag_version }} + _TAG_VERSION: ${{ needs.setup.outputs.release_version }} steps: - name: Checkout Repo uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 @@ -227,6 +227,24 @@ jobs: - self-host - cfpages-deploy steps: + - name: Create GitHub deployment + uses: chrnorm/deployment-action@1b599fe41a0ef1f95191e7f2eec4743f2d7dfc48 + id: deployment + with: + token: '${{ secrets.GITHUB_TOKEN }}' + environment-url: http://vault.bitwarden.com + environment: 'Web Vault - Production' + description: 'Deployment ${{ needs.setup.outputs.release_version }} from branch ${{ github.ref_name }}' + task: release + + - name: Update deployment status to In Progress + uses: chrnorm/deployment-status@07b3930847f65e71c9c6802ff5a402f6dfb46b86 + with: + token: '${{ secrets.GITHUB_TOKEN }}' + environment-url: http://vault.bitwarden.com + state: 'in_progress' + deployment-id: ${{ steps.deployment.outputs.deployment_id }} + - name: Download latest build artifacts if: ${{ github.event.inputs.release_type != 'Dry Run' }} uses: bitwarden/gh-actions/download-artifacts@c1fa8e09871a860862d6bbe36184b06d2c7e35a8 @@ -259,11 +277,29 @@ jobs: if: ${{ github.event.inputs.release_type != 'Dry Run' }} uses: ncipollo/release-action@58ae73b360456532aafd58ee170c045abbeaee37 # v1.10.0 with: - name: "Version v${{ needs.setup.outputs.release_version }}" + name: "Web v${{ needs.setup.outputs.release_version }}" commit: ${{ github.sha }} - tag: web-v${{ needs.setup.outputs.tag_version }} + tag: web-v${{ needs.setup.outputs.release_version }} body: "" artifacts: "apps/web/artifacts/web-${{ needs.setup.outputs.release_version }}-selfhosted-COMMERCIAL.zip, apps/web/artifacts/web-${{ needs.setup.outputs.release_version }}-selfhosted-open-source.zip" token: ${{ secrets.GITHUB_TOKEN }} draft: true + + - name: Update deployment status to Success + if: success() + uses: chrnorm/deployment-status@07b3930847f65e71c9c6802ff5a402f6dfb46b86 + with: + token: '${{ secrets.GITHUB_TOKEN }}' + environment-url: http://vault.bitwarden.com + state: 'success' + deployment-id: ${{ steps.deployment.outputs.deployment_id }} + + - name: Update deployment status to Failure + if: failure() + uses: chrnorm/deployment-status@07b3930847f65e71c9c6802ff5a402f6dfb46b86 + with: + token: '${{ secrets.GITHUB_TOKEN }}' + environment-url: http://vault.bitwarden.com + state: 'failure' + deployment-id: ${{ steps.deployment.outputs.deployment_id }} diff --git a/.github/workflows/version-auto-bump.yml b/.github/workflows/version-auto-bump.yml new file mode 100644 index 00000000000..4c1b0f6e8f1 --- /dev/null +++ b/.github/workflows/version-auto-bump.yml @@ -0,0 +1,68 @@ +--- +name: Version Auto Bump + +on: + release: + types: [published] + +defaults: + run: + shell: bash + +jobs: + setup: + name: "Setup" + runs-on: ubuntu-20.04 + outputs: + version_number: ${{ steps.version.outputs.new-version }} + if: contains(github.event.release.tag, 'desktop') + steps: + - name: Checkout Branch + uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 + + - name: Get version to bump + id: version + env: + RELEASE_TAG: ${{ github.event.release.tag }} + run: | + + CURR_MAJOR=$(echo $RELEASE_TAG | sed -r 's/desktop-v([0-9]{4}\.[0-9]\.)([0-9])/\1/') + CURR_VER=$(echo $RELEASE_TAG | sed -r 's/desktop-v([0-9]{4}\.[0-9]\.)([0-9])/\2/') + echo $CURR_VER + ((CURR_VER++)) + NEW_VER=$CURR_MAJOR$CURR_VER + echo "::set-output name=new-version::$NEW_VER" + + trigger_version_bump: + name: "Trigger desktop version bump workflow" + runs-on: ubuntu-20.04 + needs: + - setup + steps: + - name: Login to Azure + uses: Azure/login@ec3c14589bd3e9312b3cc8c41e6860e258df9010 + with: + creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }} + + - name: Retrieve secrets + id: retrieve-secrets + env: + KEYVAULT: bitwarden-prod-kv + SECRET: "github-pat-bitwarden-devops-bot-repo-scope" + run: | + VALUE=$(az keyvault secret show --vault-name $KEYVAULT --name $SECRET --query value --output tsv) + echo "::add-mask::$VALUE" + echo "::set-output name=$SECRET::$VALUE" + + - name: Call GitHub API to trigger workflow bump + env: + TOKEN: ${{ steps.retrieve-secrets.outputs.github-pat-bitwarden-devops-bot-repo-scope }} + VERSION: ${{ needs.setup.outputs.version_number}} + run: | + JSON_STRING=$(printf '{"ref":"master", "inputs": { "client":"Desktop", "version_number":"%s"}}' "$VERSION") + curl \ + -X POST \ + -i -u bitwarden-devops-bot:$TOKEN \ + -H "Accept: application/vnd.github.v3+json" \ + https://api.github.com/repos/bitwarden/clients/actions/workflows/version-bump.yml/dispatches \ + -d $JSON_STRING diff --git a/.gitignore b/.gitignore index 060835ac980..2e389245b2f 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ npm-debug.log # Build directories dist build +.angular/cache # Testing coverage diff --git a/.prettierignore b/.prettierignore index 8f0e5688297..0a23f5ce733 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,6 +2,7 @@ **/build **/dist **/coverage +.angular # External libraries / auto synced locales apps/browser/src/_locales diff --git a/.storybook/tsconfig.json b/.storybook/tsconfig.json index a55b6597e47..80262bdf27c 100644 --- a/.storybook/tsconfig.json +++ b/.storybook/tsconfig.json @@ -4,7 +4,10 @@ "types": ["node"], "allowSyntheticDefaultImports": true }, - "exclude": ["../src/test.setup.ts", "../src/**/*.spec.ts", "../projects/**/*.spec.ts"], - "include": ["../src/**/*", "../projects/**/*"], - "files": ["./typings.d.ts"] + "exclude": ["../src/test.setup.ts", "../apps/src/**/*.spec.ts", "../libs/**/*.spec.ts"], + "files": [ + "./typings.d.ts", + "../libs/components/src/main.ts", + "../libs/components/src/polyfills.ts" + ] } diff --git a/angular.json b/angular.json index 4697fb74234..4e20f2294d8 100644 --- a/angular.json +++ b/angular.json @@ -3,6 +3,83 @@ "version": 1, "newProjectRoot": "apps", "projects": { + "web": { + "projectType": "application", + "schematics": { + "@schematics/angular:application": { + "strict": true + } + }, + "root": "apps/web", + "sourceRoot": "apps/web/src", + "prefix": "app", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:browser", + "options": { + "outputPath": "dist/web", + "index": "apps/web/src/index.html", + "main": "apps/web/src/app/main.ts", + "polyfills": "apps/web/src/app/polyfills.ts", + "tsConfig": "apps/web/tsconfig.json", + "assets": ["apps/web/src/favicon.ico"], + "styles": [], + "scripts": [] + } + } + } + }, + "browser": { + "projectType": "application", + "schematics": { + "@schematics/angular:application": { + "strict": true + } + }, + "root": "apps/browser", + "sourceRoot": "apps/browser/src", + "prefix": "app", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:browser", + "options": { + "outputPath": "dist/browser", + "index": "apps/browser/src/popup/index.html", + "main": "apps/browser/src/popup/main.ts", + "polyfills": "apps/browser/src/popup/polyfills.ts", + "tsConfig": "apps/browser/tsconfig.json", + "assets": [], + "styles": [], + "scripts": [] + } + } + } + }, + "desktop": { + "projectType": "application", + "schematics": { + "@schematics/angular:application": { + "strict": true + } + }, + "root": "apps/desktop", + "sourceRoot": "apps/desktop/src", + "prefix": "app", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:browser", + "options": { + "outputPath": "dist/desktop", + "index": "apps/desktop/src/index.html", + "main": "apps/desktop/src/app/main.ts", + "tsConfig": "apps/desktop/tsconfig.json", + "assets": [], + "styles": [], + "scripts": [] + } + } + } + }, "components": { "projectType": "application", "schematics": { @@ -10,9 +87,9 @@ "strict": true } }, - "root": "./libs/components", + "root": "libs/components", "sourceRoot": "libs/components/src", - "prefix": "components", + "prefix": "bit", "architect": { "build": { "builder": "@angular-devkit/build-angular:browser", @@ -31,18 +108,6 @@ }, "configurations": { "production": { - "budgets": [ - { - "type": "initial", - "maximumWarning": "500kb", - "maximumError": "1mb" - }, - { - "type": "anyComponentStyle", - "maximumWarning": "2kb", - "maximumError": "4kb" - } - ], "outputHashing": "all" }, "development": { @@ -60,22 +125,42 @@ "builder": "@angular-devkit/build-angular:dev-server", "configurations": { "production": { - "browserTarget": "components:build:production" + "browserTarget": "test-storybook:build:production" }, "development": { - "browserTarget": "components:build:development" + "browserTarget": "test-storybook:build:development" } }, "defaultConfiguration": "development" - }, - "extract-i18n": { - "builder": "@angular-devkit/build-angular:extract-i18n", + } + } + }, + "storybook": { + "projectType": "application", + "root": "libs/components", + "sourceRoot": "libs/components/src", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:browser", "options": { - "browserTarget": "components:build" + "tsConfig": ".storybook/tsconfig.json", + "styles": ["libs/components/src/styles.scss", "libs/components/src/styles.css"], + "scripts": [] } } } + }, + "angular": { + "projectType": "library", + "root": "libs/angular", + "sourceRoot": "libs/angular/src", + "prefix": "app", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:ng-packagr", + "defaultConfiguration": "production" + } + } } - }, - "defaultProject": "components" + } } diff --git a/apps/browser/src/_locales/eu/messages.json b/apps/browser/src/_locales/eu/messages.json index 7c3890aaf65..7edf2dbf05c 100644 --- a/apps/browser/src/_locales/eu/messages.json +++ b/apps/browser/src/_locales/eu/messages.json @@ -1339,7 +1339,7 @@ "description": "ex. A good password. Scale: Weak -> Good -> Strong" }, "weak": { - "message": "Biguna", + "message": "Ahula", "description": "ex. A weak password. Scale: Weak -> Good -> Strong" }, "weakMasterPassword": { @@ -1415,7 +1415,7 @@ "message": "Berreskuratu elementua" }, "restoreItemConfirmation": { - "message": "Ziur zaude elementu hau ezabatu nahi duzula?" + "message": "Ziur zaude elementu hau berreskuratu nahi duzula?" }, "restoredItem": { "message": "Elementua berreskuratua" @@ -1580,15 +1580,15 @@ } }, "send": { - "message": "Bidalketa", + "message": "Send", "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated." }, "searchSends": { - "message": "Bildalketak bilatu", + "message": "Send-ak bilatu", "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated." }, "addSend": { - "message": "Gehitu Bidalketa", + "message": "Gehitu Send-a", "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated." }, "sendTypeText": { @@ -1598,7 +1598,7 @@ "message": "Fitxategia" }, "allSends": { - "message": "Bidalketa guztiak", + "message": "Send guztiak", "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated." }, "maxAccessCountReached": { @@ -1615,7 +1615,7 @@ "message": "Pasahitz babestua" }, "copySendLink": { - "message": "Bidalketa esteka kopiatu", + "message": "Send esteka kopiatu", "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated." }, "removePassword": { @@ -1628,11 +1628,11 @@ "message": "Pasahitza kendua" }, "deletedSend": { - "message": "Bidalketa ezabatua", + "message": "Send-a ezabatua", "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated." }, "sendLink": { - "message": "Bidalketa esteka", + "message": "Send esteka", "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated." }, "disabled": { @@ -1642,23 +1642,23 @@ "message": "Ziur zaude pasahitz hau ezabatu nahi duzula?" }, "deleteSend": { - "message": "Ezabatu Bidalketa", + "message": "Ezabatu Send-a", "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated." }, "deleteSendConfirmation": { - "message": "Ziur al zaude Bidalketa hau ezabatu nahi duzula?", + "message": "Ziur al zaude Send hau ezabatu nahi duzula?", "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated." }, "editSend": { - "message": "Bidalketa editatu", + "message": "Editatu Send-a", "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated." }, "sendTypeHeader": { - "message": "Zein Bidalketa mota da hau?", + "message": "Zein Send mota da hau?", "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated." }, "sendNameDesc": { - "message": "Bidalketa hau deskribatzeko izena.", + "message": "Send hau deskribatzeko izena.", "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated." }, "sendFileDesc": { @@ -1668,14 +1668,14 @@ "message": "Ezabatze data" }, "deletionDateDesc": { - "message": "Bidalketa betiko ezabatuko da zehaztutako datan eta orduan.", + "message": "Send-a betiko ezabatuko da zehaztutako datan eta orduan.", "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated." }, "expirationDate": { "message": "Iraungitze data" }, "expirationDateDesc": { - "message": "Hala ezartzen bada, Bidalketa honetarako sarbidea zehaztutako egunean eta orduan amaituko da.", + "message": "Hala ezartzen bada, Send honetarako sarbidea zehaztutako egunean eta orduan amaituko da.", "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated." }, "oneDay": { @@ -1697,56 +1697,56 @@ "message": "Sarbide kopuru maximoa" }, "maximumAccessCountDesc": { - "message": "Hala ezartzen bada, erabiltzaileak ezin izango dira Bidalketa honetara sartu gehienezko sarbide kopurura iritsi ondoren.", + "message": "Hala ezartzen bada, erabiltzaileak ezin izango dira Send honetara sartu gehienezko sarbide kopurura iritsi ondoren.", "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated." }, "sendPasswordDesc": { - "message": "Nahi izanez gero, pasahitza eskatu erabiltzaileak bidalketa honetara sar daitezen.", + "message": "Nahi izanez gero, pasahitza eskatu erabiltzaileak Send honetara sar daitezen.", "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated." }, "sendNotesDesc": { - "message": "Bidalketa honi buruzko ohar pribatuak.", + "message": "Send honi buruzko ohar pribatuak.", "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated." }, "sendDisableDesc": { - "message": "Desgaitu Bidalketa hau inor sar ez dadin.", + "message": "Desgaitu Send hau inor sar ez dadin.", "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated." }, "sendShareDesc": { - "message": "Gordetzean, kopiatu Bidalketa honen esteka arbelean.", + "message": "Gordetzean, kopiatu Send honen esteka arbelean.", "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated." }, "sendTextDesc": { "message": "Bidali nahi duzun testua." }, "sendHideText": { - "message": "Ezkutatu Bidalketako testu hau, modu lehenetsian.", + "message": "Ezkutatu Send-eko testu hau, modu lehenetsian.", "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated." }, "currentAccessCount": { "message": "Uneko sarbide kopurua" }, "createSend": { - "message": "Sortu Bidalketa berria", + "message": "Sortu Send berria", "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated." }, "newPassword": { "message": "Pasahitz berria" }, "sendDisabled": { - "message": "Bidalketa desgaituta", + "message": "Send-a desgaitua", "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated." }, "sendDisabledWarning": { - "message": "Enpresa-politika baten ondorioz, lehendik dagoen Bidalketa bakarrik ezaba dezakezu.", + "message": "Enpresa-politika baten ondorioz, lehendik dagoen Send-a bakarrik ezaba dezakezu.", "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated." }, "createdSend": { - "message": "Bidalketa sortua", + "message": "Send-a sortua", "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated." }, "editedSend": { - "message": "Bidalketa editatua", + "message": "Send-a editatua", "description": "'Send' is a noun and the name of a feature called 'Bitwarden Send'. It should not be translated." }, "sendLinuxChromiumFileWarning": { @@ -1792,7 +1792,7 @@ "message": "Ezkutatu nire helbide elektronikoa hartzaileei." }, "sendOptionsPolicyInEffect": { - "message": "Erakundeko politika batek edo gehiagok Bidalketa aukerei eragiten diote." + "message": "Erakundeko politika batek edo gehiagok Send-eko aukerei eragiten diote." }, "passwordPrompt": { "message": "Berriro eskatu pasahitz nagusia" diff --git a/apps/browser/src/_locales/pl/messages.json b/apps/browser/src/_locales/pl/messages.json index b34f758e332..ac9273793d3 100644 --- a/apps/browser/src/_locales/pl/messages.json +++ b/apps/browser/src/_locales/pl/messages.json @@ -367,7 +367,7 @@ "message": "Blokowanie sejfu" }, "lockNow": { - "message": "Zablokuj teraz" + "message": "Zablokuj" }, "immediately": { "message": "Natychmiast" diff --git a/apps/browser/src/background/main.background.ts b/apps/browser/src/background/main.background.ts index cfc66fe02bf..6f359c95584 100644 --- a/apps/browser/src/background/main.background.ts +++ b/apps/browser/src/background/main.background.ts @@ -517,7 +517,7 @@ export default class MainBackground { } async bootstrap() { - this.containerService.attachToWindow(window); + this.containerService.attachToGlobal(window); await this.stateService.init(); diff --git a/apps/browser/src/browser/browserApi.ts b/apps/browser/src/browser/browserApi.ts index d3796e78a70..b5991be4ce3 100644 --- a/apps/browser/src/browser/browserApi.ts +++ b/apps/browser/src/browser/browserApi.ts @@ -156,7 +156,7 @@ export class BrowserApi { static reloadExtension(win: Window) { if (win != null) { - return win.location.reload(true); + return (win.location as any).reload(true); } else { return chrome.runtime.reload(); } diff --git a/apps/browser/src/notification/bar.scss b/apps/browser/src/notification/bar.scss index 8303cb5151a..415bfee3f75 100644 --- a/apps/browser/src/notification/bar.scss +++ b/apps/browser/src/notification/bar.scss @@ -87,7 +87,7 @@ button.neutral { } } -@media (print) { +@media print { body { display: none; } diff --git a/apps/browser/src/popup/accounts/environment.component.html b/apps/browser/src/popup/accounts/environment.component.html index 626c5b7b3eb..a23de6ff56a 100644 --- a/apps/browser/src/popup/accounts/environment.component.html +++ b/apps/browser/src/popup/accounts/environment.component.html @@ -1,13 +1,13 @@
- {{ "close" | i18n }} +

{{ "appName" | i18n }}

- diff --git a/apps/browser/src/popup/accounts/hint.component.html b/apps/browser/src/popup/accounts/hint.component.html index b4fbfdc05a4..828af9c5583 100644 --- a/apps/browser/src/popup/accounts/hint.component.html +++ b/apps/browser/src/popup/accounts/hint.component.html @@ -1,13 +1,13 @@
- {{ "cancel" | i18n }} +

{{ "passwordHint" | i18n }}

- diff --git a/apps/browser/src/popup/accounts/home.component.html b/apps/browser/src/popup/accounts/home.component.html index 2fb6907dccf..5f80204a27b 100644 --- a/apps/browser/src/popup/accounts/home.component.html +++ b/apps/browser/src/popup/accounts/home.component.html @@ -2,15 +2,17 @@

{{ "loginOrCreateNewAccount" | i18n }}

- {{ "login" | i18n }} + - {{ "createAccount" | i18n }} +
- + diff --git a/apps/browser/src/popup/accounts/lock.component.html b/apps/browser/src/popup/accounts/lock.component.html index 04e6eb1e102..ed47940875d 100644 --- a/apps/browser/src/popup/accounts/lock.component.html +++ b/apps/browser/src/popup/accounts/lock.component.html @@ -5,7 +5,7 @@ {{ "verifyIdentity" | i18n }}
- +
@@ -41,7 +41,6 @@ type="button" class="row-btn" appStopClick - appBlurClick appA11yTitle="{{ 'toggleVisibility' | i18n }}" (click)="togglePassword()" [attr.aria-pressed]="showPassword" diff --git a/apps/browser/src/popup/accounts/login.component.html b/apps/browser/src/popup/accounts/login.component.html index d82d214fb2e..281df835093 100644 --- a/apps/browser/src/popup/accounts/login.component.html +++ b/apps/browser/src/popup/accounts/login.component.html @@ -1,13 +1,13 @@
- {{ "cancel" | i18n }} +

{{ "appName" | i18n }}

- @@ -46,7 +46,6 @@ type="button" class="row-btn" appStopClick - appBlurClick appA11yTitle="{{ 'toggleVisibility' | i18n }}" (click)="togglePassword()" [attr.aria-pressed]="showPassword" @@ -65,7 +64,7 @@

- {{ "getMasterPasswordHint" | i18n }} +

diff --git a/apps/browser/src/popup/accounts/register.component.html b/apps/browser/src/popup/accounts/register.component.html index 4c8ec89aac9..39a6321f922 100644 --- a/apps/browser/src/popup/accounts/register.component.html +++ b/apps/browser/src/popup/accounts/register.component.html @@ -1,13 +1,13 @@
- {{ "cancel" | i18n }} +

{{ "createAccount" | i18n }}

- @@ -25,11 +25,8 @@
@@ -46,7 +42,6 @@ type="button" class="row-btn" appStopClick - appBlurClick appA11yTitle="{{ 'toggleVisibility' | i18n }}" (click)="togglePassword()" [attr.aria-pressed]="showPassword" @@ -59,17 +54,14 @@
-
-
-
+ + -
-
-
+ + + @@ -100,7 +91,6 @@ type="button" class="row-btn" appStopClick - appBlurClick appA11yTitle="{{ 'toggleVisibility' | i18n }}" (click)="togglePassword(true)" [attr.aria-pressed]="showPassword" diff --git a/apps/browser/src/popup/accounts/update-temp-password.component.ts b/apps/browser/src/popup/accounts/update-temp-password.component.ts index e04b769df91..c30a60119ed 100644 --- a/apps/browser/src/popup/accounts/update-temp-password.component.ts +++ b/apps/browser/src/popup/accounts/update-temp-password.component.ts @@ -12,47 +12,11 @@ import { PolicyService } from "@bitwarden/common/abstractions/policy.service"; import { StateService } from "@bitwarden/common/abstractions/state.service"; import { SyncService } from "@bitwarden/common/abstractions/sync.service"; -interface MasterPasswordScore { - Color: string; - Text: string; - Width: number; -} - @Component({ selector: "app-update-temp-password", templateUrl: "update-temp-password.component.html", }) export class UpdateTempPasswordComponent extends BaseUpdateTempPasswordComponent { - get masterPasswordScoreStyle(): MasterPasswordScore { - const scoreWidth = this.masterPasswordScore == null ? 0 : (this.masterPasswordScore + 1) * 20; - switch (this.masterPasswordScore) { - case 4: - return { - Color: "bg-success", - Text: "strong", - Width: scoreWidth, - }; - case 3: - return { - Color: "bg-primary", - Text: "good", - Width: scoreWidth, - }; - case 2: - return { - Color: "bg-warning", - Text: "weak", - Width: scoreWidth, - }; - default: - return { - Color: "bg-danger", - Text: "weak", - Width: scoreWidth, - }; - } - } - constructor( i18nService: I18nService, platformUtilsService: PlatformUtilsService, diff --git a/apps/browser/src/popup/app.module.ts b/apps/browser/src/popup/app.module.ts index ae8bef72647..1be18d3df95 100644 --- a/apps/browser/src/popup/app.module.ts +++ b/apps/browser/src/popup/app.module.ts @@ -239,7 +239,6 @@ registerLocaleData(localeZhTw, "zh-TW"); RemovePasswordComponent, VaultSelectComponent, ], - entryComponents: [], providers: [CurrencyPipe, DatePipe], bootstrap: [AppComponent], }) diff --git a/apps/browser/src/popup/components/password-reprompt.component.html b/apps/browser/src/popup/components/password-reprompt.component.html index e57ad7d178d..ed698097356 100644 --- a/apps/browser/src/popup/components/password-reprompt.component.html +++ b/apps/browser/src/popup/components/password-reprompt.component.html @@ -23,7 +23,6 @@ type="button" class="row-btn" appStopClick - appBlurClick appA11yTitle="{{ 'toggleVisibility' | i18n }}" (click)="togglePassword()" [attr.aria-pressed]="showPassword" @@ -43,7 +42,7 @@ @@ -9,7 +9,7 @@ {{ "generator" | i18n }}
-
@@ -33,7 +33,6 @@ @@ -9,7 +9,7 @@ {{ "passwordHistory" | i18n }}
-
diff --git a/apps/browser/src/popup/polyfills.ts b/apps/browser/src/popup/polyfills.ts index 8d5d8a0e3b9..9a30bd23da4 100644 --- a/apps/browser/src/popup/polyfills.ts +++ b/apps/browser/src/popup/polyfills.ts @@ -1,4 +1,3 @@ import "core-js/stable"; import "date-input-polyfill"; -import "web-animations-js"; import "zone.js/dist/zone"; diff --git a/apps/browser/src/popup/scss/pages.scss b/apps/browser/src/popup/scss/pages.scss index 74a2605b75a..9ff96f048b3 100644 --- a/apps/browser/src/popup/scss/pages.scss +++ b/apps/browser/src/popup/scss/pages.scss @@ -56,7 +56,7 @@ app-home { margin-top: 10px; } - a.settings-icon { + button.settings-icon { position: absolute; top: 10px; left: 10px; diff --git a/apps/browser/src/popup/scss/popup.scss b/apps/browser/src/popup/scss/popup.scss index c8f0da65b5d..7d718b86645 100644 --- a/apps/browser/src/popup/scss/popup.scss +++ b/apps/browser/src/popup/scss/popup.scss @@ -11,4 +11,4 @@ @import "plugins.scss"; @import "environment.scss"; @import "pages.scss"; -@import "~@angular/cdk/overlay-prebuilt.css"; +@import "@angular/cdk/overlay-prebuilt.css"; diff --git a/apps/browser/src/popup/send/send-add-edit.component.html b/apps/browser/src/popup/send/send-add-edit.component.html index 3fea4094d6e..fb1ba6b801c 100644 --- a/apps/browser/src/popup/send/send-add-edit.component.html +++ b/apps/browser/src/popup/send/send-add-edit.component.html @@ -1,13 +1,13 @@
- +

{{ title }}

- @@ -226,7 +226,6 @@ type="button" class="row-btn" appStopClick - appBlurClick appA11yTitle="{{ 'toggleVisibility' | i18n }}" (click)="togglePasswordVisible()" [attr.aria-pressed]="showPassword" @@ -300,7 +299,6 @@ type="button" class="box-content-row" appStopClick - appBlurClick (click)="delete()" [appApiAction]="deletePromise" #deleteBtn diff --git a/apps/browser/src/popup/send/send-groupings.component.html b/apps/browser/src/popup/send/send-groupings.component.html index 72c79e7cb77..92c02ee3b34 100644 --- a/apps/browser/src/popup/send/send-groupings.component.html +++ b/apps/browser/src/popup/send/send-groupings.component.html @@ -18,7 +18,6 @@
@@ -21,7 +21,6 @@

{{ "excludedDomains" | i18n }}

- +
@@ -73,7 +73,6 @@

{{ "exportVault" | i18n }}

-
diff --git a/apps/browser/src/popup/settings/export.component.ts b/apps/browser/src/popup/settings/export.component.ts index c2f90317596..d3c9e01fdc2 100644 --- a/apps/browser/src/popup/settings/export.component.ts +++ b/apps/browser/src/popup/settings/export.component.ts @@ -1,5 +1,5 @@ import { Component } from "@angular/core"; -import { FormBuilder } from "@angular/forms"; +import { UntypedFormBuilder } from "@angular/forms"; import { Router } from "@angular/router"; import { ExportComponent as BaseExportComponent } from "@bitwarden/angular/components/export.component"; @@ -28,7 +28,7 @@ export class ExportComponent extends BaseExportComponent { private router: Router, logService: LogService, userVerificationService: UserVerificationService, - formBuilder: FormBuilder, + formBuilder: UntypedFormBuilder, fileDownloadService: FileDownloadService ) { super( diff --git a/apps/browser/src/popup/settings/folder-add-edit.component.html b/apps/browser/src/popup/settings/folder-add-edit.component.html index 3999f6fb88d..b8aa391f0fa 100644 --- a/apps/browser/src/popup/settings/folder-add-edit.component.html +++ b/apps/browser/src/popup/settings/folder-add-edit.component.html @@ -1,13 +1,13 @@
- {{ "cancel" | i18n }} +

{{ title }}

- @@ -34,7 +34,6 @@ type="button" class="box-content-row" appStopClick - appBlurClick (click)="delete()" [appApiAction]="deletePromise" #deleteBtn diff --git a/apps/browser/src/popup/settings/folders.component.html b/apps/browser/src/popup/settings/folders.component.html index 23e2e227898..5052501d572 100644 --- a/apps/browser/src/popup/settings/folders.component.html +++ b/apps/browser/src/popup/settings/folders.component.html @@ -1,20 +1,15 @@

{{ "folders" | i18n }}

-
diff --git a/apps/browser/src/popup/settings/options.component.html b/apps/browser/src/popup/settings/options.component.html index 877710438c6..8f9874faa71 100644 --- a/apps/browser/src/popup/settings/options.component.html +++ b/apps/browser/src/popup/settings/options.component.html @@ -1,9 +1,9 @@

{{ "options" | i18n }} diff --git a/apps/browser/src/popup/settings/premium.component.html b/apps/browser/src/popup/settings/premium.component.html index a12fd370d28..fad784da6b4 100644 --- a/apps/browser/src/popup/settings/premium.component.html +++ b/apps/browser/src/popup/settings/premium.component.html @@ -1,9 +1,9 @@

{{ "premiumMembership" | i18n }} @@ -42,13 +42,12 @@

{{ priceString }}

- diff --git a/apps/browser/src/popup/settings/settings.component.html b/apps/browser/src/popup/settings/settings.component.html index c7f4bb5042d..af601fad2cb 100644 --- a/apps/browser/src/popup/settings/settings.component.html +++ b/apps/browser/src/popup/settings/settings.component.html @@ -11,18 +11,30 @@
@@ -77,7 +89,6 @@ type="button" class="box-content-row box-content-row-flex text-default" appStopClick - appBlurClick (click)="lock()" >
{{ "lockNow" | i18n }}
@@ -87,7 +98,6 @@ type="button" class="box-content-row box-content-row-flex text-default" appStopClick - appBlurClick (click)="twoStep()" >
{{ "twoStepLogin" | i18n }}
@@ -98,7 +108,7 @@

{{ "account" | i18n }}

- +

{{ "sync" | i18n }} diff --git a/apps/browser/src/popup/tabs.component.html b/apps/browser/src/popup/tabs.component.html index f64837cc732..fd04967b914 100644 --- a/apps/browser/src/popup/tabs.component.html +++ b/apps/browser/src/popup/tabs.component.html @@ -4,6 +4,7 @@
  • +

{{ title }}

- @@ -51,7 +51,6 @@ type="button" class="row-btn" appStopClick - appBlurClick appA11yTitle="{{ 'generateUsername' | i18n }}" (click)="generateUsername()" > @@ -77,7 +76,6 @@ type="button" #checkPasswordBtn class="row-btn btn" - appBlurClick appA11yTitle="{{ 'checkPassword' | i18n }}" (click)="checkPassword()" [appApiAction]="checkPasswordPromise" @@ -99,7 +97,6 @@ type="button" class="row-btn" appStopClick - appBlurClick appA11yTitle="{{ 'toggleVisibility' | i18n }}" (click)="togglePassword()" *ngIf="cipher.viewPassword" @@ -115,7 +112,6 @@ type="button" class="row-btn" appStopClick - appBlurClick appA11yTitle="{{ 'generatePassword' | i18n }}" (click)="generatePassword()" *ngIf="cipher.viewPassword" @@ -165,7 +161,6 @@ type="button" class="row-btn" appStopClick - appBlurClick appA11yTitle="{{ 'toggleVisibility' | i18n }}" (click)="toggleCardNumber()" [attr.aria-pressed]="showCardNumber" @@ -219,7 +214,6 @@ type="button" class="row-btn" appStopClick - appBlurClick appA11yTitle="{{ 'toggleVisibility' | i18n }}" (click)="toggleCardCode()" [attr.aria-pressed]="showCardCode" @@ -486,7 +480,6 @@ - @@ -13,7 +13,7 @@ {{ "attachments" | i18n }}

- @@ -33,7 +33,6 @@ class="row-btn btn" type="button" appStopClick - appBlurClick appA11yTitle="{{ 'deleteAttachment' | i18n }}" (click)="delete(a)" #deleteBtn diff --git a/apps/browser/src/popup/vault/ciphers.component.html b/apps/browser/src/popup/vault/ciphers.component.html index d6b87568663..340e7db8dd4 100644 --- a/apps/browser/src/popup/vault/ciphers.component.html +++ b/apps/browser/src/popup/vault/ciphers.component.html @@ -1,6 +1,6 @@
- @@ -19,7 +19,7 @@
-
@@ -40,7 +40,6 @@ *ngFor="let f of nestedFolders" class="box-content-row" appStopClick - appBlurClick (click)="selectFolder(f.node)" >
@@ -63,7 +62,6 @@ *ngFor="let c of nestedCollections" class="box-content-row" appStopClick - appBlurClick (click)="selectCollection(c.node)" >
diff --git a/apps/browser/src/popup/vault/collections.component.html b/apps/browser/src/popup/vault/collections.component.html index 35d7b082610..d8bcf9a0292 100644 --- a/apps/browser/src/popup/vault/collections.component.html +++ b/apps/browser/src/popup/vault/collections.component.html @@ -1,7 +1,7 @@
- @@ -10,7 +10,7 @@ {{ "collections" | i18n }}

- diff --git a/apps/browser/src/popup/vault/current-tab.component.html b/apps/browser/src/popup/vault/current-tab.component.html index f4cfd9f4bc1..c1029abffb3 100644 --- a/apps/browser/src/popup/vault/current-tab.component.html +++ b/apps/browser/src/popup/vault/current-tab.component.html @@ -4,7 +4,6 @@
-
diff --git a/apps/browser/src/popup/vault/password-history.component.html b/apps/browser/src/popup/vault/password-history.component.html index 009b7089baa..73a28bb2520 100644 --- a/apps/browser/src/popup/vault/password-history.component.html +++ b/apps/browser/src/popup/vault/password-history.component.html @@ -1,6 +1,6 @@
- +

{{ "passwordHistory" | i18n }} diff --git a/apps/browser/src/popup/vault/share.component.html b/apps/browser/src/popup/vault/share.component.html index 7e6d6e38af3..ad1447f6f65 100644 --- a/apps/browser/src/popup/vault/share.component.html +++ b/apps/browser/src/popup/vault/share.component.html @@ -1,7 +1,7 @@
- +

{{ "moveToOrganization" | i18n }} @@ -9,7 +9,6 @@
-
@@ -61,7 +61,6 @@ type="button" class="box-content-row" appStopClick - appBlurClick (click)="selectType(cipherType.Login)" >
@@ -75,7 +74,6 @@ type="button" class="box-content-row" appStopClick - appBlurClick (click)="selectType(cipherType.Card)" >
@@ -89,7 +87,6 @@ type="button" class="box-content-row" appStopClick - appBlurClick (click)="selectType(cipherType.Identity)" >
@@ -103,7 +100,6 @@ type="button" class="box-content-row" appStopClick - appBlurClick (click)="selectType(cipherType.SecureNote)" >
@@ -126,7 +122,6 @@ *ngFor="let f of nestedFolders" class="box-content-row" appStopClick - appBlurClick (click)="selectFolder(f.node)" >
@@ -151,7 +146,6 @@ *ngFor="let nestedCollection of nestedCollections" class="box-content-row" appStopClick - appBlurClick (click)="selectCollection(nestedCollection.node)" >
@@ -187,13 +181,7 @@ {{ deletedCount }}

- +

{{ "viewItem" | i18n }}

-
@@ -79,7 +79,6 @@ type="button" #checkPasswordBtn class="row-btn btn" - appBlurClick appA11yTitle="{{ 'checkPassword' | i18n }}" (click)="checkPassword()" [appApiAction]="checkPasswordPromise" @@ -397,7 +396,6 @@ class="box-content-row box-content-row-flex text-default" *ngFor="let attachment of cipher.attachments" appStopClick - appBlurCLick (click)="downloadAttachment(attachment)" > {{ attachment.fileName }} @@ -421,7 +419,6 @@ type="button" class="box-content-row" appStopClick - appBlurClick (click)="fillCipher()" *ngIf="cipher.type !== cipherType.SecureNote && !cipher.isDeleted && !inPopout" > @@ -436,7 +433,6 @@ type="button" class="box-content-row" appStopClick - appBlurClick (click)="fillCipherAndSave()" *ngIf="cipher.type === cipherType.Login && !cipher.isDeleted && !inPopout" > @@ -451,7 +447,6 @@ type="button" class="box-content-row" appStopClick - appBlurClick (click)="clone()" *ngIf="!cipher.organizationId && !cipher.isDeleted" > @@ -466,7 +461,6 @@ type="button" class="box-content-row" appStopClick - appBlurClick (click)="share()" *ngIf="!cipher.organizationId" > @@ -481,7 +475,6 @@ type="button" class="box-content-row" appStopClick - appBlurClick (click)="restore()" *ngIf="cipher.isDeleted" > @@ -492,7 +485,7 @@ {{ "restoreItem" | i18n }}

- diff --git a/apps/browser/src/services/browserFileDownloadService.ts b/apps/browser/src/services/browserFileDownloadService.ts index 8f3ddb96acb..273df1e22d3 100644 --- a/apps/browser/src/services/browserFileDownloadService.ts +++ b/apps/browser/src/services/browserFileDownloadService.ts @@ -29,8 +29,8 @@ export class BrowserFileDownloadService implements FileDownloadService { true ); } else { - if (navigator.msSaveOrOpenBlob) { - navigator.msSaveBlob(builder.blob, request.fileName); + if ((navigator as any).msSaveOrOpenBlob) { + (navigator as any).msSaveBlob(builder.blob, request.fileName); } else { const a = window.document.createElement("a"); a.href = URL.createObjectURL(builder.blob); diff --git a/apps/browser/store/locales/eu/copy.resx b/apps/browser/store/locales/eu/copy.resx index c5d7edae95f..e5b3d542e38 100644 --- a/apps/browser/store/locales/eu/copy.resx +++ b/apps/browser/store/locales/eu/copy.resx @@ -132,7 +132,7 @@ Gailu guztien artean pasahitz mugagabeak kudeatu, biltegiratu, babestu eta parte Pasahitz sendoak, bakarrak eta ausazkoak sortzen ditu, webgune bakoitzaren segurtasun-baldintzetan oinarrituta. -Bitwarden Bidalketak-ek azkar transmititzen dio zifratutako informazioa --- artxiboak eta testu sinplea -- edozein pertsonari zuzenean. +Bitwarden Send-ek azkar transmititzen du zifratutako informazioa --- artxiboak eta testu sinplea -- edozein pertsonari zuzenean. Bitwarden-ek Taldeak eta Enpresak planak eskaintzen ditu, enpresa bereko lankideek pasahitzak modu seguruan parteka ditzaten. diff --git a/apps/browser/webpack.config.js b/apps/browser/webpack.config.js index 1a36c9506f9..cd9ecdd9eaf 100644 --- a/apps/browser/webpack.config.js +++ b/apps/browser/webpack.config.js @@ -46,13 +46,20 @@ const moduleRules = [ "sass-loader", ], }, - // Hide System.import warnings. ref: https://github.com/angular/angular/issues/21560 { - test: /[\/\\]@angular[\/\\].+\.js$/, - parser: { system: true }, + test: /\.[cm]?js$/, + use: [ + { + loader: "babel-loader", + options: { + configFile: false, + plugins: ["@angular/compiler-cli/linker/babel"], + }, + }, + ], }, { - test: /(?:\.ngfactory\.js|\.ngstyle\.js|\.ts)$/, + test: /\.[jt]sx?$/, loader: "@ngtools/webpack", }, ]; @@ -102,7 +109,7 @@ const plugins = [ cleanAfterEveryBuildPatterns: ["!popup/fonts/**/*"], }), new webpack.ProvidePlugin({ - process: "process/browser", + process: "process/browser.js", }), new webpack.SourceMapDevToolPlugin({ exclude: [/content\/.*/, /notification\/.*/], diff --git a/apps/cli/package-lock.json b/apps/cli/package-lock.json index 133ba88a2c9..eb25e6d946a 100644 --- a/apps/cli/package-lock.json +++ b/apps/cli/package-lock.json @@ -11,27 +11,27 @@ "dependencies": { "@koa/multer": "^3.0.0", "@koa/router": "^10.1.1", - "big-integer": "1.6.48", + "big-integer": "^1.6.51", "browser-hrtime": "^1.1.8", "chalk": "^4.1.1", "commander": "7.2.0", "form-data": "4.0.0", "https-proxy-agent": "5.0.0", "inquirer": "8.0.0", - "jsdom": "^16.5.3", - "jszip": "^3.7.1", + "jsdom": "^16.7.0", + "jszip": "^3.10.0", "koa": "^2.13.4", "koa-bodyparser": "^4.3.0", "koa-json": "^2.0.2", "lowdb": "1.0.0", "lunr": "^2.3.9", - "multer": "^1.4.4", - "node-fetch": "^2.6.1", + "multer": "^1.4.5-lts.1", + "node-fetch": "^2.6.7", "node-forge": "1.3.1", - "open": "^8.0.8", - "papaparse": "^5.3.0", + "open": "^8.4.0", + "papaparse": "^5.3.2", "proper-lockfile": "^4.1.2", - "rxjs": "6.6.7", + "rxjs": "^7.5.5", "tldjs": "^2.3.1", "zxcvbn": "^4.4.2" }, @@ -187,9 +187,9 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/big-integer": { - "version": "1.6.48", - "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.48.tgz", - "integrity": "sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w==", + "version": "1.6.51", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", + "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==", "engines": { "node": ">=0.6" } @@ -210,38 +210,16 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" }, "node_modules/busboy": { - "version": "0.2.14", - "resolved": "https://registry.npmjs.org/busboy/-/busboy-0.2.14.tgz", - "integrity": "sha512-InWFDomvlkEj+xWLBfU3AvnbVYqeTWmQopiW0tWWEy5yehYm2YkGEc59sUmw/4ty5Zj/b0WHGs1LgecuBSBGrg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", "dependencies": { - "dicer": "0.2.5", - "readable-stream": "1.1.x" + "streamsearch": "^1.1.0" }, "engines": { - "node": ">=0.8.0" + "node": ">=10.16.0" } }, - "node_modules/busboy/node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" - }, - "node_modules/busboy/node_modules/readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "node_modules/busboy/node_modules/string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==" - }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -534,39 +512,6 @@ "npm": "1.2.8000 || >= 1.4.16" } }, - "node_modules/dicer": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/dicer/-/dicer-0.2.5.tgz", - "integrity": "sha512-FDvbtnq7dzlPz0wyYlOExifDEZcu8h+rErEXgfxqmLfRfC/kJidEFh4+effJRO3P0xmfqyPbSMG0LveNRfTKVg==", - "dependencies": { - "readable-stream": "1.1.x", - "streamsearch": "0.1.2" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/dicer/node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" - }, - "node_modules/dicer/node_modules/readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "node_modules/dicer/node_modules/string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==" - }, "node_modules/domexception": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", @@ -901,6 +846,22 @@ "node": ">=8.0.0" } }, + "node_modules/inquirer/node_modules/rxjs": { + "version": "6.6.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "dependencies": { + "tslib": "^1.9.0" + }, + "engines": { + "npm": ">=2.0.0" + } + }, + "node_modules/inquirer/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, "node_modules/is-docker": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", @@ -1242,22 +1203,20 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/multer": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.4.tgz", - "integrity": "sha512-2wY2+xD4udX612aMqMcB8Ws2Voq6NIUPEtD1be6m411T4uDH/VtL9i//xvcyFlTVfRdaBsk7hV5tgrGQqhuBiw==", - "deprecated": "Multer 1.x is affected by CVE-2022-24434. This is fixed in v1.4.4-lts.1 which drops support for versions of Node.js before 6. Please upgrade to at least Node.js 6 and version 1.4.4-lts.1 of Multer. If you need support for older versions of Node.js, we are open to accepting patches that would fix the CVE on the main 1.x release line, whilst maintaining compatibility with Node.js 0.10.", + "version": "1.4.5-lts.1", + "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.1.tgz", + "integrity": "sha512-ywPWvcDMeH+z9gQq5qYHCCy+ethsk4goepZ45GLD63fOu0YcNecQxi64nDs3qluZB+murG3/D4dJ7+dGctcCQQ==", "dependencies": { "append-field": "^1.0.0", - "busboy": "^0.2.11", + "busboy": "^1.0.0", "concat-stream": "^1.5.2", "mkdirp": "^0.5.4", "object-assign": "^4.1.1", - "on-finished": "^2.3.0", "type-is": "^1.6.4", "xtend": "^4.0.0" }, "engines": { - "node": ">= 0.10.0" + "node": ">= 6.0.0" } }, "node_modules/mute-stream": { @@ -1586,14 +1545,11 @@ } }, "node_modules/rxjs": { - "version": "6.6.7", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", - "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "version": "7.5.6", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.6.tgz", + "integrity": "sha512-dnyv2/YsXhnm461G+R/Pe5bWP41Nm6LBXEYWI6eiFP4fiwx6WRI/CD0zbdVAudd9xwLEF2IDcKXLHit0FYjUzw==", "dependencies": { - "tslib": "^1.9.0" - }, - "engines": { - "npm": ">=2.0.0" + "tslib": "^2.1.0" } }, "node_modules/safe-buffer": { @@ -1694,11 +1650,11 @@ } }, "node_modules/streamsearch": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz", - "integrity": "sha512-jos8u++JKm0ARcSUTAZXOVC0mSox7Bhn6sBgty73P1f3JGf7yG2clTbBNHUdde/kdvP2FESam+vM6l8jBrNxHA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", "engines": { - "node": ">=0.8.0" + "node": ">=10.0.0" } }, "node_modules/string_decoder": { @@ -1831,9 +1787,9 @@ } }, "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" }, "node_modules/tsscmp": { "version": "1.0.6", @@ -2128,9 +2084,9 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "big-integer": { - "version": "1.6.48", - "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.48.tgz", - "integrity": "sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w==" + "version": "1.6.51", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", + "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==" }, "browser-hrtime": { "version": "1.1.8", @@ -2148,35 +2104,11 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" }, "busboy": { - "version": "0.2.14", - "resolved": "https://registry.npmjs.org/busboy/-/busboy-0.2.14.tgz", - "integrity": "sha512-InWFDomvlkEj+xWLBfU3AvnbVYqeTWmQopiW0tWWEy5yehYm2YkGEc59sUmw/4ty5Zj/b0WHGs1LgecuBSBGrg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", "requires": { - "dicer": "0.2.5", - "readable-stream": "1.1.x" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" - }, - "readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==" - } + "streamsearch": "^1.1.0" } }, "bytes": { @@ -2399,38 +2331,6 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" }, - "dicer": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/dicer/-/dicer-0.2.5.tgz", - "integrity": "sha512-FDvbtnq7dzlPz0wyYlOExifDEZcu8h+rErEXgfxqmLfRfC/kJidEFh4+effJRO3P0xmfqyPbSMG0LveNRfTKVg==", - "requires": { - "readable-stream": "1.1.x", - "streamsearch": "0.1.2" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" - }, - "readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==" - } - } - }, "domexception": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", @@ -2671,6 +2571,21 @@ "string-width": "^4.1.0", "strip-ansi": "^6.0.0", "through": "^2.3.6" + }, + "dependencies": { + "rxjs": { + "version": "6.6.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "requires": { + "tslib": "^1.9.0" + } + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + } } }, "is-docker": { @@ -2944,16 +2859,15 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "multer": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.4.tgz", - "integrity": "sha512-2wY2+xD4udX612aMqMcB8Ws2Voq6NIUPEtD1be6m411T4uDH/VtL9i//xvcyFlTVfRdaBsk7hV5tgrGQqhuBiw==", + "version": "1.4.5-lts.1", + "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.1.tgz", + "integrity": "sha512-ywPWvcDMeH+z9gQq5qYHCCy+ethsk4goepZ45GLD63fOu0YcNecQxi64nDs3qluZB+murG3/D4dJ7+dGctcCQQ==", "requires": { "append-field": "^1.0.0", - "busboy": "^0.2.11", + "busboy": "^1.0.0", "concat-stream": "^1.5.2", "mkdirp": "^0.5.4", "object-assign": "^4.1.1", - "on-finished": "^2.3.0", "type-is": "^1.6.4", "xtend": "^4.0.0" } @@ -3210,11 +3124,11 @@ "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==" }, "rxjs": { - "version": "6.6.7", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", - "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "version": "7.5.6", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.6.tgz", + "integrity": "sha512-dnyv2/YsXhnm461G+R/Pe5bWP41Nm6LBXEYWI6eiFP4fiwx6WRI/CD0zbdVAudd9xwLEF2IDcKXLHit0FYjUzw==", "requires": { - "tslib": "^1.9.0" + "tslib": "^2.1.0" } }, "safe-buffer": { @@ -3289,9 +3203,9 @@ } }, "streamsearch": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz", - "integrity": "sha512-jos8u++JKm0ARcSUTAZXOVC0mSox7Bhn6sBgty73P1f3JGf7yG2clTbBNHUdde/kdvP2FESam+vM6l8jBrNxHA==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==" }, "string_decoder": { "version": "1.1.1", @@ -3398,9 +3312,9 @@ } }, "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" }, "tsscmp": { "version": "1.0.6", diff --git a/apps/cli/src/bw.ts b/apps/cli/src/bw.ts index fe0391772c5..6c217a7569c 100644 --- a/apps/cli/src/bw.ts +++ b/apps/cli/src/bw.ts @@ -377,7 +377,7 @@ export class Main { private async init() { await this.storageService.init(); await this.stateService.init(); - this.containerService.attachToWindow(global); + this.containerService.attachToGlobal(global); await this.environmentService.setUrlsFromStorage(); const locale = await this.stateService.getLocale(); await this.i18nService.init(locale); diff --git a/apps/cli/src/commands/download.command.ts b/apps/cli/src/commands/download.command.ts index ae3c35f00cc..bcd5a831f4c 100644 --- a/apps/cli/src/commands/download.command.ts +++ b/apps/cli/src/commands/download.command.ts @@ -1,6 +1,7 @@ import * as fet from "node-fetch"; import { CryptoService } from "@bitwarden/common/abstractions/crypto.service"; +import { EncArrayBuffer } from "@bitwarden/common/models/domain/encArrayBuffer"; import { SymmetricCryptoKey } from "@bitwarden/common/models/domain/symmetricCryptoKey"; import { Response } from "@bitwarden/node/cli/models/response"; import { FileResponse } from "@bitwarden/node/cli/models/response/fileResponse"; @@ -24,8 +25,8 @@ export abstract class DownloadCommand { } try { - const buf = await response.arrayBuffer(); - const decBuf = await this.cryptoService.decryptFromBytes(buf, key); + const encBuf = await EncArrayBuffer.fromResponse(response); + const decBuf = await this.cryptoService.decryptFromBytes(encBuf, key); if (process.env.BW_SERVE === "true") { const res = new FileResponse(Buffer.from(decBuf), fileName); return Response.success(res); diff --git a/apps/cli/src/services/nodeEnvSecureStorage.service.ts b/apps/cli/src/services/nodeEnvSecureStorage.service.ts index 58337d06d7a..dcec777347e 100644 --- a/apps/cli/src/services/nodeEnvSecureStorage.service.ts +++ b/apps/cli/src/services/nodeEnvSecureStorage.service.ts @@ -2,6 +2,7 @@ import { CryptoService } from "@bitwarden/common/abstractions/crypto.service"; import { LogService } from "@bitwarden/common/abstractions/log.service"; import { AbstractStorageService } from "@bitwarden/common/abstractions/storage.service"; import { Utils } from "@bitwarden/common/misc/utils"; +import { EncArrayBuffer } from "@bitwarden/common/models/domain/encArrayBuffer"; import { SymmetricCryptoKey } from "@bitwarden/common/models/domain/symmetricCryptoKey"; export class NodeEnvSecureStorageService implements AbstractStorageService { @@ -63,10 +64,8 @@ export class NodeEnvSecureStorageService implements AbstractStorageService { return null; } - const decValue = await this.cryptoService().decryptFromBytes( - Utils.fromB64ToArray(encValue).buffer, - sessionKey - ); + const encBuf = EncArrayBuffer.fromB64(encValue); + const decValue = await this.cryptoService().decryptFromBytes(encBuf, sessionKey); if (decValue == null) { this.logService.info("Failed to decrypt."); return null; diff --git a/apps/desktop/desktop_native/.cargo/config b/apps/desktop/desktop_native/.cargo/config new file mode 100644 index 00000000000..b58e89798b5 --- /dev/null +++ b/apps/desktop/desktop_native/.cargo/config @@ -0,0 +1,8 @@ +[target.x86_64-pc-windows-msvc] +rustflags = ["-Ctarget-feature=+crt-static"] + +[target.i686-pc-windows-msvc] +rustflags = ["-Ctarget-feature=+crt-static"] + +[target.aarch64-pc-windows-msvc] +rustflags = ["-Ctarget-feature=+crt-static"] diff --git a/apps/desktop/desktop_native/Cargo.toml b/apps/desktop/desktop_native/Cargo.toml index dbc27602950..0c990fe622d 100644 --- a/apps/desktop/desktop_native/Cargo.toml +++ b/apps/desktop/desktop_native/Cargo.toml @@ -25,9 +25,11 @@ widestring = "0.5.1" windows = {version = "0.32.0", features = [ "alloc", "Foundation", + "Security_Credentials_UI", "Storage_Streams", "Win32_Foundation", "Win32_Security_Credentials", + "Win32_System_WinRT", ]} [target.'cfg(windows)'.dev-dependencies] diff --git a/apps/desktop/desktop_native/build.js b/apps/desktop/desktop_native/build.js index ca42f7b0c28..a6fc633afd4 100644 --- a/apps/desktop/desktop_native/build.js +++ b/apps/desktop/desktop_native/build.js @@ -13,7 +13,7 @@ switch (process.platform) { break; default: - targets = ['x86_64-unknown-linux-gnu']; + targets = ['x86_64-unknown-linux-musl']; break; } diff --git a/apps/desktop/desktop_native/index.d.ts b/apps/desktop/desktop_native/index.d.ts index 6ac55a15585..023c7eccacf 100644 --- a/apps/desktop/desktop_native/index.d.ts +++ b/apps/desktop/desktop_native/index.d.ts @@ -13,3 +13,7 @@ export namespace passwords { /** Delete the stored password from the keychain. */ export function deletePassword(service: string, account: string): Promise } +export namespace biometrics { + export function prompt(hwnd: Buffer, message: string): Promise + export function available(): Promise +} diff --git a/apps/desktop/desktop_native/index.js b/apps/desktop/desktop_native/index.js index 8866118c01d..8b48ac99402 100644 --- a/apps/desktop/desktop_native/index.js +++ b/apps/desktop/desktop_native/index.js @@ -30,7 +30,7 @@ switch (platform) { if (localFileExisted) { nativeBinding = require('./desktop_native.android-arm64.node') } else { - nativeBinding = require('@bitwarden/desktop_native-android-arm64') + nativeBinding = require('@bitwarden/desktop-native-android-arm64') } } catch (e) { loadError = e @@ -42,7 +42,7 @@ switch (platform) { if (localFileExisted) { nativeBinding = require('./desktop_native.android-arm-eabi.node') } else { - nativeBinding = require('@bitwarden/desktop_native-android-arm-eabi') + nativeBinding = require('@bitwarden/desktop-native-android-arm-eabi') } } catch (e) { loadError = e @@ -62,7 +62,7 @@ switch (platform) { if (localFileExisted) { nativeBinding = require('./desktop_native.win32-x64-msvc.node') } else { - nativeBinding = require('@bitwarden/desktop_native-win32-x64-msvc') + nativeBinding = require('@bitwarden/desktop-native-win32-x64-msvc') } } catch (e) { loadError = e @@ -76,7 +76,7 @@ switch (platform) { if (localFileExisted) { nativeBinding = require('./desktop_native.win32-ia32-msvc.node') } else { - nativeBinding = require('@bitwarden/desktop_native-win32-ia32-msvc') + nativeBinding = require('@bitwarden/desktop-native-win32-ia32-msvc') } } catch (e) { loadError = e @@ -90,7 +90,7 @@ switch (platform) { if (localFileExisted) { nativeBinding = require('./desktop_native.win32-arm64-msvc.node') } else { - nativeBinding = require('@bitwarden/desktop_native-win32-arm64-msvc') + nativeBinding = require('@bitwarden/desktop-native-win32-arm64-msvc') } } catch (e) { loadError = e @@ -108,7 +108,7 @@ switch (platform) { if (localFileExisted) { nativeBinding = require('./desktop_native.darwin-x64.node') } else { - nativeBinding = require('@bitwarden/desktop_native-darwin-x64') + nativeBinding = require('@bitwarden/desktop-native-darwin-x64') } } catch (e) { loadError = e @@ -122,7 +122,7 @@ switch (platform) { if (localFileExisted) { nativeBinding = require('./desktop_native.darwin-arm64.node') } else { - nativeBinding = require('@bitwarden/desktop_native-darwin-arm64') + nativeBinding = require('@bitwarden/desktop-native-darwin-arm64') } } catch (e) { loadError = e @@ -141,7 +141,7 @@ switch (platform) { if (localFileExisted) { nativeBinding = require('./desktop_native.freebsd-x64.node') } else { - nativeBinding = require('@bitwarden/desktop_native-freebsd-x64') + nativeBinding = require('@bitwarden/desktop-native-freebsd-x64') } } catch (e) { loadError = e @@ -150,61 +150,31 @@ switch (platform) { case 'linux': switch (arch) { case 'x64': - if (isMusl()) { - localFileExisted = existsSync( - join(__dirname, 'desktop_native.linux-x64-musl.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./desktop_native.linux-x64-musl.node') - } else { - nativeBinding = require('@bitwarden/desktop_native-linux-x64-musl') - } - } catch (e) { - loadError = e - } - } else { - localFileExisted = existsSync( - join(__dirname, 'desktop_native.linux-x64-gnu.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./desktop_native.linux-x64-gnu.node') - } else { - nativeBinding = require('@bitwarden/desktop_native-linux-x64-gnu') - } - } catch (e) { - loadError = e + localFileExisted = existsSync( + join(__dirname, 'desktop_native.linux-x64-musl.node') + ) + try { + if (localFileExisted) { + nativeBinding = require('./desktop_native.linux-x64-musl.node') + } else { + nativeBinding = require('@bitwarden/desktop-native-linux-x64-musl') } + } catch (e) { + loadError = e } break case 'arm64': - if (isMusl()) { - localFileExisted = existsSync( - join(__dirname, 'desktop_native.linux-arm64-musl.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./desktop_native.linux-arm64-musl.node') - } else { - nativeBinding = require('@bitwarden/desktop_native-linux-arm64-musl') - } - } catch (e) { - loadError = e - } - } else { - localFileExisted = existsSync( - join(__dirname, 'desktop_native.linux-arm64-gnu.node') - ) - try { - if (localFileExisted) { - nativeBinding = require('./desktop_native.linux-arm64-gnu.node') - } else { - nativeBinding = require('@bitwarden/desktop_native-linux-arm64-gnu') - } - } catch (e) { - loadError = e + localFileExisted = existsSync( + join(__dirname, 'desktop_native.linux-arm64-musl.node') + ) + try { + if (localFileExisted) { + nativeBinding = require('./desktop_native.linux-arm64-musl.node') + } else { + nativeBinding = require('@bitwarden/desktop-native-linux-arm64-musl') } + } catch (e) { + loadError = e } break case 'arm': @@ -215,7 +185,7 @@ switch (platform) { if (localFileExisted) { nativeBinding = require('./desktop_native.linux-arm-gnueabihf.node') } else { - nativeBinding = require('@bitwarden/desktop_native-linux-arm-gnueabihf') + nativeBinding = require('@bitwarden/desktop-native-linux-arm-gnueabihf') } } catch (e) { loadError = e @@ -236,6 +206,7 @@ if (!nativeBinding) { throw new Error(`Failed to load native binding`) } -const { passwords } = nativeBinding +const { passwords, biometrics } = nativeBinding module.exports.passwords = passwords +module.exports.biometrics = biometrics diff --git a/apps/desktop/desktop_native/package-lock.json b/apps/desktop/desktop_native/package-lock.json deleted file mode 100644 index 70e590de3d0..00000000000 --- a/apps/desktop/desktop_native/package-lock.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@bitwarden/desktop_native", - "version": "0.1.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "@bitwarden/desktop_native", - "version": "0.1.0", - "hasInstallScript": true, - "license": "GPL-3.0", - "devDependencies": { - "@napi-rs/cli": "^2.6.2" - } - }, - "node_modules/@napi-rs/cli": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/@napi-rs/cli/-/cli-2.6.2.tgz", - "integrity": "sha512-EmH+DQDEBUIoqMim0cc+X96ImtcIZLFjgW5WWORpzYnA9Ug7zNPO7jCLMhIQRd/p5AdWaXrT4SVXc/aip09rKQ==", - "dev": true, - "bin": { - "napi": "scripts/index.js" - }, - "engines": { - "node": ">= 10" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Brooooooklyn" - } - } - }, - "dependencies": { - "@napi-rs/cli": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/@napi-rs/cli/-/cli-2.6.2.tgz", - "integrity": "sha512-EmH+DQDEBUIoqMim0cc+X96ImtcIZLFjgW5WWORpzYnA9Ug7zNPO7jCLMhIQRd/p5AdWaXrT4SVXc/aip09rKQ==", - "dev": true - } - } -} diff --git a/apps/desktop/desktop_native/package.json b/apps/desktop/desktop_native/package.json index 97f12ce0bfa..ef5a7f0da66 100644 --- a/apps/desktop/desktop_native/package.json +++ b/apps/desktop/desktop_native/package.json @@ -1,11 +1,10 @@ { - "name": "@bitwarden/desktop_native", + "name": "@bitwarden/desktop-native", "version": "0.1.0", "description": "", - "main": "index.node", "scripts": { - "build": "napi build --release --platform", - "build:debug": "napi build --platform", + "build": "napi build --release --platform --js false", + "build:debug": "napi build --platform --js false", "build:cross-platform": "node build.js", "test": "cargo test" }, diff --git a/apps/desktop/desktop_native/src/biometric/macos.rs b/apps/desktop/desktop_native/src/biometric/macos.rs new file mode 100644 index 00000000000..3401b7f6da9 --- /dev/null +++ b/apps/desktop/desktop_native/src/biometric/macos.rs @@ -0,0 +1,9 @@ +use anyhow::{Result, bail}; + +pub fn prompt(_hwnd: Vec, _message: String) -> Result { + bail!("platform not supported"); +} + +pub fn available() -> Result { + bail!("platform not supported"); +} diff --git a/apps/desktop/desktop_native/src/biometric/mod.rs b/apps/desktop/desktop_native/src/biometric/mod.rs new file mode 100644 index 00000000000..5ad1403f44f --- /dev/null +++ b/apps/desktop/desktop_native/src/biometric/mod.rs @@ -0,0 +1,5 @@ +#[cfg_attr(target_os = "linux", path = "unix.rs")] +#[cfg_attr(target_os = "windows", path = "windows.rs")] +#[cfg_attr(target_os = "macos", path = "macos.rs")] +mod biometric; +pub use biometric::*; diff --git a/apps/desktop/desktop_native/src/biometric/unix.rs b/apps/desktop/desktop_native/src/biometric/unix.rs new file mode 100644 index 00000000000..3401b7f6da9 --- /dev/null +++ b/apps/desktop/desktop_native/src/biometric/unix.rs @@ -0,0 +1,9 @@ +use anyhow::{Result, bail}; + +pub fn prompt(_hwnd: Vec, _message: String) -> Result { + bail!("platform not supported"); +} + +pub fn available() -> Result { + bail!("platform not supported"); +} diff --git a/apps/desktop/desktop_native/src/biometric/windows.rs b/apps/desktop/desktop_native/src/biometric/windows.rs new file mode 100644 index 00000000000..d956da064d0 --- /dev/null +++ b/apps/desktop/desktop_native/src/biometric/windows.rs @@ -0,0 +1,51 @@ +use anyhow::Result; +use windows::{ + core::factory, Foundation::IAsyncOperation, Security::Credentials::UI::*, + Win32::Foundation::HWND, Win32::System::WinRT::IUserConsentVerifierInterop, +}; + +pub fn prompt(hwnd: Vec, message: String) -> Result { + let interop = factory::()?; + + let h = isize::from_le_bytes(hwnd.try_into().unwrap()); + let window = HWND(h); + + let operation: IAsyncOperation = + unsafe { interop.RequestVerificationForWindowAsync(window, message)? }; + + let result: UserConsentVerificationResult = operation.get()?; + + match result { + UserConsentVerificationResult::Verified => Ok(true), + _ => Ok(false), + } +} + +pub fn available() -> Result { + let ucv_available = UserConsentVerifier::CheckAvailabilityAsync()?.get()?; + + match ucv_available { + UserConsentVerifierAvailability::Available => Ok(true), + UserConsentVerifierAvailability::DeviceBusy => Ok(true), // TODO: Look into removing this and making the check more ad-hoc + _ => Ok(false), + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_prompt() { + prompt( + vec![0, 0, 0, 0, 0, 0, 0, 0], + String::from("Hello from Rust"), + ) + .unwrap(); + } + + #[test] + fn test_available() { + assert!(available().unwrap()) + } +} diff --git a/apps/desktop/desktop_native/src/lib.rs b/apps/desktop/desktop_native/src/lib.rs index 96417a8bb51..1906dccb399 100644 --- a/apps/desktop/desktop_native/src/lib.rs +++ b/apps/desktop/desktop_native/src/lib.rs @@ -1,6 +1,7 @@ #[macro_use] extern crate napi_derive; +mod biometric; mod password; #[napi] @@ -37,3 +38,21 @@ pub mod passwords { .map_err(|e| napi::Error::from_reason(e.to_string())) } } + +#[napi] +pub mod biometrics { + // Prompt for biometric confirmation + #[napi] + pub async fn prompt( + hwnd: napi::bindgen_prelude::Buffer, + message: String, + ) -> napi::Result { + super::biometric::prompt(hwnd.into(), message) + .map_err(|e| napi::Error::from_reason(e.to_string())) + } + + #[napi] + pub async fn available() -> napi::Result { + super::biometric::available().map_err(|e| napi::Error::from_reason(e.to_string())) + } +} diff --git a/apps/desktop/electron-builder.json b/apps/desktop/electron-builder.json index b6211e8cdac..63478418d31 100644 --- a/apps/desktop/electron-builder.json +++ b/apps/desktop/electron-builder.json @@ -13,7 +13,12 @@ }, "afterSign": "scripts/after-sign.js", "asarUnpack": ["**/*.node"], - "files": ["**/*", "!**/node_modules/@bitwarden/desktop-native/**/*"], + "files": [ + "**/*", + "!**/node_modules/@bitwarden/desktop-native/**/*", + "**/node_modules/@bitwarden/desktop-native/index.js", + "**/node_modules/@bitwarden/desktop-native/desktop_native.${platform}-${arch}*.node" + ], "electronVersion": "19.0.8", "generateUpdatesFilesForAllChannels": true, "publish": { diff --git a/apps/desktop/src/app/accounts/accessibility-cookie.component.ts b/apps/desktop/src/app/accounts/accessibility-cookie.component.ts index a1b4d3afa73..6993b17077e 100644 --- a/apps/desktop/src/app/accounts/accessibility-cookie.component.ts +++ b/apps/desktop/src/app/accounts/accessibility-cookie.component.ts @@ -1,5 +1,5 @@ import { Component, NgZone } from "@angular/core"; -import { FormControl, FormGroup, Validators } from "@angular/forms"; +import { UntypedFormControl, UntypedFormGroup, Validators } from "@angular/forms"; import { Router } from "@angular/router"; import { BroadcasterService } from "@bitwarden/common/abstractions/broadcaster.service"; @@ -19,8 +19,8 @@ export class AccessibilityCookieComponent { listenForCookie = false; hCaptchaWindow: Window; - accessibilityForm = new FormGroup({ - link: new FormControl("", Validators.required), + accessibilityForm = new UntypedFormGroup({ + link: new UntypedFormControl("", Validators.required), }); constructor( diff --git a/apps/desktop/src/app/accounts/delete-account.component.html b/apps/desktop/src/app/accounts/delete-account.component.html new file mode 100644 index 00000000000..1371cee162f --- /dev/null +++ b/apps/desktop/src/app/accounts/delete-account.component.html @@ -0,0 +1,38 @@ + diff --git a/apps/desktop/src/app/accounts/delete-account.component.ts b/apps/desktop/src/app/accounts/delete-account.component.ts new file mode 100644 index 00000000000..c708ba57416 --- /dev/null +++ b/apps/desktop/src/app/accounts/delete-account.component.ts @@ -0,0 +1,48 @@ +import { Component } from "@angular/core"; +import { FormBuilder } from "@angular/forms"; + +import { AccountService } from "@bitwarden/common/abstractions/account/account.service.abstraction"; +import { I18nService } from "@bitwarden/common/abstractions/i18n.service"; +import { LogService } from "@bitwarden/common/abstractions/log.service"; +import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUtils.service"; + +import { Verification } from "../../../../../libs/common/src/types/verification"; + +@Component({ + selector: "app-delete-account", + templateUrl: "delete-account.component.html", +}) +export class DeleteAccountComponent { + formPromise: Promise; + + deleteForm = this.formBuilder.group({ + verification: undefined as Verification | undefined, + }); + + constructor( + private i18nService: I18nService, + private platformUtilsService: PlatformUtilsService, + private formBuilder: FormBuilder, + private accountService: AccountService, + private logService: LogService + ) {} + + get secret() { + return this.deleteForm.get("verification")?.value?.secret; + } + + async submit() { + try { + const verification = this.deleteForm.get("verification").value; + this.formPromise = this.accountService.delete(verification); + await this.formPromise; + this.platformUtilsService.showToast( + "success", + this.i18nService.t("accountDeleted"), + this.i18nService.t("accountDeletedDesc") + ); + } catch (e) { + this.logService.error(e); + } + } +} diff --git a/apps/desktop/src/app/accounts/register.component.html b/apps/desktop/src/app/accounts/register.component.html index 3bdf7d6f6f6..f270ceec1ff 100644 --- a/apps/desktop/src/app/accounts/register.component.html +++ b/apps/desktop/src/app/accounts/register.component.html @@ -18,11 +18,8 @@
@@ -51,17 +47,14 @@ -
-
-
+ + -
-
-
+ +
diff --git a/apps/desktop/src/app/accounts/set-password.component.ts b/apps/desktop/src/app/accounts/set-password.component.ts index d4bd1039504..a445a5328a8 100644 --- a/apps/desktop/src/app/accounts/set-password.component.ts +++ b/apps/desktop/src/app/accounts/set-password.component.ts @@ -50,36 +50,6 @@ export class SetPasswordComponent extends BaseSetPasswordComponent implements On ); } - get masterPasswordScoreWidth() { - return this.masterPasswordScore == null ? 0 : (this.masterPasswordScore + 1) * 20; - } - - get masterPasswordScoreColor() { - switch (this.masterPasswordScore) { - case 4: - return "success"; - case 3: - return "primary"; - case 2: - return "warning"; - default: - return "danger"; - } - } - - get masterPasswordScoreText() { - switch (this.masterPasswordScore) { - case 4: - return this.i18nService.t("strong"); - case 3: - return this.i18nService.t("good"); - case 2: - return this.i18nService.t("weak"); - default: - return this.masterPasswordScore != null ? this.i18nService.t("weak") : null; - } - } - async ngOnInit() { await super.ngOnInit(); this.broadcasterService.subscribe(BroadcasterSubscriptionId, async (message: any) => { diff --git a/apps/desktop/src/app/accounts/settings.component.html b/apps/desktop/src/app/accounts/settings.component.html index e9b509e6be8..f775eb9bb44 100644 --- a/apps/desktop/src/app/accounts/settings.component.html +++ b/apps/desktop/src/app/accounts/settings.component.html @@ -108,6 +108,14 @@ + +
+ + + {{ "deleteAccountDesc" | i18n }} + {{ "deleteAccount" | i18n }} + +
diff --git a/apps/desktop/src/app/accounts/settings.component.ts b/apps/desktop/src/app/accounts/settings.component.ts index e4d2c65c38e..94f49c07f8d 100644 --- a/apps/desktop/src/app/accounts/settings.component.ts +++ b/apps/desktop/src/app/accounts/settings.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from "@angular/core"; -import { FormControl } from "@angular/forms"; +import { UntypedFormControl } from "@angular/forms"; import { debounceTime } from "rxjs/operators"; import { ModalService } from "@bitwarden/angular/services/modal.service"; @@ -18,6 +18,8 @@ import { isWindowsStore } from "@bitwarden/electron/utils"; import { SetPinComponent } from "../components/set-pin.component"; +import { DeleteAccountComponent } from "./delete-account.component"; + @Component({ selector: "app-settings", templateUrl: "settings.component.html", @@ -60,7 +62,7 @@ export class SettingsComponent implements OnInit { startToTrayText: string; startToTrayDescText: string; - vaultTimeout: FormControl = new FormControl(null); + vaultTimeout: UntypedFormControl = new UntypedFormControl(null); showSecurity = true; showAccountPreferences = true; @@ -437,4 +439,8 @@ export class SettingsComponent implements OnInit { this.enableBrowserIntegrationFingerprint ); } + + async openDeleteAccount() { + this.modalService.open(DeleteAccountComponent, { replaceTopModal: true }); + } } diff --git a/apps/desktop/src/app/accounts/update-temp-password.component.html b/apps/desktop/src/app/accounts/update-temp-password.component.html index 6f5772fc6d2..1bba7fcdc4f 100644 --- a/apps/desktop/src/app/accounts/update-temp-password.component.html +++ b/apps/desktop/src/app/accounts/update-temp-password.component.html @@ -16,11 +16,8 @@
@@ -52,17 +48,13 @@ -
-
-
+ + diff --git a/apps/desktop/src/app/accounts/update-temp-password.component.ts b/apps/desktop/src/app/accounts/update-temp-password.component.ts index 8b6ab78404a..d6879e9734b 100644 --- a/apps/desktop/src/app/accounts/update-temp-password.component.ts +++ b/apps/desktop/src/app/accounts/update-temp-password.component.ts @@ -12,46 +12,11 @@ import { PolicyService } from "@bitwarden/common/abstractions/policy.service"; import { StateService } from "@bitwarden/common/abstractions/state.service"; import { SyncService } from "@bitwarden/common/abstractions/sync.service"; -interface MasterPasswordScore { - Color: string; - Text: string; - Width: number; -} - @Component({ selector: "app-update-temp-password", templateUrl: "update-temp-password.component.html", }) export class UpdateTempPasswordComponent extends BaseUpdateTempPasswordComponent { - get masterPasswordScoreStyle(): MasterPasswordScore { - const scoreWidth = this.masterPasswordScore == null ? 0 : (this.masterPasswordScore + 1) * 20; - switch (this.masterPasswordScore) { - case 4: - return { - Color: "bg-success", - Text: "strong", - Width: scoreWidth, - }; - case 3: - return { - Color: "bg-primary", - Text: "good", - Width: scoreWidth, - }; - case 2: - return { - Color: "bg-warning", - Text: "weak", - Width: scoreWidth, - }; - default: - return { - Color: "bg-danger", - Text: "weak", - Width: scoreWidth, - }; - } - } constructor( i18nService: I18nService, platformUtilsService: PlatformUtilsService, diff --git a/apps/desktop/src/app/app.component.ts b/apps/desktop/src/app/app.component.ts index 6e8a132cf81..ebcc86847a9 100644 --- a/apps/desktop/src/app/app.component.ts +++ b/apps/desktop/src/app/app.component.ts @@ -40,6 +40,7 @@ import { CipherType } from "@bitwarden/common/enums/cipherType"; import { MenuUpdateRequest } from "../main/menu/menu.updater"; +import { DeleteAccountComponent } from "./accounts/delete-account.component"; import { PremiumComponent } from "./accounts/premium.component"; import { SettingsComponent } from "./accounts/settings.component"; import { ExportComponent } from "./vault/export.component"; @@ -153,9 +154,7 @@ export class AppComponent implements OnInit { this.systemService.cancelProcessReload(); break; case "loggedOut": - if (this.modal != null) { - this.modal.close(); - } + this.modalService.closeAll(); this.notificationsService.updateConnection(); this.updateAppMenu(); await this.systemService.clearPendingClipboard(); @@ -180,9 +179,7 @@ export class AppComponent implements OnInit { } break; case "locked": - if (this.modal != null) { - this.modal.close(); - } + this.modalService.closeAll(); if ( message.userId == null || message.userId === (await this.stateService.getUserId()) @@ -195,7 +192,7 @@ export class AppComponent implements OnInit { await this.reloadProcess(); break; case "reloadProcess": - window.location.reload(); + (window.location as any).reload(true); break; case "syncStarted": break; @@ -223,6 +220,9 @@ export class AppComponent implements OnInit { } break; } + case "deleteAccount": + this.modalService.open(DeleteAccountComponent, { replaceTopModal: true }); + break; case "openPasswordHistory": await this.openModal( PasswordGeneratorHistoryComponent, @@ -368,9 +368,7 @@ export class AppComponent implements OnInit { } async openExportVault() { - if (this.modal != null) { - this.modal.close(); - } + this.modalService.closeAll(); const [modal, childComponent] = await this.modalService.openViewRef( ExportComponent, @@ -388,9 +386,7 @@ export class AppComponent implements OnInit { } async addFolder() { - if (this.modal != null) { - this.modal.close(); - } + this.modalService.closeAll(); const [modal, childComponent] = await this.modalService.openViewRef( FolderAddEditComponent, @@ -410,9 +406,7 @@ export class AppComponent implements OnInit { } async openGenerator() { - if (this.modal != null) { - this.modal.close(); - } + this.modalService.closeAll(); [this.modal] = await this.modalService.openViewRef( GeneratorComponent, @@ -542,9 +536,7 @@ export class AppComponent implements OnInit { } private async openModal(type: Type, ref: ViewContainerRef) { - if (this.modal != null) { - this.modal.close(); - } + this.modalService.closeAll(); [this.modal] = await this.modalService.openViewRef(type, ref); diff --git a/apps/desktop/src/app/app.module.ts b/apps/desktop/src/app/app.module.ts index 23e44d85a2a..a7e46b711ab 100644 --- a/apps/desktop/src/app/app.module.ts +++ b/apps/desktop/src/app/app.module.ts @@ -57,6 +57,7 @@ import localeZhTw from "@angular/common/locales/zh-Hant"; import { NgModule } from "@angular/core"; import { AccessibilityCookieComponent } from "./accounts/accessibility-cookie.component"; +import { DeleteAccountComponent } from "./accounts/delete-account.component"; import { EnvironmentComponent } from "./accounts/environment.component"; import { HintComponent } from "./accounts/hint.component"; import { LockComponent } from "./accounts/lock.component"; @@ -165,6 +166,7 @@ registerLocaleData(localeZhTw, "zh-TW"); AttachmentsComponent, CiphersComponent, CollectionsComponent, + DeleteAccountComponent, EnvironmentComponent, ExportComponent, FolderAddEditComponent, diff --git a/apps/desktop/src/app/components/set-pin.component.html b/apps/desktop/src/app/components/set-pin.component.html index 5bd50bbc352..4c23ad3dde2 100644 --- a/apps/desktop/src/app/components/set-pin.component.html +++ b/apps/desktop/src/app/components/set-pin.component.html @@ -53,7 +53,7 @@
diff --git a/apps/web/src/app/accounts/two-factor.component.ts b/apps/web/src/app/accounts/two-factor.component.ts index 57ec40a2a44..1d9b19af213 100644 --- a/apps/web/src/app/accounts/two-factor.component.ts +++ b/apps/web/src/app/accounts/two-factor.component.ts @@ -14,7 +14,7 @@ import { StateService } from "@bitwarden/common/abstractions/state.service"; import { TwoFactorService } from "@bitwarden/common/abstractions/twoFactor.service"; import { TwoFactorProviderType } from "@bitwarden/common/enums/twoFactorProviderType"; -import { RouterService } from "../services/router.service"; +import { RouterService } from "../core"; import { TwoFactorOptionsComponent } from "./two-factor-options.component"; diff --git a/apps/web/src/app/accounts/update-password.component.html b/apps/web/src/app/accounts/update-password.component.html index 46bf988d9b9..bf32967c0ee 100644 --- a/apps/web/src/app/accounts/update-password.component.html +++ b/apps/web/src/app/accounts/update-password.component.html @@ -44,13 +44,13 @@ name="NewMasterPasswordHash" class="form-control mb-1" [(ngModel)]="masterPassword" - (input)="updatePasswordStrength()" required appInputVerbatim autocomplete="new-password" />
diff --git a/apps/web/src/app/accounts/update-temp-password.component.html b/apps/web/src/app/accounts/update-temp-password.component.html index 27e8a4ec104..ea7dc8c3a94 100644 --- a/apps/web/src/app/accounts/update-temp-password.component.html +++ b/apps/web/src/app/accounts/update-temp-password.component.html @@ -21,11 +21,14 @@ name="MasterPasswordHash" class="text-monospace form-control mb-1" [(ngModel)]="masterPassword" - (input)="updatePasswordStrength()" required appInputVerbatim /> - +
diff --git a/apps/web/src/app/app.component.ts b/apps/web/src/app/app.component.ts index 7c02076191c..af232655ad6 100644 --- a/apps/web/src/app/app.component.ts +++ b/apps/web/src/app/app.component.ts @@ -26,6 +26,7 @@ import { StateService } from "@bitwarden/common/abstractions/state.service"; import { SyncService } from "@bitwarden/common/abstractions/sync.service"; import { VaultTimeoutService } from "@bitwarden/common/abstractions/vaultTimeout.service"; +import { PolicyListService, RouterService } from "./core"; import { DisableSendPolicy } from "./organizations/policies/disable-send.component"; import { MasterPasswordPolicy } from "./organizations/policies/master-password.component"; import { PasswordGeneratorPolicy } from "./organizations/policies/password-generator.component"; @@ -35,8 +36,6 @@ import { ResetPasswordPolicy } from "./organizations/policies/reset-password.com import { SendOptionsPolicy } from "./organizations/policies/send-options.component"; import { SingleOrgPolicy } from "./organizations/policies/single-org.component"; import { TwoFactorAuthenticationPolicy } from "./organizations/policies/two-factor-authentication.component"; -import { PolicyListService } from "./services/policy-list.service"; -import { RouterService } from "./services/router.service"; const BroadcasterSubscriptionId = "AppComponent"; const IdleTimeout = 60000 * 10; // 10 minutes @@ -152,7 +151,7 @@ export class AppComponent implements OnDestroy, OnInit { this.i18nService.t("cancel") ); if (premiumConfirmed) { - this.router.navigate(["settings/premium"]); + this.router.navigate(["settings/subscription/premium"]); } break; } diff --git a/apps/web/src/app/app.module.ts b/apps/web/src/app/app.module.ts index b23c4d182eb..5d1afd21224 100644 --- a/apps/web/src/app/app.module.ts +++ b/apps/web/src/app/app.module.ts @@ -6,9 +6,9 @@ import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; import { InfiniteScrollModule } from "ngx-infinite-scroll"; import { AppComponent } from "./app.component"; +import { CoreModule } from "./core"; import { OssRoutingModule } from "./oss-routing.module"; import { OssModule } from "./oss.module"; -import { ServicesModule } from "./services/services.module"; import { WildcardRoutingModule } from "./wildcard-routing.module"; @NgModule({ @@ -16,7 +16,7 @@ import { WildcardRoutingModule } from "./wildcard-routing.module"; OssModule, BrowserAnimationsModule, FormsModule, - ServicesModule, + CoreModule, InfiniteScrollModule, DragDropModule, LayoutModule, diff --git a/apps/web/src/app/common/base.events.component.ts b/apps/web/src/app/common/base.events.component.ts index 7bc1a94c173..d7368a3f463 100644 --- a/apps/web/src/app/common/base.events.component.ts +++ b/apps/web/src/app/common/base.events.component.ts @@ -9,7 +9,7 @@ import { EventResponse } from "@bitwarden/common/models/response/eventResponse"; import { ListResponse } from "@bitwarden/common/models/response/listResponse"; import { EventView } from "@bitwarden/common/models/view/eventView"; -import { EventService } from "src/app/services/event.service"; +import { EventService } from "src/app/core"; @Directive() export abstract class BaseEventsComponent { diff --git a/apps/web/src/app/common/base.people.component.ts b/apps/web/src/app/common/base.people.component.ts index 24344890868..b1aab35b322 100644 --- a/apps/web/src/app/common/base.people.component.ts +++ b/apps/web/src/app/common/base.people.component.ts @@ -55,9 +55,9 @@ export abstract class BasePeopleComponent< : 0; } - get deactivatedCount() { - return this.statusMap.has(this.userStatusType.Deactivated) - ? this.statusMap.get(this.userStatusType.Deactivated).length + get revokedCount() { + return this.statusMap.has(this.userStatusType.Revoked) + ? this.statusMap.get(this.userStatusType.Revoked).length : 0; } @@ -112,8 +112,8 @@ export abstract class BasePeopleComponent< abstract edit(user: UserType): void; abstract getUsers(): Promise>; abstract deleteUser(id: string): Promise; - abstract deactivateUser(id: string): Promise; - abstract activateUser(id: string): Promise; + abstract revokeUser(id: string): Promise; + abstract restoreUser(id: string): Promise; abstract reinviteUser(id: string): Promise; abstract confirmUser(user: UserType, publicKey: Uint8Array): Promise; @@ -133,7 +133,7 @@ export abstract class BasePeopleComponent< } else { this.statusMap.get(u.status).push(u); } - if (u.status !== this.userStatusType.Deactivated) { + if (u.status !== this.userStatusType.Revoked) { this.activeUsers.push(u); } }); @@ -235,9 +235,9 @@ export abstract class BasePeopleComponent< this.actionPromise = null; } - async deactivate(user: UserType) { + async revoke(user: UserType) { const confirmed = await this.platformUtilsService.showDialog( - this.deactivateWarningMessage(), + this.revokeWarningMessage(), this.i18nService.t("revokeUserId", this.userNamePipe.transform(user)), this.i18nService.t("revokeAccess"), this.i18nService.t("cancel"), @@ -248,7 +248,7 @@ export abstract class BasePeopleComponent< return false; } - this.actionPromise = this.deactivateUser(user.id); + this.actionPromise = this.revokeUser(user.id); try { await this.actionPromise; this.platformUtilsService.showToast( @@ -263,8 +263,8 @@ export abstract class BasePeopleComponent< this.actionPromise = null; } - async activate(user: UserType) { - this.actionPromise = this.activateUser(user.id); + async restore(user: UserType) { + this.actionPromise = this.restoreUser(user.id); try { await this.actionPromise; this.platformUtilsService.showToast( @@ -381,18 +381,10 @@ export abstract class BasePeopleComponent< return !searching && this.users && this.users.length > this.pageSize; } - protected deleteWarningMessage(user: UserType): string { - return this.i18nService.t("removeUserConfirmation"); - } - - protected deactivateWarningMessage(): string { + protected revokeWarningMessage(): string { return this.i18nService.t("revokeUserConfirmation"); } - protected activateWarningMessage(): string { - return this.i18nService.t("activateUserConfirmation"); - } - protected getCheckedUsers() { return this.users.filter((u) => (u as any).checked); } diff --git a/apps/web/src/app/components/organization-switcher.component.html b/apps/web/src/app/components/organization-switcher.component.html index 221985a6cff..cd003ae247e 100644 --- a/apps/web/src/app/components/organization-switcher.component.html +++ b/apps/web/src/app/components/organization-switcher.component.html @@ -1,6 +1,6 @@
-
+
@@ -59,7 +59,7 @@ >
{{ "loggedInAs" | i18n }} - {{ + {{ name }}
diff --git a/apps/web/src/app/modules/loose-components.module.ts b/apps/web/src/app/modules/loose-components.module.ts index 251ce42c5d7..e63bee9da8a 100644 --- a/apps/web/src/app/modules/loose-components.module.ts +++ b/apps/web/src/app/modules/loose-components.module.ts @@ -31,8 +31,8 @@ import { NavbarComponent } from "../layouts/navbar.component"; import { UserLayoutComponent } from "../layouts/user-layout.component"; import { OrganizationLayoutComponent } from "../organizations/layouts/organization-layout.component"; import { BulkConfirmComponent as OrgBulkConfirmComponent } from "../organizations/manage/bulk/bulk-confirm.component"; -import { BulkDeactivateComponent as OrgBulkDeactivateomponent } from "../organizations/manage/bulk/bulk-deactivate.component"; import { BulkRemoveComponent as OrgBulkRemoveComponent } from "../organizations/manage/bulk/bulk-remove.component"; +import { BulkRestoreRevokeComponent as OrgBulkRestoreRevokeComponent } from "../organizations/manage/bulk/bulk-restore-revoke.component"; import { BulkStatusComponent as OrgBulkStatusComponent } from "../organizations/manage/bulk/bulk-status.component"; import { CollectionAddEditComponent as OrgCollectionAddEditComponent } from "../organizations/manage/collection-add-edit.component"; import { CollectionsComponent as OrgManageCollectionsComponent } from "../organizations/manage/collections.component"; @@ -239,7 +239,7 @@ import { OrganizationBadgeModule } from "./vault/modules/organization-badge/orga OrganizationSubscriptionComponent, OrgAttachmentsComponent, OrgBulkConfirmComponent, - OrgBulkDeactivateomponent, + OrgBulkRestoreRevokeComponent, OrgBulkRemoveComponent, OrgBulkStatusComponent, OrgCiphersComponent, @@ -394,7 +394,7 @@ import { OrganizationBadgeModule } from "./vault/modules/organization-badge/orga OrganizationSubscriptionComponent, OrgAttachmentsComponent, OrgBulkConfirmComponent, - OrgBulkDeactivateomponent, + OrgBulkRestoreRevokeComponent, OrgBulkRemoveComponent, OrgBulkStatusComponent, OrgCiphersComponent, diff --git a/apps/web/src/app/modules/organizations/create/organization-information.component.ts b/apps/web/src/app/modules/organizations/create/organization-information.component.ts index bd59a472ed9..99cb3102aa3 100644 --- a/apps/web/src/app/modules/organizations/create/organization-information.component.ts +++ b/apps/web/src/app/modules/organizations/create/organization-information.component.ts @@ -1,5 +1,5 @@ import { Component, EventEmitter, Input, Output } from "@angular/core"; -import { FormGroup } from "@angular/forms"; +import { UntypedFormGroup } from "@angular/forms"; @Component({ selector: "app-org-info", @@ -10,6 +10,6 @@ export class OrganizationInformationComponent { @Input() createOrganization = true; @Input() isProvider = false; @Input() acceptingSponsorship = false; - @Input() formGroup: FormGroup; + @Input() formGroup: UntypedFormGroup; @Output() changedBusinessOwned = new EventEmitter(); } diff --git a/apps/web/src/app/modules/register-form/register-form.component.html b/apps/web/src/app/modules/register-form/register-form.component.html index 21d5772677a..e147f463cb6 100644 --- a/apps/web/src/app/modules/register-form/register-form.component.html +++ b/apps/web/src/app/modules/register-form/register-form.component.html @@ -34,7 +34,6 @@ @@ -50,7 +49,13 @@ {{ "masterPassImportant" | i18n }} - +
@@ -85,11 +90,11 @@
-
-
+
+
-
+
{{ "createAccount" | i18n }} {{ "logIn" | i18n }} diff --git a/apps/web/src/app/modules/register-form/register-form.component.ts b/apps/web/src/app/modules/register-form/register-form.component.ts index 519a185fa13..30f71601789 100644 --- a/apps/web/src/app/modules/register-form/register-form.component.ts +++ b/apps/web/src/app/modules/register-form/register-form.component.ts @@ -1,5 +1,5 @@ import { Component, Input } from "@angular/core"; -import { FormBuilder } from "@angular/forms"; +import { UntypedFormBuilder } from "@angular/forms"; import { Router } from "@angular/router"; import { RegisterComponent as BaseRegisterComponent } from "@bitwarden/angular/components/register.component"; @@ -28,7 +28,7 @@ export class RegisterFormComponent extends BaseRegisterComponent { constructor( formValidationErrorService: FormValidationErrorsService, - formBuilder: FormBuilder, + formBuilder: UntypedFormBuilder, authService: AuthService, router: Router, i18nService: I18nService, @@ -69,7 +69,7 @@ export class RegisterFormComponent extends BaseRegisterComponent { if ( this.enforcedPolicyOptions != null && !this.policyService.evaluateMasterPassword( - this.masterPasswordScore, + this.passwordStrengthResult.score, this.formGroup.get("masterPassword")?.value, this.enforcedPolicyOptions ) diff --git a/apps/web/src/app/modules/shared.module.ts b/apps/web/src/app/modules/shared.module.ts index 79f967f23a7..10469e94235 100644 --- a/apps/web/src/app/modules/shared.module.ts +++ b/apps/web/src/app/modules/shared.module.ts @@ -66,7 +66,6 @@ import { MenuModule, } from "@bitwarden/components"; -import { PasswordStrengthComponent } from "../components/password-strength.component"; import { PaymentComponent } from "../settings/payment.component"; import { TaxInfoComponent } from "../settings/tax-info.component"; @@ -122,7 +121,7 @@ registerLocaleData(localeZhCn, "zh-CN"); registerLocaleData(localeZhTw, "zh-TW"); @NgModule({ - declarations: [PasswordStrengthComponent, PaymentComponent, TaxInfoComponent], + declarations: [PaymentComponent, TaxInfoComponent], imports: [ CommonModule, DragDropModule, @@ -158,7 +157,6 @@ registerLocaleData(localeZhTw, "zh-TW"); MenuModule, FormFieldModule, SubmitButtonModule, - PasswordStrengthComponent, PaymentComponent, TaxInfoComponent, ], diff --git a/apps/web/src/app/modules/trial-initiation/billing.component.html b/apps/web/src/app/modules/trial-initiation/billing.component.html index 949220bad51..4486d0672dd 100644 --- a/apps/web/src/app/modules/trial-initiation/billing.component.html +++ b/apps/web/src/app/modules/trial-initiation/billing.component.html @@ -1,12 +1,12 @@
-

{{ "billingPlanLabel" | i18n }}

-
-