diff --git a/.eslintignore b/.eslintignore index 1a4673e357..4e2b3a58fd 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 aae0348923..a1229db88a 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 ee56ed5be4..7a355f997a 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 ee571b2592..78a7c5f79d 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 6f3ffb1257..26144ff9c9 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 da8780599c..4cb10afb9d 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 31b5f058c8..0ce438d0d4 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 b898955709..832178af0c 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 f6fd411a24..b230fc92ed 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 d72783ec48..d9a3fa3c1b 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 1db2b6dbe2..665be527c0 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 0000000000..4c1b0f6e8f --- /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 060835ac98..2e389245b2 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 8f0e568829..0a23f5ce73 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 a55b6597e4..80262bdf27 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 4697fb7423..4e20f2294d 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 7c3890aaf6..7edf2dbf05 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 b34f758e33..ac9273793d 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 cfc66fe02b..6f359c9558 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 d3796e78a7..b5991be4ce 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 8303cb5151..415bfee3f7 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 626c5b7b3e..a23de6ff56 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 b4fbfdc05a..828af9c558 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 2fb6907dcc..5f80204a27 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 04e6eb1e10..ed47940875 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 d82d214fb2..281df83509 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 4c8ec89aac..39a6321f92 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 e04b769df9..c30a60119e 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 ae8bef7264..1be18d3df9 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 e57ad7d178..ed69809735 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 8d5d8a0e3b..9a30bd23da 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 74a2605b75..9ff96f048b 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 c8f0da65b5..7d718b8664 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 3fea4094d6..fb1ba6b801 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 72c79e7cb7..92c02ee3b3 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 c2f9031759..d3c9e01fdc 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 3999f6fb88..b8aa391f0f 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 23e2e22789..5052501d57 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 877710438c..8f9874faa7 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 a12fd370d2..fad784da6b 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 c7f4bb5042..af601fad2c 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 f64837cc73..fd04967b91 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 d6b8756866..340e7db8dd 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 35d7b08261..d8bcf9a029 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 f4cfd9f4bc..c1029abffb 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 009b7089ba..73a28bb252 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 7e6d6e38af..ad1447f6f6 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 8f3ddb96ac..273df1e22d 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 c5d7edae95..e5b3d542e3 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 1a36c9506f..cd9ecdd9ea 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 133ba88a2c..eb25e6d946 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 fe0391772c..6c217a7569 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 ae3c35f00c..bcd5a831f4 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 58337d06d7..dcec777347 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 0000000000..b58e89798b --- /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 dbc2760295..0c990fe622 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 ca42f7b0c2..a6fc633afd 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 6ac55a1558..023c7eccac 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 8866118c01..8b48ac9940 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 70e590de3d..0000000000 --- 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 97f12ce0bf..ef5a7f0da6 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 0000000000..3401b7f6da --- /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 0000000000..5ad1403f44 --- /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 0000000000..3401b7f6da --- /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 0000000000..d956da064d --- /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 96417a8bb5..1906dccb39 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 b6211e8cda..63478418d3 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 a1b4d3afa7..6993b17077 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 0000000000..1371cee162 --- /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 0000000000..c708ba5741 --- /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 3bdf7d6f6f..f270ceec1f 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 d4bd103950..a445a5328a 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 e9b509e6be..f775eb9bb4 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 e4d2c65c38..94f49c07f8 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 6f5772fc6d..1bba7fcdc4 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 8b6ab78404..d6879e9734 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 6e8a132cf8..ebcc86847a 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 23e44d85a2..a7e46b711a 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 5bd50bbc35..4c23ad3dde 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 57ec40a2a4..1d9b19af21 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 46bf988d9b..bf32967c0e 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 27e8a4ec10..ea7dc8c3a9 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 7c02076191..af232655ad 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 b23c4d182e..5d1afd2122 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 7bc1a94c17..d7368a3f46 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 2434489086..b1aab35b32 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 221985a6cf..cd003ae247 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 251ce42c5d..e63bee9da8 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 bd59a472ed..99cb3102aa 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 21d5772677..e147f463cb 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 519a185fa1..30f7160178 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 79f967f23a..10469e9423 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 949220bad5..4486d0672d 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 }}

-
-