mirror of
https://github.com/bitwarden/web
synced 2025-12-18 17:23:24 +00:00
Compare commits
77 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
36e64bfd48 | ||
|
|
fae0d44b29 | ||
|
|
6f266c44d3 | ||
|
|
1b8cc3ae87 | ||
|
|
7f77a4ee76 | ||
|
|
709d187498 | ||
|
|
392e29a371 | ||
|
|
77a401a931 | ||
|
|
f0678418d5 | ||
|
|
3857ee2370 | ||
|
|
9bdda9cc4c | ||
|
|
2b0d3f9e0d | ||
|
|
75b0b7a1e1 | ||
|
|
ebbdea8f88 | ||
|
|
7844c23fba | ||
|
|
a34844511c | ||
|
|
44f624e9a6 | ||
|
|
2c1b06a5d8 | ||
|
|
a23c2523d2 | ||
|
|
f6df9983a3 | ||
|
|
8ebefb9a2e | ||
|
|
9fabdbd0a1 | ||
|
|
18aeeef6fe | ||
|
|
aafcc88162 | ||
|
|
5a3bd22132 | ||
|
|
4119713ace | ||
|
|
851a53ec31 | ||
|
|
686c0e854f | ||
|
|
a73cbbb672 | ||
|
|
2b5f61cadd | ||
|
|
35d6a28c94 | ||
|
|
d31150c7a1 | ||
|
|
218259fc7e | ||
|
|
c608a489dd | ||
|
|
a94faf06a9 | ||
|
|
ebe08535e0 | ||
|
|
5e7e035eec | ||
|
|
d85ee9780f | ||
|
|
87d37dd29e | ||
|
|
ba6d61a510 | ||
|
|
623e485641 | ||
|
|
86e6c31820 | ||
|
|
731e191011 | ||
|
|
cc2b717d6b | ||
|
|
41ad5aa26d | ||
|
|
7c9ebed93f | ||
|
|
e1e2edf2e9 | ||
|
|
aa633480a0 | ||
|
|
324b74d5a6 | ||
|
|
c494cab234 | ||
|
|
1320a7c8cb | ||
|
|
e7f3d977c4 | ||
|
|
b304783a7f | ||
|
|
ae091bd738 | ||
|
|
81dfcca06c | ||
|
|
1d22cd05f7 | ||
|
|
5939898b75 | ||
|
|
7b17ba1dee | ||
|
|
2656fb8db3 | ||
|
|
4b85e4b765 | ||
|
|
57f952bc66 | ||
|
|
ef331aba0b | ||
|
|
d510b35c06 | ||
|
|
f74c296ad5 | ||
|
|
f8a7439675 | ||
|
|
d6d71c94f5 | ||
|
|
34cb26416c | ||
|
|
988f4168a0 | ||
|
|
76210c30a8 | ||
|
|
c1a7b85f8b | ||
|
|
44bf90cf6a | ||
|
|
7c64c812fc | ||
|
|
f2c9c9ebbb | ||
|
|
14e9784297 | ||
|
|
b8aff13ce2 | ||
|
|
3e2e7b8622 | ||
|
|
c3f128182c |
119
.github/workflows/build.yml
vendored
119
.github/workflows/build.yml
vendored
@@ -1,6 +1,11 @@
|
|||||||
name: build
|
name: Build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
custom_tag_extension:
|
||||||
|
description: "Custom image tag extension"
|
||||||
|
required: false
|
||||||
push:
|
push:
|
||||||
branches-ignore:
|
branches-ignore:
|
||||||
- 'l10n_master'
|
- 'l10n_master'
|
||||||
@@ -8,6 +13,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
cloc:
|
cloc:
|
||||||
|
name: CLOC
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
@@ -21,7 +27,9 @@ jobs:
|
|||||||
- name: Print lines of code
|
- name: Print lines of code
|
||||||
run: cloc --include-lang TypeScript,JavaScript,HTML,Sass,CSS --vcs git
|
run: cloc --include-lang TypeScript,JavaScript,HTML,Sass,CSS --vcs git
|
||||||
|
|
||||||
ubuntu:
|
|
||||||
|
build-selfhost:
|
||||||
|
name: Build SelfHost Docker image
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Node
|
- name: Set up Node
|
||||||
@@ -33,6 +41,13 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
npm install -g npm@7
|
npm install -g npm@7
|
||||||
|
|
||||||
|
- name: Cache npm
|
||||||
|
id: npm-cache
|
||||||
|
uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # v2.1.6
|
||||||
|
with:
|
||||||
|
path: '~/.npm'
|
||||||
|
key: ${{ runner.os }}-${{ github.run_id }}-npm-${{ hashFiles('**/package-lock.json') }}
|
||||||
|
|
||||||
- name: Print environment
|
- name: Print environment
|
||||||
run: |
|
run: |
|
||||||
whoami
|
whoami
|
||||||
@@ -83,12 +98,14 @@ jobs:
|
|||||||
- name: Restore
|
- name: Restore
|
||||||
run: dotnet tool restore
|
run: dotnet tool restore
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm install
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
echo -e "# Building Web\n"
|
echo -e "# Building Web\n"
|
||||||
echo "Building app"
|
echo "Building app"
|
||||||
echo "npm version $(npm --version)"
|
echo "npm version $(npm --version)"
|
||||||
npm install
|
|
||||||
npm run dist:selfhost
|
npm run dist:selfhost
|
||||||
|
|
||||||
echo -e "\nBuilding Docker image"
|
echo -e "\nBuilding Docker image"
|
||||||
@@ -125,7 +142,103 @@ jobs:
|
|||||||
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
|
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
|
||||||
run: docker logout
|
run: docker logout
|
||||||
|
|
||||||
|
|
||||||
|
build-qa:
|
||||||
|
name: Build QA Docker image
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Set up Node
|
||||||
|
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
|
||||||
|
with:
|
||||||
|
node-version: '14'
|
||||||
|
|
||||||
|
- name: Update NPM
|
||||||
|
run: |
|
||||||
|
npm install -g npm@7
|
||||||
|
|
||||||
|
- name: Cache npm
|
||||||
|
id: npm-cache
|
||||||
|
uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # v2.1.6
|
||||||
|
with:
|
||||||
|
path: '~/.npm'
|
||||||
|
key: ${{ runner.os }}-${{ github.run_id }}-npm-${{ hashFiles('**/package-lock.json') }}
|
||||||
|
|
||||||
|
- name: Print environment
|
||||||
|
run: |
|
||||||
|
whoami
|
||||||
|
node --version
|
||||||
|
npm --version
|
||||||
|
gulp --version
|
||||||
|
docker --version
|
||||||
|
echo "GitHub ref: $GITHUB_REF"
|
||||||
|
echo "GitHub event: $GITHUB_EVENT"
|
||||||
|
|
||||||
|
- name: Login to Azure
|
||||||
|
uses: Azure/login@77f1b2e3fb80c0e8645114159d17008b8a2e475a
|
||||||
|
with:
|
||||||
|
creds: ${{ secrets.AZURE_QA_KV_CREDENTIALS }}
|
||||||
|
|
||||||
|
- name: Log into container registry
|
||||||
|
run: az acr login -n bitwardenqa
|
||||||
|
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||||
|
|
||||||
|
- name: Restore
|
||||||
|
run: dotnet tool restore
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
echo -e "# Building Web\n"
|
||||||
|
echo "Building app"
|
||||||
|
echo "npm version $(npm --version)"
|
||||||
|
npm run build:qa
|
||||||
|
|
||||||
|
echo -e "\nBuilding Docker image"
|
||||||
|
docker --version
|
||||||
|
docker build -t bitwardenqa.azurecr.io/web .
|
||||||
|
|
||||||
|
- name: Get image tag
|
||||||
|
id: image_tag
|
||||||
|
run: |
|
||||||
|
IMAGE_TAG=$(echo "$GITHUB_REF" | awk '{split($0, a, "/"); print a[3];}')
|
||||||
|
TAG_EXTENSION=${{ github.events.inputs.custom_tag_extension }}
|
||||||
|
|
||||||
|
if [[ $TAG_EXTENSION ]]; then
|
||||||
|
IMAGE_TAG=$IMAGE_TAG-$TAG_EXTENSION
|
||||||
|
fi
|
||||||
|
echo "::set-output name=value::$IMAGE_TAG"
|
||||||
|
|
||||||
|
- name: Tag image
|
||||||
|
env:
|
||||||
|
IMAGE_TAG: ${{ steps.image_tag.outputs.value }}
|
||||||
|
run: docker tag bitwardenqa.azurecr.io/web "bitwardenqa.azurecr.io/web:$IMAGE_TAG"
|
||||||
|
|
||||||
|
- name: Tag dev
|
||||||
|
if: github.ref == 'refs/heads/master'
|
||||||
|
run: docker tag bitwardenqa.azurecr.io/web bitwardenqa.azurecr.io/web:dev
|
||||||
|
|
||||||
|
- name: List Docker images
|
||||||
|
run: docker images
|
||||||
|
|
||||||
|
- name: Push image
|
||||||
|
env:
|
||||||
|
IMAGE_TAG: ${{ steps.image_tag.outputs.value }}
|
||||||
|
run: docker push "bitwardenqa.azurecr.io/web:$IMAGE_TAG"
|
||||||
|
|
||||||
|
- name: Push dev images
|
||||||
|
if: github.ref == 'refs/heads/master'
|
||||||
|
run: docker push bitwardenqa.azurecr.io/web:dev
|
||||||
|
|
||||||
|
- name: Log out of Docker
|
||||||
|
run: docker logout
|
||||||
|
|
||||||
|
|
||||||
windows:
|
windows:
|
||||||
|
name: Test code on Windows
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Set up NuGet
|
- name: Set up NuGet
|
||||||
|
|||||||
133
.github/workflows/crowdin-sync.yml
vendored
Normal file
133
.github/workflows/crowdin-sync.yml
vendored
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
name: Crowdin Sync
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs: {}
|
||||||
|
#schedule:
|
||||||
|
# - cron: '0 0 * * *'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
crowdin-sync:
|
||||||
|
name: Autosync
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
|
||||||
|
|
||||||
|
- name: Setup git config
|
||||||
|
run: |
|
||||||
|
git config user.name = "GitHub Action Bot"
|
||||||
|
git config user.email = "<>"
|
||||||
|
|
||||||
|
- name: Get Crowndin Sync Branch
|
||||||
|
id: branch
|
||||||
|
run: |
|
||||||
|
BRANCH_NAME=crowdin-auto-sync
|
||||||
|
BRANCH_EXISTED=true
|
||||||
|
|
||||||
|
git fetch -a
|
||||||
|
git switch master
|
||||||
|
if [ $(git branch -a | egrep "remotes/origin/${BRANCH_NAME}$" | wc -l) -eq 0 ]; then
|
||||||
|
BRANCH_EXISTED=false
|
||||||
|
git switch -c $BRANCH_NAME
|
||||||
|
else
|
||||||
|
git switch $BRANCH_NAME
|
||||||
|
fi
|
||||||
|
git branch
|
||||||
|
|
||||||
|
echo "::set-output name=branch-existed::${BRANCH_EXISTED}"
|
||||||
|
echo "::set-output name=branch-name::${BRANCH_NAME}"
|
||||||
|
|
||||||
|
- name: Login to Azure
|
||||||
|
uses: Azure/login@77f1b2e3fb80c0e8645114159d17008b8a2e475a
|
||||||
|
with:
|
||||||
|
creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }}
|
||||||
|
|
||||||
|
- name: Retrieve secrets
|
||||||
|
id: retrieve-secrets
|
||||||
|
uses: Azure/get-keyvault-secrets@80ccd3fafe5662407cc2e55f202ee34bfff8c403
|
||||||
|
with:
|
||||||
|
keyvault: "bitwarden-prod-kv"
|
||||||
|
secrets: "crowdin-api-token"
|
||||||
|
|
||||||
|
- name: Get Crowdin updates
|
||||||
|
env:
|
||||||
|
CROWDIN_BASE_URL="https://api.crowdin.com/api/v2/projects"
|
||||||
|
CROWDIN_PROJECT_ID="308189"
|
||||||
|
run: |
|
||||||
|
# Step 1: GET master branchId
|
||||||
|
BRANCH_ID=$(
|
||||||
|
curl -s -H "Authorization: Bearer $CROWDIN_API_TOKEN" \
|
||||||
|
$CROWDIN_BASE_URL/$CROWDIN_PROJECT_ID/branches | jq -r '.data[0].data.id'
|
||||||
|
)
|
||||||
|
|
||||||
|
# Step 2: POST Build the translations and get store build id
|
||||||
|
BUILD_ID=$(
|
||||||
|
curl -X POST -s \
|
||||||
|
-H "Authorization: Bearer $CROWDIN_API_TOKEN" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
$CROWDIN_BASE_URL/$CROWDIN_PROJECT_ID/translations/builds \
|
||||||
|
-d "{\"branchId\": $BRANCH_ID}" | jq -r '.data.id'
|
||||||
|
)
|
||||||
|
|
||||||
|
MAX_TRIES=12
|
||||||
|
for try in {1..$MAX_TRIES}; do
|
||||||
|
BRANCH_STATUS=$(
|
||||||
|
curl -s -H "Authorization: Bearer $CROWDIN_API_TOKEN" \
|
||||||
|
$CROWDIN_BASE_URL/$CROWDIN_PROJECT_ID/translations/builds/$BUILD_ID | jq -r '.data.status'
|
||||||
|
)
|
||||||
|
echo "[*] Build status: $BRANCH_STATUS"
|
||||||
|
if [[ "$BRANCH_STATUS" == "finished" ]]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $try -eq $MAX_TRIES ]]; then
|
||||||
|
echo "[!] Exceeded tries: $try"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
sleep 5
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Step 4: when build is finished, get download url
|
||||||
|
DOWNLOAD_URL=$(
|
||||||
|
curl -s -H "Authorization: Bearer $CROWDIN_API_TOKEN" \
|
||||||
|
$CROWDIN_BASE_URL/$CROWDIN_PROJECT_ID/translations/builds/$BUILD_ID/download | jq -r '.data.url'
|
||||||
|
)
|
||||||
|
|
||||||
|
# Step 5: download the translations via the download url
|
||||||
|
SAVE_FILE=translations.zip
|
||||||
|
curl -s $DOWNLOAD_URL --output $SAVE_FILE
|
||||||
|
echo "[*] Saved to: $SAVE_FILE"
|
||||||
|
|
||||||
|
# Step 6: Unzip and cleanup
|
||||||
|
unzip -o $SAVE_FILE
|
||||||
|
rm $SAVE_FILE
|
||||||
|
|
||||||
|
- name: Commit changes
|
||||||
|
env:
|
||||||
|
BRANCH_NAME: ${{ steps.branch.outputs.branch-name }}
|
||||||
|
run: |
|
||||||
|
echo "[*] Adding new translations"
|
||||||
|
git add .
|
||||||
|
echo "=====Translations Changed====="
|
||||||
|
git status
|
||||||
|
echo "=============================="
|
||||||
|
echo "[*] Committing"
|
||||||
|
git commit -m "Autosync Crowdin translations"
|
||||||
|
echo "[*] Pushing"
|
||||||
|
git push -u origin $BRANCH_NAME
|
||||||
|
|
||||||
|
- name: Create/Update PR
|
||||||
|
env:
|
||||||
|
BRANCH_NAME: ${{ steps.cherry-pick.outputs.branch-name }}
|
||||||
|
BRANCH_EXISTED: ${{ steps.cherry-pick.outputs.branch-existed }}
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
if [ "$BRANCH_EXISTED" == "false" ]; then
|
||||||
|
echo "[*] Creating PR"
|
||||||
|
gh pr create --title "Autosync Crowdin Translations" \
|
||||||
|
--body "Autosync the updated translations"
|
||||||
|
else
|
||||||
|
echo "[*] Existing PR updated"
|
||||||
|
fi
|
||||||
5
.github/workflows/deploy.yml
vendored
5
.github/workflows/deploy.yml
vendored
@@ -44,10 +44,13 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git config user.name = "GitHub Action Bot"
|
git config user.name = "GitHub Action Bot"
|
||||||
git config user.email = "<>"
|
git config user.email = "<>"
|
||||||
|
git config --global url."https://github.com/".insteadOf ssh://git@github.com/
|
||||||
|
git config --global url."https://".insteadOf ssh://
|
||||||
|
|
||||||
- name: Install and Build
|
- name: Install and Build
|
||||||
run: |
|
run: |
|
||||||
npm install
|
npm run sub:init
|
||||||
|
npm ci
|
||||||
npm run dist
|
npm run dist
|
||||||
|
|
||||||
- name: Deploy GitHub Pages
|
- name: Deploy GitHub Pages
|
||||||
|
|||||||
70
.github/workflows/qa-deploy.yml
vendored
Normal file
70
.github/workflows/qa-deploy.yml
vendored
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
name: QA Deploy
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
image_extension:
|
||||||
|
description: "Image tag extension"
|
||||||
|
required: false
|
||||||
|
|
||||||
|
env:
|
||||||
|
QA_CLUSTER_RESOURCE_GROUP: "bitwarden-devops"
|
||||||
|
QA_CLUSTER_NAME: "dev-aks"
|
||||||
|
QA_K8S_NAMESPACE: "bw-qa"
|
||||||
|
QA_K8S_APP_NAME: "bw-web"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
name: Deploy QA Web
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repo
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Setup
|
||||||
|
run:
|
||||||
|
export PATH=$PATH:~/work/web/web
|
||||||
|
|
||||||
|
- name: Login to Azure
|
||||||
|
uses: Azure/login@77f1b2e3fb80c0e8645114159d17008b8a2e475a
|
||||||
|
with:
|
||||||
|
creds: ${{ secrets.AZURE_QA_KV_CREDENTIALS }}
|
||||||
|
|
||||||
|
- name: Retrieve secrets
|
||||||
|
id: retrieve-secrets
|
||||||
|
uses: Azure/get-keyvault-secrets@80ccd3fafe5662407cc2e55f202ee34bfff8c403
|
||||||
|
with:
|
||||||
|
keyvault: "bitwarden-qa-kv"
|
||||||
|
secrets: "dev-aks-kubectl-credentials"
|
||||||
|
|
||||||
|
- name: Login to dev-aks-kubectl SP
|
||||||
|
uses: Azure/login@77f1b2e3fb80c0e8645114159d17008b8a2e475a
|
||||||
|
with:
|
||||||
|
creds: ${{ env.dev-aks-kubectl-credentials }}
|
||||||
|
|
||||||
|
- name: Setup AKS access
|
||||||
|
env:
|
||||||
|
USER_ID: ${{ env.qa-kubectl-managed-identity-clientId }}
|
||||||
|
run: |
|
||||||
|
echo "---az install---"
|
||||||
|
az aks install-cli --install-location ./kubectl --kubelogin-install-location ./kubelogin
|
||||||
|
echo "---az get-creds---"
|
||||||
|
az aks get-credentials -n $QA_CLUSTER_NAME -g $QA_CLUSTER_RESOURCE_GROUP
|
||||||
|
|
||||||
|
- name: Get image tag
|
||||||
|
id: image_tag
|
||||||
|
run: |
|
||||||
|
IMAGE_TAG=$(echo "$GITHUB_REF" | awk '{split($0, a, "/"); print a[3];}')
|
||||||
|
TAG_EXTENSION=${{ github.events.inputs.image_extension }}
|
||||||
|
|
||||||
|
if [[ $TAG_EXTENSION ]]; then
|
||||||
|
IMAGE_TAG=$IMAGE_TAG-$TAG_EXTENSION
|
||||||
|
fi
|
||||||
|
echo "::set-output name=value::$IMAGE_TAG"
|
||||||
|
|
||||||
|
- name: Deploy Web image
|
||||||
|
env:
|
||||||
|
IMAGE_TAG: ${{ steps.image_tag.outputs.value }}
|
||||||
|
run: |
|
||||||
|
kubectl set image -n $QA_K8S_NAMESPACE deployment/web web=bitwardenqa.azurecr.io/web:$IMAGE_TAG --record
|
||||||
|
kubectl rollout status deployment/web -n $QA_K8S_NAMESPACE
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -9,6 +9,7 @@ dist/
|
|||||||
*.pem
|
*.pem
|
||||||
*.crx
|
*.crx
|
||||||
*.zip
|
*.zip
|
||||||
|
*.swp
|
||||||
build/
|
build/
|
||||||
!dev-server.shared.pem
|
!dev-server.shared.pem
|
||||||
config/development.json
|
config/development.json
|
||||||
|
|||||||
691
LICENSE.txt
691
LICENSE.txt
@@ -1,674 +1,17 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
Source code in this repository is covered by one of two licenses: (i) the
|
||||||
Version 3, 29 June 2007
|
GNU General Public License (GPL) v3.0 (ii) the Bitwarden License v1.0. The
|
||||||
|
default license throughout the repository is GPL v3.0 unless the header
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
specifies another license. Bitwarden Licensed code is found only in the
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
/bitwarden_license directory.
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
GPL v3.0:
|
||||||
Preamble
|
https://github.com/bitwarden/web/blob/master/LICENSE_GPL.txt
|
||||||
|
|
||||||
The GNU General Public License is a free, copyleft license for
|
Bitwarden License v1.0:
|
||||||
software and other kinds of works.
|
https://github.com/bitwarden/web/blob/master/LICENSE_BITWARDEN.txt
|
||||||
|
|
||||||
The licenses for most software and other practical works are designed
|
No grant of any rights in the trademarks, service marks, or logos of Bitwarden is
|
||||||
to take away your freedom to share and change the works. By contrast,
|
made (except as may be necessary to comply with the notice requirements as
|
||||||
the GNU General Public License is intended to guarantee your freedom to
|
applicable), and use of any Bitwarden trademarks must comply with Bitwarden
|
||||||
share and change all versions of a program--to make sure it remains free
|
Trademark Guidelines
|
||||||
software for all its users. We, the Free Software Foundation, use the
|
<https://github.com/bitwarden/server/blob/master/TRADEMARK_GUIDELINES.md>.
|
||||||
GNU General Public License for most of our software; it applies also to
|
|
||||||
any other work released this way by its authors. You can apply it to
|
|
||||||
your programs, too.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
them if you wish), that you receive source code or can get it if you
|
|
||||||
want it, that you can change the software or use pieces of it in new
|
|
||||||
free programs, and that you know you can do these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to prevent others from denying you
|
|
||||||
these rights or asking you to surrender the rights. Therefore, you have
|
|
||||||
certain responsibilities if you distribute copies of the software, or if
|
|
||||||
you modify it: responsibilities to respect the freedom of others.
|
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
|
||||||
gratis or for a fee, you must pass on to the recipients the same
|
|
||||||
freedoms that you received. You must make sure that they, too, receive
|
|
||||||
or can get the source code. And you must show them these terms so they
|
|
||||||
know their rights.
|
|
||||||
|
|
||||||
Developers that use the GNU GPL protect your rights with two steps:
|
|
||||||
(1) assert copyright on the software, and (2) offer you this License
|
|
||||||
giving you legal permission to copy, distribute and/or modify it.
|
|
||||||
|
|
||||||
For the developers' and authors' protection, the GPL clearly explains
|
|
||||||
that there is no warranty for this free software. For both users' and
|
|
||||||
authors' sake, the GPL requires that modified versions be marked as
|
|
||||||
changed, so that their problems will not be attributed erroneously to
|
|
||||||
authors of previous versions.
|
|
||||||
|
|
||||||
Some devices are designed to deny users access to install or run
|
|
||||||
modified versions of the software inside them, although the manufacturer
|
|
||||||
can do so. This is fundamentally incompatible with the aim of
|
|
||||||
protecting users' freedom to change the software. The systematic
|
|
||||||
pattern of such abuse occurs in the area of products for individuals to
|
|
||||||
use, which is precisely where it is most unacceptable. Therefore, we
|
|
||||||
have designed this version of the GPL to prohibit the practice for those
|
|
||||||
products. If such problems arise substantially in other domains, we
|
|
||||||
stand ready to extend this provision to those domains in future versions
|
|
||||||
of the GPL, as needed to protect the freedom of users.
|
|
||||||
|
|
||||||
Finally, every program is threatened constantly by software patents.
|
|
||||||
States should not allow patents to restrict development and use of
|
|
||||||
software on general-purpose computers, but in those that do, we wish to
|
|
||||||
avoid the special danger that patents applied to a free program could
|
|
||||||
make it effectively proprietary. To prevent this, the GPL assures that
|
|
||||||
patents cannot be used to render the program non-free.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
0. Definitions.
|
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU General Public License.
|
|
||||||
|
|
||||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
|
||||||
works, such as semiconductor masks.
|
|
||||||
|
|
||||||
"The Program" refers to any copyrightable work licensed under this
|
|
||||||
License. Each licensee is addressed as "you". "Licensees" and
|
|
||||||
"recipients" may be individuals or organizations.
|
|
||||||
|
|
||||||
To "modify" a work means to copy from or adapt all or part of the work
|
|
||||||
in a fashion requiring copyright permission, other than the making of an
|
|
||||||
exact copy. The resulting work is called a "modified version" of the
|
|
||||||
earlier work or a work "based on" the earlier work.
|
|
||||||
|
|
||||||
A "covered work" means either the unmodified Program or a work based
|
|
||||||
on the Program.
|
|
||||||
|
|
||||||
To "propagate" a work means to do anything with it that, without
|
|
||||||
permission, would make you directly or secondarily liable for
|
|
||||||
infringement under applicable copyright law, except executing it on a
|
|
||||||
computer or modifying a private copy. Propagation includes copying,
|
|
||||||
distribution (with or without modification), making available to the
|
|
||||||
public, and in some countries other activities as well.
|
|
||||||
|
|
||||||
To "convey" a work means any kind of propagation that enables other
|
|
||||||
parties to make or receive copies. Mere interaction with a user through
|
|
||||||
a computer network, with no transfer of a copy, is not conveying.
|
|
||||||
|
|
||||||
An interactive user interface displays "Appropriate Legal Notices"
|
|
||||||
to the extent that it includes a convenient and prominently visible
|
|
||||||
feature that (1) displays an appropriate copyright notice, and (2)
|
|
||||||
tells the user that there is no warranty for the work (except to the
|
|
||||||
extent that warranties are provided), that licensees may convey the
|
|
||||||
work under this License, and how to view a copy of this License. If
|
|
||||||
the interface presents a list of user commands or options, such as a
|
|
||||||
menu, a prominent item in the list meets this criterion.
|
|
||||||
|
|
||||||
1. Source Code.
|
|
||||||
|
|
||||||
The "source code" for a work means the preferred form of the work
|
|
||||||
for making modifications to it. "Object code" means any non-source
|
|
||||||
form of a work.
|
|
||||||
|
|
||||||
A "Standard Interface" means an interface that either is an official
|
|
||||||
standard defined by a recognized standards body, or, in the case of
|
|
||||||
interfaces specified for a particular programming language, one that
|
|
||||||
is widely used among developers working in that language.
|
|
||||||
|
|
||||||
The "System Libraries" of an executable work include anything, other
|
|
||||||
than the work as a whole, that (a) is included in the normal form of
|
|
||||||
packaging a Major Component, but which is not part of that Major
|
|
||||||
Component, and (b) serves only to enable use of the work with that
|
|
||||||
Major Component, or to implement a Standard Interface for which an
|
|
||||||
implementation is available to the public in source code form. A
|
|
||||||
"Major Component", in this context, means a major essential component
|
|
||||||
(kernel, window system, and so on) of the specific operating system
|
|
||||||
(if any) on which the executable work runs, or a compiler used to
|
|
||||||
produce the work, or an object code interpreter used to run it.
|
|
||||||
|
|
||||||
The "Corresponding Source" for a work in object code form means all
|
|
||||||
the source code needed to generate, install, and (for an executable
|
|
||||||
work) run the object code and to modify the work, including scripts to
|
|
||||||
control those activities. However, it does not include the work's
|
|
||||||
System Libraries, or general-purpose tools or generally available free
|
|
||||||
programs which are used unmodified in performing those activities but
|
|
||||||
which are not part of the work. For example, Corresponding Source
|
|
||||||
includes interface definition files associated with source files for
|
|
||||||
the work, and the source code for shared libraries and dynamically
|
|
||||||
linked subprograms that the work is specifically designed to require,
|
|
||||||
such as by intimate data communication or control flow between those
|
|
||||||
subprograms and other parts of the work.
|
|
||||||
|
|
||||||
The Corresponding Source need not include anything that users
|
|
||||||
can regenerate automatically from other parts of the Corresponding
|
|
||||||
Source.
|
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that
|
|
||||||
same work.
|
|
||||||
|
|
||||||
2. Basic Permissions.
|
|
||||||
|
|
||||||
All rights granted under this License are granted for the term of
|
|
||||||
copyright on the Program, and are irrevocable provided the stated
|
|
||||||
conditions are met. This License explicitly affirms your unlimited
|
|
||||||
permission to run the unmodified Program. The output from running a
|
|
||||||
covered work is covered by this License only if the output, given its
|
|
||||||
content, constitutes a covered work. This License acknowledges your
|
|
||||||
rights of fair use or other equivalent, as provided by copyright law.
|
|
||||||
|
|
||||||
You may make, run and propagate covered works that you do not
|
|
||||||
convey, without conditions so long as your license otherwise remains
|
|
||||||
in force. You may convey covered works to others for the sole purpose
|
|
||||||
of having them make modifications exclusively for you, or provide you
|
|
||||||
with facilities for running those works, provided that you comply with
|
|
||||||
the terms of this License in conveying all material for which you do
|
|
||||||
not control copyright. Those thus making or running the covered works
|
|
||||||
for you must do so exclusively on your behalf, under your direction
|
|
||||||
and control, on terms that prohibit them from making any copies of
|
|
||||||
your copyrighted material outside their relationship with you.
|
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under
|
|
||||||
the conditions stated below. Sublicensing is not allowed; section 10
|
|
||||||
makes it unnecessary.
|
|
||||||
|
|
||||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
|
|
||||||
No covered work shall be deemed part of an effective technological
|
|
||||||
measure under any applicable law fulfilling obligations under article
|
|
||||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
||||||
similar laws prohibiting or restricting circumvention of such
|
|
||||||
measures.
|
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid
|
|
||||||
circumvention of technological measures to the extent such circumvention
|
|
||||||
is effected by exercising rights under this License with respect to
|
|
||||||
the covered work, and you disclaim any intention to limit operation or
|
|
||||||
modification of the work as a means of enforcing, against the work's
|
|
||||||
users, your or third parties' legal rights to forbid circumvention of
|
|
||||||
technological measures.
|
|
||||||
|
|
||||||
4. Conveying Verbatim Copies.
|
|
||||||
|
|
||||||
You may convey verbatim copies of the Program's source code as you
|
|
||||||
receive it, in any medium, provided that you conspicuously and
|
|
||||||
appropriately publish on each copy an appropriate copyright notice;
|
|
||||||
keep intact all notices stating that this License and any
|
|
||||||
non-permissive terms added in accord with section 7 apply to the code;
|
|
||||||
keep intact all notices of the absence of any warranty; and give all
|
|
||||||
recipients a copy of this License along with the Program.
|
|
||||||
|
|
||||||
You may charge any price or no price for each copy that you convey,
|
|
||||||
and you may offer support or warranty protection for a fee.
|
|
||||||
|
|
||||||
5. Conveying Modified Source Versions.
|
|
||||||
|
|
||||||
You may convey a work based on the Program, or the modifications to
|
|
||||||
produce it from the Program, in the form of source code under the
|
|
||||||
terms of section 4, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The work must carry prominent notices stating that you modified
|
|
||||||
it, and giving a relevant date.
|
|
||||||
|
|
||||||
b) The work must carry prominent notices stating that it is
|
|
||||||
released under this License and any conditions added under section
|
|
||||||
7. This requirement modifies the requirement in section 4 to
|
|
||||||
"keep intact all notices".
|
|
||||||
|
|
||||||
c) You must license the entire work, as a whole, under this
|
|
||||||
License to anyone who comes into possession of a copy. This
|
|
||||||
License will therefore apply, along with any applicable section 7
|
|
||||||
additional terms, to the whole of the work, and all its parts,
|
|
||||||
regardless of how they are packaged. This License gives no
|
|
||||||
permission to license the work in any other way, but it does not
|
|
||||||
invalidate such permission if you have separately received it.
|
|
||||||
|
|
||||||
d) If the work has interactive user interfaces, each must display
|
|
||||||
Appropriate Legal Notices; however, if the Program has interactive
|
|
||||||
interfaces that do not display Appropriate Legal Notices, your
|
|
||||||
work need not make them do so.
|
|
||||||
|
|
||||||
A compilation of a covered work with other separate and independent
|
|
||||||
works, which are not by their nature extensions of the covered work,
|
|
||||||
and which are not combined with it such as to form a larger program,
|
|
||||||
in or on a volume of a storage or distribution medium, is called an
|
|
||||||
"aggregate" if the compilation and its resulting copyright are not
|
|
||||||
used to limit the access or legal rights of the compilation's users
|
|
||||||
beyond what the individual works permit. Inclusion of a covered work
|
|
||||||
in an aggregate does not cause this License to apply to the other
|
|
||||||
parts of the aggregate.
|
|
||||||
|
|
||||||
6. Conveying Non-Source Forms.
|
|
||||||
|
|
||||||
You may convey a covered work in object code form under the terms
|
|
||||||
of sections 4 and 5, provided that you also convey the
|
|
||||||
machine-readable Corresponding Source under the terms of this License,
|
|
||||||
in one of these ways:
|
|
||||||
|
|
||||||
a) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by the
|
|
||||||
Corresponding Source fixed on a durable physical medium
|
|
||||||
customarily used for software interchange.
|
|
||||||
|
|
||||||
b) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by a
|
|
||||||
written offer, valid for at least three years and valid for as
|
|
||||||
long as you offer spare parts or customer support for that product
|
|
||||||
model, to give anyone who possesses the object code either (1) a
|
|
||||||
copy of the Corresponding Source for all the software in the
|
|
||||||
product that is covered by this License, on a durable physical
|
|
||||||
medium customarily used for software interchange, for a price no
|
|
||||||
more than your reasonable cost of physically performing this
|
|
||||||
conveying of source, or (2) access to copy the
|
|
||||||
Corresponding Source from a network server at no charge.
|
|
||||||
|
|
||||||
c) Convey individual copies of the object code with a copy of the
|
|
||||||
written offer to provide the Corresponding Source. This
|
|
||||||
alternative is allowed only occasionally and noncommercially, and
|
|
||||||
only if you received the object code with such an offer, in accord
|
|
||||||
with subsection 6b.
|
|
||||||
|
|
||||||
d) Convey the object code by offering access from a designated
|
|
||||||
place (gratis or for a charge), and offer equivalent access to the
|
|
||||||
Corresponding Source in the same way through the same place at no
|
|
||||||
further charge. You need not require recipients to copy the
|
|
||||||
Corresponding Source along with the object code. If the place to
|
|
||||||
copy the object code is a network server, the Corresponding Source
|
|
||||||
may be on a different server (operated by you or a third party)
|
|
||||||
that supports equivalent copying facilities, provided you maintain
|
|
||||||
clear directions next to the object code saying where to find the
|
|
||||||
Corresponding Source. Regardless of what server hosts the
|
|
||||||
Corresponding Source, you remain obligated to ensure that it is
|
|
||||||
available for as long as needed to satisfy these requirements.
|
|
||||||
|
|
||||||
e) Convey the object code using peer-to-peer transmission, provided
|
|
||||||
you inform other peers where the object code and Corresponding
|
|
||||||
Source of the work are being offered to the general public at no
|
|
||||||
charge under subsection 6d.
|
|
||||||
|
|
||||||
A separable portion of the object code, whose source code is excluded
|
|
||||||
from the Corresponding Source as a System Library, need not be
|
|
||||||
included in conveying the object code work.
|
|
||||||
|
|
||||||
A "User Product" is either (1) a "consumer product", which means any
|
|
||||||
tangible personal property which is normally used for personal, family,
|
|
||||||
or household purposes, or (2) anything designed or sold for incorporation
|
|
||||||
into a dwelling. In determining whether a product is a consumer product,
|
|
||||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
|
||||||
product received by a particular user, "normally used" refers to a
|
|
||||||
typical or common use of that class of product, regardless of the status
|
|
||||||
of the particular user or of the way in which the particular user
|
|
||||||
actually uses, or expects or is expected to use, the product. A product
|
|
||||||
is a consumer product regardless of whether the product has substantial
|
|
||||||
commercial, industrial or non-consumer uses, unless such uses represent
|
|
||||||
the only significant mode of use of the product.
|
|
||||||
|
|
||||||
"Installation Information" for a User Product means any methods,
|
|
||||||
procedures, authorization keys, or other information required to install
|
|
||||||
and execute modified versions of a covered work in that User Product from
|
|
||||||
a modified version of its Corresponding Source. The information must
|
|
||||||
suffice to ensure that the continued functioning of the modified object
|
|
||||||
code is in no case prevented or interfered with solely because
|
|
||||||
modification has been made.
|
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or
|
|
||||||
specifically for use in, a User Product, and the conveying occurs as
|
|
||||||
part of a transaction in which the right of possession and use of the
|
|
||||||
User Product is transferred to the recipient in perpetuity or for a
|
|
||||||
fixed term (regardless of how the transaction is characterized), the
|
|
||||||
Corresponding Source conveyed under this section must be accompanied
|
|
||||||
by the Installation Information. But this requirement does not apply
|
|
||||||
if neither you nor any third party retains the ability to install
|
|
||||||
modified object code on the User Product (for example, the work has
|
|
||||||
been installed in ROM).
|
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a
|
|
||||||
requirement to continue to provide support service, warranty, or updates
|
|
||||||
for a work that has been modified or installed by the recipient, or for
|
|
||||||
the User Product in which it has been modified or installed. Access to a
|
|
||||||
network may be denied when the modification itself materially and
|
|
||||||
adversely affects the operation of the network or violates the rules and
|
|
||||||
protocols for communication across the network.
|
|
||||||
|
|
||||||
Corresponding Source conveyed, and Installation Information provided,
|
|
||||||
in accord with this section must be in a format that is publicly
|
|
||||||
documented (and with an implementation available to the public in
|
|
||||||
source code form), and must require no special password or key for
|
|
||||||
unpacking, reading or copying.
|
|
||||||
|
|
||||||
7. Additional Terms.
|
|
||||||
|
|
||||||
"Additional permissions" are terms that supplement the terms of this
|
|
||||||
License by making exceptions from one or more of its conditions.
|
|
||||||
Additional permissions that are applicable to the entire Program shall
|
|
||||||
be treated as though they were included in this License, to the extent
|
|
||||||
that they are valid under applicable law. If additional permissions
|
|
||||||
apply only to part of the Program, that part may be used separately
|
|
||||||
under those permissions, but the entire Program remains governed by
|
|
||||||
this License without regard to the additional permissions.
|
|
||||||
|
|
||||||
When you convey a copy of a covered work, you may at your option
|
|
||||||
remove any additional permissions from that copy, or from any part of
|
|
||||||
it. (Additional permissions may be written to require their own
|
|
||||||
removal in certain cases when you modify the work.) You may place
|
|
||||||
additional permissions on material, added by you to a covered work,
|
|
||||||
for which you have or can give appropriate copyright permission.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you
|
|
||||||
add to a covered work, you may (if authorized by the copyright holders of
|
|
||||||
that material) supplement the terms of this License with terms:
|
|
||||||
|
|
||||||
a) Disclaiming warranty or limiting liability differently from the
|
|
||||||
terms of sections 15 and 16 of this License; or
|
|
||||||
|
|
||||||
b) Requiring preservation of specified reasonable legal notices or
|
|
||||||
author attributions in that material or in the Appropriate Legal
|
|
||||||
Notices displayed by works containing it; or
|
|
||||||
|
|
||||||
c) Prohibiting misrepresentation of the origin of that material, or
|
|
||||||
requiring that modified versions of such material be marked in
|
|
||||||
reasonable ways as different from the original version; or
|
|
||||||
|
|
||||||
d) Limiting the use for publicity purposes of names of licensors or
|
|
||||||
authors of the material; or
|
|
||||||
|
|
||||||
e) Declining to grant rights under trademark law for use of some
|
|
||||||
trade names, trademarks, or service marks; or
|
|
||||||
|
|
||||||
f) Requiring indemnification of licensors and authors of that
|
|
||||||
material by anyone who conveys the material (or modified versions of
|
|
||||||
it) with contractual assumptions of liability to the recipient, for
|
|
||||||
any liability that these contractual assumptions directly impose on
|
|
||||||
those licensors and authors.
|
|
||||||
|
|
||||||
All other non-permissive additional terms are considered "further
|
|
||||||
restrictions" within the meaning of section 10. If the Program as you
|
|
||||||
received it, or any part of it, contains a notice stating that it is
|
|
||||||
governed by this License along with a term that is a further
|
|
||||||
restriction, you may remove that term. If a license document contains
|
|
||||||
a further restriction but permits relicensing or conveying under this
|
|
||||||
License, you may add to a covered work material governed by the terms
|
|
||||||
of that license document, provided that the further restriction does
|
|
||||||
not survive such relicensing or conveying.
|
|
||||||
|
|
||||||
If you add terms to a covered work in accord with this section, you
|
|
||||||
must place, in the relevant source files, a statement of the
|
|
||||||
additional terms that apply to those files, or a notice indicating
|
|
||||||
where to find the applicable terms.
|
|
||||||
|
|
||||||
Additional terms, permissive or non-permissive, may be stated in the
|
|
||||||
form of a separately written license, or stated as exceptions;
|
|
||||||
the above requirements apply either way.
|
|
||||||
|
|
||||||
8. Termination.
|
|
||||||
|
|
||||||
You may not propagate or modify a covered work except as expressly
|
|
||||||
provided under this License. Any attempt otherwise to propagate or
|
|
||||||
modify it is void, and will automatically terminate your rights under
|
|
||||||
this License (including any patent licenses granted under the third
|
|
||||||
paragraph of section 11).
|
|
||||||
|
|
||||||
However, if you cease all violation of this License, then your
|
|
||||||
license from a particular copyright holder is reinstated (a)
|
|
||||||
provisionally, unless and until the copyright holder explicitly and
|
|
||||||
finally terminates your license, and (b) permanently, if the copyright
|
|
||||||
holder fails to notify you of the violation by some reasonable means
|
|
||||||
prior to 60 days after the cessation.
|
|
||||||
|
|
||||||
Moreover, your license from a particular copyright holder is
|
|
||||||
reinstated permanently if the copyright holder notifies you of the
|
|
||||||
violation by some reasonable means, this is the first time you have
|
|
||||||
received notice of violation of this License (for any work) from that
|
|
||||||
copyright holder, and you cure the violation prior to 30 days after
|
|
||||||
your receipt of the notice.
|
|
||||||
|
|
||||||
Termination of your rights under this section does not terminate the
|
|
||||||
licenses of parties who have received copies or rights from you under
|
|
||||||
this License. If your rights have been terminated and not permanently
|
|
||||||
reinstated, you do not qualify to receive new licenses for the same
|
|
||||||
material under section 10.
|
|
||||||
|
|
||||||
9. Acceptance Not Required for Having Copies.
|
|
||||||
|
|
||||||
You are not required to accept this License in order to receive or
|
|
||||||
run a copy of the Program. Ancillary propagation of a covered work
|
|
||||||
occurring solely as a consequence of using peer-to-peer transmission
|
|
||||||
to receive a copy likewise does not require acceptance. However,
|
|
||||||
nothing other than this License grants you permission to propagate or
|
|
||||||
modify any covered work. These actions infringe copyright if you do
|
|
||||||
not accept this License. Therefore, by modifying or propagating a
|
|
||||||
covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
|
||||||
10. Automatic Licensing of Downstream Recipients.
|
|
||||||
|
|
||||||
Each time you convey a covered work, the recipient automatically
|
|
||||||
receives a license from the original licensors, to run, modify and
|
|
||||||
propagate that work, subject to this License. You are not responsible
|
|
||||||
for enforcing compliance by third parties with this License.
|
|
||||||
|
|
||||||
An "entity transaction" is a transaction transferring control of an
|
|
||||||
organization, or substantially all assets of one, or subdividing an
|
|
||||||
organization, or merging organizations. If propagation of a covered
|
|
||||||
work results from an entity transaction, each party to that
|
|
||||||
transaction who receives a copy of the work also receives whatever
|
|
||||||
licenses to the work the party's predecessor in interest had or could
|
|
||||||
give under the previous paragraph, plus a right to possession of the
|
|
||||||
Corresponding Source of the work from the predecessor in interest, if
|
|
||||||
the predecessor has it or can get it with reasonable efforts.
|
|
||||||
|
|
||||||
You may not impose any further restrictions on the exercise of the
|
|
||||||
rights granted or affirmed under this License. For example, you may
|
|
||||||
not impose a license fee, royalty, or other charge for exercise of
|
|
||||||
rights granted under this License, and you may not initiate litigation
|
|
||||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
||||||
any patent claim is infringed by making, using, selling, offering for
|
|
||||||
sale, or importing the Program or any portion of it.
|
|
||||||
|
|
||||||
11. Patents.
|
|
||||||
|
|
||||||
A "contributor" is a copyright holder who authorizes use under this
|
|
||||||
License of the Program or a work on which the Program is based. The
|
|
||||||
work thus licensed is called the contributor's "contributor version".
|
|
||||||
|
|
||||||
A contributor's "essential patent claims" are all patent claims
|
|
||||||
owned or controlled by the contributor, whether already acquired or
|
|
||||||
hereafter acquired, that would be infringed by some manner, permitted
|
|
||||||
by this License, of making, using, or selling its contributor version,
|
|
||||||
but do not include claims that would be infringed only as a
|
|
||||||
consequence of further modification of the contributor version. For
|
|
||||||
purposes of this definition, "control" includes the right to grant
|
|
||||||
patent sublicenses in a manner consistent with the requirements of
|
|
||||||
this License.
|
|
||||||
|
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
||||||
patent license under the contributor's essential patent claims, to
|
|
||||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
||||||
propagate the contents of its contributor version.
|
|
||||||
|
|
||||||
In the following three paragraphs, a "patent license" is any express
|
|
||||||
agreement or commitment, however denominated, not to enforce a patent
|
|
||||||
(such as an express permission to practice a patent or covenant not to
|
|
||||||
sue for patent infringement). To "grant" such a patent license to a
|
|
||||||
party means to make such an agreement or commitment not to enforce a
|
|
||||||
patent against the party.
|
|
||||||
|
|
||||||
If you convey a covered work, knowingly relying on a patent license,
|
|
||||||
and the Corresponding Source of the work is not available for anyone
|
|
||||||
to copy, free of charge and under the terms of this License, through a
|
|
||||||
publicly available network server or other readily accessible means,
|
|
||||||
then you must either (1) cause the Corresponding Source to be so
|
|
||||||
available, or (2) arrange to deprive yourself of the benefit of the
|
|
||||||
patent license for this particular work, or (3) arrange, in a manner
|
|
||||||
consistent with the requirements of this License, to extend the patent
|
|
||||||
license to downstream recipients. "Knowingly relying" means you have
|
|
||||||
actual knowledge that, but for the patent license, your conveying the
|
|
||||||
covered work in a country, or your recipient's use of the covered work
|
|
||||||
in a country, would infringe one or more identifiable patents in that
|
|
||||||
country that you have reason to believe are valid.
|
|
||||||
|
|
||||||
If, pursuant to or in connection with a single transaction or
|
|
||||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
||||||
covered work, and grant a patent license to some of the parties
|
|
||||||
receiving the covered work authorizing them to use, propagate, modify
|
|
||||||
or convey a specific copy of the covered work, then the patent license
|
|
||||||
you grant is automatically extended to all recipients of the covered
|
|
||||||
work and works based on it.
|
|
||||||
|
|
||||||
A patent license is "discriminatory" if it does not include within
|
|
||||||
the scope of its coverage, prohibits the exercise of, or is
|
|
||||||
conditioned on the non-exercise of one or more of the rights that are
|
|
||||||
specifically granted under this License. You may not convey a covered
|
|
||||||
work if you are a party to an arrangement with a third party that is
|
|
||||||
in the business of distributing software, under which you make payment
|
|
||||||
to the third party based on the extent of your activity of conveying
|
|
||||||
the work, and under which the third party grants, to any of the
|
|
||||||
parties who would receive the covered work from you, a discriminatory
|
|
||||||
patent license (a) in connection with copies of the covered work
|
|
||||||
conveyed by you (or copies made from those copies), or (b) primarily
|
|
||||||
for and in connection with specific products or compilations that
|
|
||||||
contain the covered work, unless you entered into that arrangement,
|
|
||||||
or that patent license was granted, prior to 28 March 2007.
|
|
||||||
|
|
||||||
Nothing in this License shall be construed as excluding or limiting
|
|
||||||
any implied license or other defenses to infringement that may
|
|
||||||
otherwise be available to you under applicable patent law.
|
|
||||||
|
|
||||||
12. No Surrender of Others' Freedom.
|
|
||||||
|
|
||||||
If conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot convey a
|
|
||||||
covered work so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you may
|
|
||||||
not convey it at all. For example, if you agree to terms that obligate you
|
|
||||||
to collect a royalty for further conveying from those to whom you convey
|
|
||||||
the Program, the only way you could satisfy both those terms and this
|
|
||||||
License would be to refrain entirely from conveying the Program.
|
|
||||||
|
|
||||||
13. Use with the GNU Affero General Public License.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, you have
|
|
||||||
permission to link or combine any covered work with a work licensed
|
|
||||||
under version 3 of the GNU Affero General Public License into a single
|
|
||||||
combined work, and to convey the resulting work. The terms of this
|
|
||||||
License will continue to apply to the part which is the covered work,
|
|
||||||
but the special requirements of the GNU Affero General Public License,
|
|
||||||
section 13, concerning interaction through a network will apply to the
|
|
||||||
combination as such.
|
|
||||||
|
|
||||||
14. Revised Versions of this License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions of
|
|
||||||
the GNU General Public License from time to time. Such new versions will
|
|
||||||
be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
|
||||||
Program specifies that a certain numbered version of the GNU General
|
|
||||||
Public License "or any later version" applies to it, you have the
|
|
||||||
option of following the terms and conditions either of that numbered
|
|
||||||
version or of any later version published by the Free Software
|
|
||||||
Foundation. If the Program does not specify a version number of the
|
|
||||||
GNU General Public License, you may choose any version ever published
|
|
||||||
by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future
|
|
||||||
versions of the GNU General Public License can be used, that proxy's
|
|
||||||
public statement of acceptance of a version permanently authorizes you
|
|
||||||
to choose that version for the Program.
|
|
||||||
|
|
||||||
Later license versions may give you additional or different
|
|
||||||
permissions. However, no additional obligations are imposed on any
|
|
||||||
author or copyright holder as a result of your choosing to follow a
|
|
||||||
later version.
|
|
||||||
|
|
||||||
15. Disclaimer of Warranty.
|
|
||||||
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
||||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
||||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
|
||||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
|
||||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
|
||||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. Limitation of Liability.
|
|
||||||
|
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
|
||||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
|
||||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
|
||||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
|
||||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
|
||||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
|
||||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
|
||||||
SUCH DAMAGES.
|
|
||||||
|
|
||||||
17. Interpretation of Sections 15 and 16.
|
|
||||||
|
|
||||||
If the disclaimer of warranty and limitation of liability provided
|
|
||||||
above cannot be given local legal effect according to their terms,
|
|
||||||
reviewing courts shall apply local law that most closely approximates
|
|
||||||
an absolute waiver of all civil liability in connection with the
|
|
||||||
Program, unless a warranty or assumption of liability accompanies a
|
|
||||||
copy of the Program in return for a fee.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
state the exclusion of warranty; and each file should have at least
|
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
{one line to give the program's name and a brief idea of what it does.}
|
|
||||||
Copyright (C) {year} {name of author}
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If the program does terminal interaction, make it output a short
|
|
||||||
notice like this when it starts in an interactive mode:
|
|
||||||
|
|
||||||
{project} Copyright (C) {year} {fullname}
|
|
||||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
||||||
This is free software, and you are welcome to redistribute it
|
|
||||||
under certain conditions; type `show c' for details.
|
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
||||||
parts of the General Public License. Of course, your program's commands
|
|
||||||
might be different; for a GUI interface, you would use an "about box".
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or school,
|
|
||||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
|
||||||
For more information on this, and how to apply and follow the GNU GPL, see
|
|
||||||
<http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
The GNU General Public License does not permit incorporating your program
|
|
||||||
into proprietary programs. If your program is a subroutine library, you
|
|
||||||
may consider it more useful to permit linking proprietary applications with
|
|
||||||
the library. If this is what you want to do, use the GNU Lesser General
|
|
||||||
Public License instead of this License. But first, please read
|
|
||||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
|
||||||
|
|||||||
182
LICENSE_BITWARDEN.txt
Normal file
182
LICENSE_BITWARDEN.txt
Normal file
@@ -0,0 +1,182 @@
|
|||||||
|
BITWARDEN LICENSE AGREEMENT
|
||||||
|
Version 1, 4 September 2020
|
||||||
|
|
||||||
|
PLEASE CAREFULLY READ THIS BITWARDEN LICENSE AGREEMENT ("AGREEMENT"). THIS
|
||||||
|
AGREEMENT CONSTITUTES A LEGALLY BINDING AGREEMENT BETWEEN YOU AND BITWARDEN,
|
||||||
|
INC. ("BITWARDEN") AND GOVERNS YOUR USE OF THE COMMERCIAL MODULES (DEFINED
|
||||||
|
BELOW). BY COPYING OR USING THE COMMERCIAL MODULES, YOU AGREE TO THIS AGREEMENT.
|
||||||
|
IF YOU DO NOT AGREE WITH THIS AGREEMENT, YOU MAY NOT COPY OR USE THE COMMERCIAL
|
||||||
|
MODULES. IF YOU ARE COPYING OR USING THE COMMERCIAL MODULES ON BEHALF OF A LEGAL
|
||||||
|
ENTITY, YOU REPRESENT AND WARRANT THAT YOU HAVE AUTHORITY TO AGREE TO THIS
|
||||||
|
AGREEMENT ON BEHALF OF SUCH ENTITY. IF YOU DO NOT HAVE SUCH AUTHORITY, DO NOT
|
||||||
|
COPY OR USE THE COMMERCIAL MODULES IN ANY MANNER.
|
||||||
|
|
||||||
|
This Agreement is entered into by and between Bitwarden and you, or the legal
|
||||||
|
entity on behalf of whom you are acting (as applicable, "You" or "Your").
|
||||||
|
|
||||||
|
1. DEFINITIONS
|
||||||
|
|
||||||
|
"Bitwarden Software" means the Bitwarden server software, libraries, and
|
||||||
|
Commercial Modules.
|
||||||
|
|
||||||
|
"Commercial Modules" means the modules designed to work with and enhance the
|
||||||
|
Bitwarden Software to which this Agreement is linked, referenced, or appended.
|
||||||
|
|
||||||
|
2. LICENSES, RESTRICTIONS AND THIRD PARTY CODE
|
||||||
|
|
||||||
|
2.1 Commercial Module License. Subject to Your compliance with this Agreement,
|
||||||
|
Bitwarden hereby grants to You a limited, non-exclusive, non-transferable,
|
||||||
|
royalty-free license to use the Commercial Modules for the sole purposes of
|
||||||
|
internal development and internal testing, and only in a non-production
|
||||||
|
environment.
|
||||||
|
|
||||||
|
2.2 Reservation of Rights. As between Bitwarden and You, Bitwarden owns all
|
||||||
|
right, title and interest in and to the Bitwarden Software, and except as
|
||||||
|
expressly set forth in Sections 2.1, no other license to the Bitwarden Software
|
||||||
|
is granted to You under this Agreement, by implication, estoppel, or otherwise.
|
||||||
|
|
||||||
|
2.3 Restrictions. You agree not to: (i) except as expressly permitted in
|
||||||
|
Section 2.1, sell, rent, lease, distribute, sublicense, loan or otherwise
|
||||||
|
transfer the Commercial Modules to any third party; (ii) alter or remove any
|
||||||
|
trademarks, service mark, and logo included with the Commercial Modules, or
|
||||||
|
(iii) use the Commercial Modules to create a competing product or service.
|
||||||
|
Bitwarden is not obligated to provide maintenance and support services for the
|
||||||
|
Bitwarden Software licensed under this Agreement.
|
||||||
|
|
||||||
|
2.4 Third Party Software. The Commercial Modules may contain or be provided
|
||||||
|
with third party open source libraries, components, utilities and other open
|
||||||
|
source software (collectively, "Open Source Software"). Notwithstanding anything
|
||||||
|
to the contrary herein, use of the Open Source Software will be subject to the
|
||||||
|
license terms and conditions applicable to such Open Source Software. To the
|
||||||
|
extent any condition of this Agreement conflicts with any license to the Open
|
||||||
|
Source Software, the Open Source Software license will govern with respect to
|
||||||
|
such Open Source Software only.
|
||||||
|
|
||||||
|
2.5 This Agreement does not grant any rights in the trademarks, service marks, or
|
||||||
|
logos of any Contributor (except as may be necessary to comply with the notice
|
||||||
|
requirements in Section 2.3), and use of any Bitwarden trademarks must comply with
|
||||||
|
Bitwarden Trademark Guidelines
|
||||||
|
<https://github.com/bitwarden/server/blob/master/TRADEMARK_GUIDELINES.md>.
|
||||||
|
|
||||||
|
3. TERMINATION
|
||||||
|
|
||||||
|
3.1 Termination. This Agreement will automatically terminate upon notice from
|
||||||
|
Bitwarden, which notice may be by email or posting in the location where the
|
||||||
|
Commercial Modules are made available.
|
||||||
|
|
||||||
|
3.2 Effect of Termination. Upon any termination of this Agreement, for any
|
||||||
|
reason, You will promptly cease use of the Commercial Modules and destroy any
|
||||||
|
copies thereof. For the avoidance of doubt, termination of this Agreement will
|
||||||
|
not affect Your right to Bitwarden Software, other than the Commercial Modules,
|
||||||
|
made available pursuant to an Open Source Software license.
|
||||||
|
|
||||||
|
3.3 Survival. Sections 1, 2.2 -2.4, 3.2, 3.3, 4, and 5 will survive any
|
||||||
|
termination of this Agreement.
|
||||||
|
|
||||||
|
4. DISCLAIMER AND LIMITATION OF LIABILITY
|
||||||
|
|
||||||
|
4.1 Disclaimer of Warranties. TO THE MAXIMUM EXTENT PERMITTED UNDER APPLICABLE
|
||||||
|
LAW, THE BITWARDEN SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED REGARDING OR RELATING TO THE BITWARDEN SOFTWARE, INCLUDING
|
||||||
|
ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
|
||||||
|
TITLE, AND NON-INFRINGEMENT. FURTHER, BITWARDEN DOES NOT WARRANT RESULTS OF USE
|
||||||
|
OR THAT THE BITWARDEN SOFTWARE WILL BE ERROR FREE OR THAT THE USE OF THE
|
||||||
|
BITWARDEN SOFTWARE WILL BE UNINTERRUPTED.
|
||||||
|
|
||||||
|
4.2 Limitation of Liability. IN NO EVENT WILL BITWARDEN OR ITS LICENSORS BE
|
||||||
|
LIABLE TO YOU OR ANY THIRD PARTY UNDER THIS AGREEMENT FOR (I) ANY AMOUNTS IN
|
||||||
|
EXCESS OF US $25 OR (II) FOR ANY SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF
|
||||||
|
ANY KIND, INCLUDING FOR ANY LOSS OF PROFITS, LOSS OF USE, BUSINESS INTERRUPTION,
|
||||||
|
LOSS OF DATA, COST OF SUBSTITUTE GOODS OR SERVICES, WHETHER ALLEGED AS A BREACH
|
||||||
|
OF CONTRACT OR TORTIOUS CONDUCT, INCLUDING NEGLIGENCE, EVEN IF BITWARDEN HAS
|
||||||
|
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||||
|
|
||||||
|
5. MISCELLANEOUS
|
||||||
|
|
||||||
|
5.1 Assignment. You may not assign or otherwise transfer this Agreement or any
|
||||||
|
rights or obligations hereunder, in whole or in part, whether by operation of
|
||||||
|
law or otherwise, to any third party without Bitwarden's prior written consent.
|
||||||
|
Any purported transfer, assignment or delegation without such prior written
|
||||||
|
consent will be null and void and of no force or effect. Bitwarden may assign
|
||||||
|
this Agreement to any successor to its business or assets to which this
|
||||||
|
Agreement relates, whether by merger, sale of assets, sale of stock,
|
||||||
|
reorganization or otherwise. Subject to this Section 5.1, this Agreement will be
|
||||||
|
binding upon and inure to the benefit of the parties hereto, and their
|
||||||
|
respective successors and permitted assigns.
|
||||||
|
|
||||||
|
5.2 Entire Agreement; Modification; Waiver. This Agreement represents the
|
||||||
|
entire agreement between the parties, and supersedes all prior agreements and
|
||||||
|
understandings, written or oral, with respect to the matters covered by this
|
||||||
|
Agreement, and is not intended to confer upon any third party any rights or
|
||||||
|
remedies hereunder. You acknowledge that You have not entered in this Agreement
|
||||||
|
based on any representations other than those contained herein. No modification
|
||||||
|
of or amendment to this Agreement, nor any waiver of any rights under this
|
||||||
|
Agreement, will be effective unless in writing and signed by both parties. The
|
||||||
|
waiver of one breach or default or any delay in exercising any rights will not
|
||||||
|
constitute a waiver of any subsequent breach or default.
|
||||||
|
|
||||||
|
5.3 Governing Law. This Agreement will in all respects be governed by the laws
|
||||||
|
of the State of California without reference to its principles of conflicts of
|
||||||
|
laws. The parties hereby agree that all disputes arising out of this Agreement
|
||||||
|
will be subject to the exclusive jurisdiction of and venue in the federal and
|
||||||
|
state courts within Los Angeles County, California. You hereby consent to the
|
||||||
|
personal and exclusive jurisdiction and venue of these courts. The parties
|
||||||
|
hereby disclaim and exclude the application hereto of the United Nations
|
||||||
|
Convention on Contracts for the International Sale of Goods.
|
||||||
|
|
||||||
|
5.4 Severability. If any provision of this Agreement is held invalid or
|
||||||
|
unenforceable under applicable law by a court of competent jurisdiction, it will
|
||||||
|
be replaced with the valid provision that most closely reflects the intent of
|
||||||
|
the parties and the remaining provisions of the Agreement will remain in full
|
||||||
|
force and effect.
|
||||||
|
|
||||||
|
5.5 Relationship of the Parties. Nothing in this Agreement is to be construed
|
||||||
|
as creating an agency, partnership, or joint venture relationship between the
|
||||||
|
parties hereto. Neither party will have any right or authority to assume or
|
||||||
|
create any obligations or to make any representations or warranties on behalf of
|
||||||
|
any other party, whether express or implied, or to bind the other party in any
|
||||||
|
respect whatsoever.
|
||||||
|
|
||||||
|
5.6 Notices. All notices permitted or required under this Agreement will be in
|
||||||
|
writing and will be deemed to have been given when delivered in person
|
||||||
|
(including by overnight courier), or three (3) business days after being mailed
|
||||||
|
by first class, registered or certified mail, postage prepaid, to the address of
|
||||||
|
the party specified in this Agreement or such other address as either party may
|
||||||
|
specify in writing.
|
||||||
|
|
||||||
|
5.7 U.S. Government Restricted Rights. If Commercial Modules is being licensed
|
||||||
|
by the U.S. Government, the Commercial Modules is deemed to be "commercial
|
||||||
|
computer software" and "commercial computer documentation" developed exclusively
|
||||||
|
at private expense, and (a) if acquired by or on behalf of a civilian agency,
|
||||||
|
will be subject solely to the terms of this computer software license as
|
||||||
|
specified in 48 C.F.R. 12.212 of the Federal Acquisition Regulations and its
|
||||||
|
successors; and (b) if acquired by or on behalf of units of the Department of
|
||||||
|
Defense ("DOD") will be subject to the terms of this commercial computer
|
||||||
|
software license as specified in 48 C.F.R. 227.7202-2, DOD FAR Supplement and
|
||||||
|
its successors.
|
||||||
|
|
||||||
|
5.8 Injunctive Relief. A breach or threatened breach by You of Section 2 may
|
||||||
|
cause irreparable harm for which damages at law may not provide adequate relief,
|
||||||
|
and therefore Bitwarden will be entitled to seek injunctive relief in any
|
||||||
|
applicable jurisdiction without being required to post a bond.
|
||||||
|
|
||||||
|
5.9 Export Law Assurances. You understand that the Commercial Modules is
|
||||||
|
subject to export control laws and regulations. You may not download or
|
||||||
|
otherwise export or re-export the Commercial Modules or any underlying
|
||||||
|
information or technology except in full compliance with all applicable laws and
|
||||||
|
regulations, in particular, but without limitation, United States export control
|
||||||
|
laws. None of the Commercial Modules or any underlying information or technology
|
||||||
|
may be downloaded or otherwise exported or re- exported: (a) into (or to a
|
||||||
|
national or resident of) any country to which the United States has embargoed
|
||||||
|
goods; or (b) to anyone on the U.S. Treasury Department's list of specially
|
||||||
|
designated nationals or the U.S. Commerce Department's list of prohibited
|
||||||
|
countries or debarred or denied persons or entities. You hereby agree to the
|
||||||
|
foregoing and represents and warrants that You are not located in, under control
|
||||||
|
of, or a national or resident of any such country or on any such list.
|
||||||
|
|
||||||
|
5.10 Construction. The titles and section headings used in this Agreement are
|
||||||
|
for ease of reference only and will not be used in the interpretation or
|
||||||
|
construction of this Agreement. No rule of construction resolving any ambiguity
|
||||||
|
in favor of the non-drafting party will be applied hereto. The word "including",
|
||||||
|
when used herein, is illustrative rather than exclusive and means "including,
|
||||||
|
without limitation."
|
||||||
674
LICENSE_GPL.txt
Normal file
674
LICENSE_GPL.txt
Normal file
@@ -0,0 +1,674 @@
|
|||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
the GNU General Public License is intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users. We, the Free Software Foundation, use the
|
||||||
|
GNU General Public License for most of our software; it applies also to
|
||||||
|
any other work released this way by its authors. You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to prevent others from denying you
|
||||||
|
these rights or asking you to surrender the rights. Therefore, you have
|
||||||
|
certain responsibilities if you distribute copies of the software, or if
|
||||||
|
you modify it: responsibilities to respect the freedom of others.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
|
or can get the source code. And you must show them these terms so they
|
||||||
|
know their rights.
|
||||||
|
|
||||||
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
|
that there is no warranty for this free software. For both users' and
|
||||||
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
|
changed, so that their problems will not be attributed erroneously to
|
||||||
|
authors of previous versions.
|
||||||
|
|
||||||
|
Some devices are designed to deny users access to install or run
|
||||||
|
modified versions of the software inside them, although the manufacturer
|
||||||
|
can do so. This is fundamentally incompatible with the aim of
|
||||||
|
protecting users' freedom to change the software. The systematic
|
||||||
|
pattern of such abuse occurs in the area of products for individuals to
|
||||||
|
use, which is precisely where it is most unacceptable. Therefore, we
|
||||||
|
have designed this version of the GPL to prohibit the practice for those
|
||||||
|
products. If such problems arise substantially in other domains, we
|
||||||
|
stand ready to extend this provision to those domains in future versions
|
||||||
|
of the GPL, as needed to protect the freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish to
|
||||||
|
avoid the special danger that patents applied to a free program could
|
||||||
|
make it effectively proprietary. To prevent this, the GPL assures that
|
||||||
|
patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Use with the GNU Affero General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the special requirements of the GNU Affero General Public License,
|
||||||
|
section 13, concerning interaction through a network will apply to the
|
||||||
|
combination as such.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
{one line to give the program's name and a brief idea of what it does.}
|
||||||
|
Copyright (C) {year} {name of author}
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program does terminal interaction, make it output a short
|
||||||
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
|
{project} Copyright (C) {year} {fullname}
|
||||||
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, your program's commands
|
||||||
|
might be different; for a GUI interface, you would use an "about box".
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
|
<http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
The GNU General Public License does not permit incorporating your program
|
||||||
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
|
may consider it more useful to permit linking proprietary applications with
|
||||||
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License. But first, please read
|
||||||
|
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||||
@@ -44,7 +44,7 @@ npm install
|
|||||||
ENV=production npm run build:watch
|
ENV=production npm run build:watch
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also manually adjusting your API endpoint settings by adding `config/development.js` overriding any of the values in `config/base.json`. For example:
|
You can also manually adjusting your API endpoint settings by adding `config/development.json` overriding any of the values in `config/base.json`. For example:
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
{
|
{
|
||||||
@@ -57,7 +57,7 @@ You can also manually adjusting your API endpoint settings by adding `config/dev
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
To pick up the overrides in the newly created `config/development.js` file, run the app with:
|
To pick up the overrides in the newly created `config/development.json` file, run the app with:
|
||||||
|
|
||||||
```
|
```
|
||||||
npm run build:dev:watch
|
npm run build:dev:watch
|
||||||
|
|||||||
3
bitwarden_license/README.md
Normal file
3
bitwarden_license/README.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Bitwarden Licensed Code
|
||||||
|
|
||||||
|
All source code under this directory is licensed under the [Bitwarden License Agreement](https://github.com/bitwarden/web/blob/master/LICENSE_BITWARDEN.txt).
|
||||||
15
bitwarden_license/src/app/app-routing.module.ts
Normal file
15
bitwarden_license/src/app/app-routing.module.ts
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { RouterModule, Routes } from '@angular/router';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: 'providers',
|
||||||
|
loadChildren: async () => (await import('./providers/providers.module')).ProvidersModule,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule],
|
||||||
|
})
|
||||||
|
export class AppRoutingModule { }
|
||||||
30
bitwarden_license/src/app/app.module.ts
Normal file
30
bitwarden_license/src/app/app.module.ts
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import { ToasterModule } from 'angular2-toaster';
|
||||||
|
import { InfiniteScrollModule } from 'ngx-infinite-scroll';
|
||||||
|
|
||||||
|
import { DragDropModule } from '@angular/cdk/drag-drop';
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
|
|
||||||
|
import { AppRoutingModule } from './app-routing.module';
|
||||||
|
|
||||||
|
import { AppComponent } from 'src/app/app.component';
|
||||||
|
import { OssRoutingModule } from 'src/app/oss-routing.module';
|
||||||
|
import { OssModule } from 'src/app/oss.module';
|
||||||
|
import { ServicesModule } from 'src/app/services/services.module';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
OssModule,
|
||||||
|
BrowserAnimationsModule,
|
||||||
|
FormsModule,
|
||||||
|
ServicesModule,
|
||||||
|
ToasterModule.forRoot(),
|
||||||
|
InfiniteScrollModule,
|
||||||
|
DragDropModule,
|
||||||
|
AppRoutingModule,
|
||||||
|
OssRoutingModule,
|
||||||
|
],
|
||||||
|
bootstrap: [AppComponent],
|
||||||
|
})
|
||||||
|
export class AppModule { }
|
||||||
17
bitwarden_license/src/app/main.ts
Normal file
17
bitwarden_license/src/app/main.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import { enableProdMode } from '@angular/core';
|
||||||
|
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||||
|
|
||||||
|
import 'bootstrap';
|
||||||
|
import 'jquery';
|
||||||
|
import 'popper.js';
|
||||||
|
|
||||||
|
// tslint:disable-next-line
|
||||||
|
require('src/scss/styles.scss');
|
||||||
|
|
||||||
|
import { AppModule } from './app.module';
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV === 'production') {
|
||||||
|
enableProdMode();
|
||||||
|
}
|
||||||
|
|
||||||
|
platformBrowserDynamic().bootstrapModule(AppModule, { preserveWhitespaces: true });
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
<div class="modal fade" tabindex="-1" role="dialog" aria-modal="true" aria-labelledby="addTitle">
|
||||||
|
<div class="modal-dialog modal-dialog-scrollable" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h2 class="modal-title" id="addTitle">
|
||||||
|
{{'addExistingOrganization' | i18n}}
|
||||||
|
</h2>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" appA11yTitle="{{'close' | i18n}}">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="card-body text-center" *ngIf="loading">
|
||||||
|
<i class="fa fa-spinner fa-spin" title="{{'loading' | i18n}}" aria-hidden="true"></i>
|
||||||
|
{{'loading' | i18n}}
|
||||||
|
</div>
|
||||||
|
<ng-container *ngIf="!loading">
|
||||||
|
<table class="table table-hover table-list">
|
||||||
|
<tr *ngFor="let o of organizations">
|
||||||
|
<td width="30">
|
||||||
|
<app-avatar [data]="o.name" size="25" [circle]="true" [fontSize]="14"></app-avatar>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{o.name}}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<button class="btn btn-outline-secondary pull-right" (click)="add(o)" [disabled]="formPromise">Add</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
import {
|
||||||
|
Component,
|
||||||
|
EventEmitter,
|
||||||
|
Input,
|
||||||
|
OnInit,
|
||||||
|
Output
|
||||||
|
} from '@angular/core';
|
||||||
|
import { ToasterService } from 'angular2-toaster';
|
||||||
|
|
||||||
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||||
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||||
|
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||||
|
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||||
|
|
||||||
|
import { ValidationService } from 'jslib-angular/services/validation.service';
|
||||||
|
|
||||||
|
import { ProviderService } from '../services/provider.service';
|
||||||
|
|
||||||
|
import { Organization } from 'jslib-common/models/domain/organization';
|
||||||
|
import { Provider } from 'jslib-common/models/domain/provider';
|
||||||
|
|
||||||
|
import { PlanType } from 'jslib-common/enums/planType';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'provider-add-organization',
|
||||||
|
templateUrl: 'add-organization.component.html',
|
||||||
|
})
|
||||||
|
export class AddOrganizationComponent implements OnInit {
|
||||||
|
|
||||||
|
@Input() providerId: string;
|
||||||
|
@Input() organizations: Organization[];
|
||||||
|
@Output() onAddedOrganization = new EventEmitter();
|
||||||
|
|
||||||
|
provider: Provider;
|
||||||
|
formPromise: Promise<any>;
|
||||||
|
loading = true;
|
||||||
|
|
||||||
|
constructor(private userService: UserService, private providerService: ProviderService,
|
||||||
|
private toasterService: ToasterService, private i18nService: I18nService,
|
||||||
|
private platformUtilsService: PlatformUtilsService, private validationService: ValidationService,
|
||||||
|
private apiService: ApiService) { }
|
||||||
|
|
||||||
|
async ngOnInit() {
|
||||||
|
await this.load();
|
||||||
|
}
|
||||||
|
|
||||||
|
async load() {
|
||||||
|
if (this.providerId == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.provider = await this.userService.getProvider(this.providerId);
|
||||||
|
|
||||||
|
this.loading = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
async add(organization: Organization) {
|
||||||
|
if (this.formPromise) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const confirmed = await this.platformUtilsService.showDialog(
|
||||||
|
this.i18nService.t('addOrganizationConfirmation', organization.name, this.provider.name), organization.name,
|
||||||
|
this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');
|
||||||
|
|
||||||
|
if (!confirmed) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
this.formPromise = this.providerService.addOrganizationToProvider(this.providerId, organization.id);
|
||||||
|
await this.formPromise;
|
||||||
|
} catch (e) {
|
||||||
|
this.validationService.showError(e);
|
||||||
|
return;
|
||||||
|
} finally {
|
||||||
|
this.formPromise = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.toasterService.popAsync('success', null, this.i18nService.t('organizationJoinedProvider'));
|
||||||
|
this.onAddedOrganization.emit();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
<div class="page-header d-flex">
|
||||||
|
<h1>{{'clients' | i18n}}</h1>
|
||||||
|
|
||||||
|
<div class="ml-auto d-flex">
|
||||||
|
<div>
|
||||||
|
<label class="sr-only" for="search">{{'search' | i18n}}</label>
|
||||||
|
<input type="search" class="form-control form-control-sm" id="search" placeholder="{{'search' | i18n}}"
|
||||||
|
[(ngModel)]="searchText">
|
||||||
|
</div>
|
||||||
|
<a class="btn btn-sm btn-outline-primary ml-3" routerLink="create" *ngIf="manageOrganizations">
|
||||||
|
<i class="fa fa-plus fa-fw" aria-hidden="true"></i>
|
||||||
|
{{'newClientOrganization' | i18n}}
|
||||||
|
</a>
|
||||||
|
<button class="btn btn-sm btn-outline-primary ml-3" (click)="addExistingOrganization()"
|
||||||
|
*ngIf="manageOrganizations && showAddExisting">
|
||||||
|
<i class="fa fa-plus fa-fw" aria-hidden="true"></i>
|
||||||
|
{{'addExistingOrganization' | i18n}}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ng-container *ngIf="loading">
|
||||||
|
<i class="fa fa-spinner fa-spin text-muted" title="{{'loading' | i18n}}" aria-hidden="true"></i>
|
||||||
|
<span class="sr-only">{{'loading' | i18n}}</span>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<ng-container
|
||||||
|
*ngIf="!loading && (clients | search:searchText:'organizationName':'id') as searchedClients">
|
||||||
|
<p *ngIf="!searchedClients.length">{{'noClientsInList' | i18n}}</p>
|
||||||
|
<ng-container *ngIf="searchedClients.length">
|
||||||
|
<table class="table table-hover table-list" infiniteScroll [infiniteScrollDistance]="1"
|
||||||
|
[infiniteScrollDisabled]="!isPaging()" (scrolled)="loadMore()">
|
||||||
|
<tbody>
|
||||||
|
<tr *ngFor="let o of searchedClients">
|
||||||
|
<td width="30">
|
||||||
|
<app-avatar [data]="o.organizationName" size="25" [circle]="true" [fontSize]="14"></app-avatar>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a [routerLink]="['/organizations', o.organizationId]">{{o.organizationName}}</a>
|
||||||
|
</td>
|
||||||
|
<td class="table-list-options" *ngIf="manageOrganizations">
|
||||||
|
<div class="dropdown" appListDropdown>
|
||||||
|
<button class="btn btn-outline-secondary dropdown-toggle" type="button"
|
||||||
|
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
|
||||||
|
appA11yTitle="{{'options' | i18n}}">
|
||||||
|
<i class="fa fa-cog fa-lg" aria-hidden="true"></i>
|
||||||
|
</button>
|
||||||
|
<div class="dropdown-menu dropdown-menu-right">
|
||||||
|
<a class="dropdown-item text-danger" href="#" appStopClick (click)="remove(o)">
|
||||||
|
<i class="fa fa-fw fa-remove" aria-hidden="true"></i>
|
||||||
|
{{'remove' | i18n}}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</ng-container>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<ng-template #add></ng-template>
|
||||||
169
bitwarden_license/src/app/providers/clients/clients.component.ts
Normal file
169
bitwarden_license/src/app/providers/clients/clients.component.ts
Normal file
@@ -0,0 +1,169 @@
|
|||||||
|
import {
|
||||||
|
Component,
|
||||||
|
ComponentFactoryResolver,
|
||||||
|
OnInit,
|
||||||
|
ViewChild,
|
||||||
|
ViewContainerRef
|
||||||
|
} from '@angular/core';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
import { ToasterService } from 'angular2-toaster';
|
||||||
|
|
||||||
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||||
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||||
|
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||||
|
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||||
|
import { SearchService } from 'jslib-common/abstractions/search.service';
|
||||||
|
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||||
|
|
||||||
|
import { PlanType } from 'jslib-common/enums/planType';
|
||||||
|
import { ProviderUserType } from 'jslib-common/enums/providerUserType';
|
||||||
|
|
||||||
|
import { ValidationService } from 'jslib-angular/services/validation.service';
|
||||||
|
|
||||||
|
import {
|
||||||
|
ProviderOrganizationOrganizationDetailsResponse
|
||||||
|
} from 'jslib-common/models/response/provider/providerOrganizationResponse';
|
||||||
|
import { Organization } from 'jslib-common/models/domain/organization';
|
||||||
|
|
||||||
|
import { ModalComponent } from 'src/app/modal.component';
|
||||||
|
|
||||||
|
import { ProviderService } from '../services/provider.service';
|
||||||
|
|
||||||
|
import { AddOrganizationComponent } from './add-organization.component';
|
||||||
|
|
||||||
|
const DisallowedPlanTypes = [PlanType.Free, PlanType.FamiliesAnnually2019, PlanType.FamiliesAnnually];
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
templateUrl: 'clients.component.html',
|
||||||
|
})
|
||||||
|
export class ClientsComponent implements OnInit {
|
||||||
|
|
||||||
|
@ViewChild('add', { read: ViewContainerRef, static: true }) addModalRef: ViewContainerRef;
|
||||||
|
|
||||||
|
providerId: any;
|
||||||
|
searchText: string;
|
||||||
|
addableOrganizations: Organization[];
|
||||||
|
loading = true;
|
||||||
|
manageOrganizations = false;
|
||||||
|
showAddExisting = false;
|
||||||
|
|
||||||
|
clients: ProviderOrganizationOrganizationDetailsResponse[];
|
||||||
|
pagedClients: ProviderOrganizationOrganizationDetailsResponse[];
|
||||||
|
modal: ModalComponent;
|
||||||
|
|
||||||
|
protected didScroll = false;
|
||||||
|
protected pageSize = 100;
|
||||||
|
protected actionPromise: Promise<any>;
|
||||||
|
private pagedClientsCount = 0;
|
||||||
|
|
||||||
|
constructor(private route: ActivatedRoute, private userService: UserService,
|
||||||
|
private apiService: ApiService, private searchService: SearchService,
|
||||||
|
private platformUtilsService: PlatformUtilsService, private i18nService: I18nService,
|
||||||
|
private toasterService: ToasterService, private validationService: ValidationService,
|
||||||
|
private providerService: ProviderService, private componentFactoryResolver: ComponentFactoryResolver,
|
||||||
|
private logService: LogService) { }
|
||||||
|
|
||||||
|
async ngOnInit() {
|
||||||
|
this.route.parent.params.subscribe(async params => {
|
||||||
|
this.providerId = params.providerId;
|
||||||
|
|
||||||
|
await this.load();
|
||||||
|
|
||||||
|
const queryParamsSub = this.route.queryParams.subscribe(async qParams => {
|
||||||
|
this.searchText = qParams.search;
|
||||||
|
if (queryParamsSub != null) {
|
||||||
|
queryParamsSub.unsubscribe();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async load() {
|
||||||
|
const response = await this.apiService.getProviderClients(this.providerId);
|
||||||
|
this.clients = response.data != null && response.data.length > 0 ? response.data : [];
|
||||||
|
this.manageOrganizations = (await this.userService.getProvider(this.providerId)).type === ProviderUserType.ProviderAdmin;
|
||||||
|
const candidateOrgs = (await this.userService.getAllOrganizations()).filter(o => o.providerId == null);
|
||||||
|
const allowedOrgsIds = await Promise.all(candidateOrgs.map(o => this.apiService.getOrganization(o.id))).then(orgs =>
|
||||||
|
orgs.filter(o => !DisallowedPlanTypes.includes(o.planType))
|
||||||
|
.map(o => o.id));
|
||||||
|
this.addableOrganizations = candidateOrgs.filter(o => allowedOrgsIds.includes(o.id));
|
||||||
|
|
||||||
|
this.showAddExisting = this.addableOrganizations.length != 0;
|
||||||
|
this.loading = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
isPaging() {
|
||||||
|
const searching = this.isSearching();
|
||||||
|
if (searching && this.didScroll) {
|
||||||
|
this.resetPaging();
|
||||||
|
}
|
||||||
|
return !searching && this.clients && this.clients.length > this.pageSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
isSearching() {
|
||||||
|
return this.searchService.isSearchable(this.searchText);
|
||||||
|
}
|
||||||
|
|
||||||
|
async resetPaging() {
|
||||||
|
this.pagedClients = [];
|
||||||
|
this.loadMore();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
loadMore() {
|
||||||
|
if (!this.clients || this.clients.length <= this.pageSize) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const pagedLength = this.pagedClients.length;
|
||||||
|
let pagedSize = this.pageSize;
|
||||||
|
if (pagedLength === 0 && this.pagedClientsCount > this.pageSize) {
|
||||||
|
pagedSize = this.pagedClientsCount;
|
||||||
|
}
|
||||||
|
if (this.clients.length > pagedLength) {
|
||||||
|
this.pagedClients = this.pagedClients.concat(this.clients.slice(pagedLength, pagedLength + pagedSize));
|
||||||
|
}
|
||||||
|
this.pagedClientsCount = this.pagedClients.length;
|
||||||
|
this.didScroll = this.pagedClients.length > this.pageSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
addExistingOrganization() {
|
||||||
|
const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);
|
||||||
|
this.modal = this.addModalRef.createComponent(factory).instance;
|
||||||
|
const childComponent = this.modal.show<AddOrganizationComponent>(AddOrganizationComponent, this.addModalRef);
|
||||||
|
|
||||||
|
childComponent.providerId = this.providerId;
|
||||||
|
childComponent.organizations = this.addableOrganizations;
|
||||||
|
childComponent.onAddedOrganization.subscribe(async () => {
|
||||||
|
try {
|
||||||
|
await this.load();
|
||||||
|
this.modal.close();
|
||||||
|
} catch (e) {
|
||||||
|
this.logService.error(`Handled exception: ${e}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.modal.onClosed.subscribe(() => {
|
||||||
|
this.modal = null;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async remove(organization: ProviderOrganizationOrganizationDetailsResponse) {
|
||||||
|
const confirmed = await this.platformUtilsService.showDialog(
|
||||||
|
this.i18nService.t('detachOrganizationConfirmation'), organization.organizationName,
|
||||||
|
this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');
|
||||||
|
|
||||||
|
if (!confirmed) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.actionPromise = this.providerService.detachOrganizastion(this.providerId, organization.id);
|
||||||
|
try {
|
||||||
|
await this.actionPromise;
|
||||||
|
this.toasterService.popAsync('success', null, this.i18nService.t('detachedOrganization', organization.organizationName));
|
||||||
|
await this.load();
|
||||||
|
} catch (e) {
|
||||||
|
this.validationService.showError(e);
|
||||||
|
}
|
||||||
|
this.actionPromise = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<div class="page-header">
|
||||||
|
<h1>{{'newClientOrganization' | i18n}}</h1>
|
||||||
|
</div>
|
||||||
|
<p>{{'newClientOrganizationDesc' | i18n}}</p>
|
||||||
|
<app-organization-plans [providerId]="providerId"></app-organization-plans>
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
import {
|
||||||
|
Component,
|
||||||
|
OnInit,
|
||||||
|
ViewChild,
|
||||||
|
} from '@angular/core';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
|
||||||
|
import { OrganizationPlansComponent } from 'src/app/settings/organization-plans.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-create-organization',
|
||||||
|
templateUrl: 'create-organization.component.html',
|
||||||
|
})
|
||||||
|
export class CreateOrganizationComponent implements OnInit {
|
||||||
|
@ViewChild(OrganizationPlansComponent, { static: true }) orgPlansComponent: OrganizationPlansComponent;
|
||||||
|
|
||||||
|
providerId: string;
|
||||||
|
|
||||||
|
constructor(private route: ActivatedRoute) { }
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.route.parent.params.subscribe(async params => {
|
||||||
|
this.providerId = params.providerId;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
<div class="mt-5 d-flex justify-content-center" *ngIf="loading">
|
||||||
|
<div>
|
||||||
|
<img src="/src/images/logo-dark@2x.png" class="mb-4 logo" alt="Bitwarden">
|
||||||
|
<p class="text-center">
|
||||||
|
<i class="fa fa-spinner fa-spin fa-2x text-muted" title="{{'loading' | i18n}}" aria-hidden="true"></i>
|
||||||
|
<span class="sr-only">{{'loading' | i18n}}</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="container" *ngIf="!loading && !authed">
|
||||||
|
<div class="row justify-content-md-center mt-5">
|
||||||
|
<div class="col-5">
|
||||||
|
<p class="lead text-center mb-4">{{'joinProvider' | i18n}}</p>
|
||||||
|
<div class="card d-block">
|
||||||
|
<div class="card-body">
|
||||||
|
<p class="text-center">
|
||||||
|
{{providerName}}
|
||||||
|
<strong class="d-block mt-2">{{email}}</strong>
|
||||||
|
</p>
|
||||||
|
<p>{{'joinProviderDesc' | i18n}}</p>
|
||||||
|
<hr>
|
||||||
|
<div class="d-flex">
|
||||||
|
<a routerLink="/" [queryParams]="{email: email}" class="btn btn-primary btn-block">
|
||||||
|
{{'logIn' | i18n}}
|
||||||
|
</a>
|
||||||
|
<a routerLink="/register" [queryParams]="{email: email}"
|
||||||
|
class="btn btn-primary btn-block ml-2 mt-0">
|
||||||
|
{{'createAccount' | i18n}}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
|
import { Toast, ToasterService } from 'angular2-toaster';
|
||||||
|
|
||||||
|
import { BaseAcceptComponent } from 'src/app/common/base.accept.component';
|
||||||
|
|
||||||
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||||
|
|
||||||
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||||
|
import { StateService } from 'jslib-common/abstractions/state.service';
|
||||||
|
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||||
|
import { ProviderUserAcceptRequest } from 'jslib-common/models/request/provider/providerUserAcceptRequest';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-accept-provider',
|
||||||
|
templateUrl: 'accept-provider.component.html',
|
||||||
|
})
|
||||||
|
export class AcceptProviderComponent extends BaseAcceptComponent {
|
||||||
|
providerName: string;
|
||||||
|
|
||||||
|
failedMessage = 'providerInviteAcceptFailed';
|
||||||
|
|
||||||
|
requiredParameters = ['providerId', 'providerUserId', 'token'];
|
||||||
|
|
||||||
|
constructor(router: Router, toasterService: ToasterService, i18nService: I18nService, route: ActivatedRoute,
|
||||||
|
userService: UserService, stateService: StateService, private apiService: ApiService) {
|
||||||
|
super(router, toasterService, i18nService, route, userService, stateService);
|
||||||
|
}
|
||||||
|
|
||||||
|
async authedHandler(qParams: any) {
|
||||||
|
const request = new ProviderUserAcceptRequest();
|
||||||
|
request.token = qParams.token;
|
||||||
|
|
||||||
|
await this.apiService.postProviderUserAccept(qParams.providerId, qParams.providerUserId, request);
|
||||||
|
const toast: Toast = {
|
||||||
|
type: 'success',
|
||||||
|
title: this.i18nService.t('inviteAccepted'),
|
||||||
|
body: this.i18nService.t('providerInviteAcceptedDesc'),
|
||||||
|
timeout: 10000,
|
||||||
|
};
|
||||||
|
this.toasterService.popAsync(toast);
|
||||||
|
this.router.navigate(['/vault']);
|
||||||
|
}
|
||||||
|
|
||||||
|
async unauthedHandler(qParams: any) {
|
||||||
|
this.providerName = qParams.providerName;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
import {
|
||||||
|
Component,
|
||||||
|
Input,
|
||||||
|
} from '@angular/core';
|
||||||
|
|
||||||
|
import { ProviderUserBulkConfirmRequest } from 'jslib-common/models/request/provider/providerUserBulkConfirmRequest';
|
||||||
|
import { ProviderUserBulkRequest } from 'jslib-common/models/request/provider/providerUserBulkRequest';
|
||||||
|
|
||||||
|
import { ProviderUserStatusType } from 'jslib-common/enums/providerUserStatusType';
|
||||||
|
|
||||||
|
import { BulkConfirmComponent as OrganizationBulkConfirmComponent } from 'src/app/organizations/manage/bulk/bulk-confirm.component';
|
||||||
|
import { BulkUserDetails } from 'src/app/organizations/manage/bulk/bulk-status.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
templateUrl: '/src/app/organizations/manage/bulk/bulk-confirm.component.html',
|
||||||
|
})
|
||||||
|
export class BulkConfirmComponent extends OrganizationBulkConfirmComponent {
|
||||||
|
|
||||||
|
@Input() providerId: string;
|
||||||
|
|
||||||
|
protected isAccepted(user: BulkUserDetails) {
|
||||||
|
return user.status === ProviderUserStatusType.Accepted;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected async getPublicKeys() {
|
||||||
|
const request = new ProviderUserBulkRequest(this.filteredUsers.map(user => user.id));
|
||||||
|
return await this.apiService.postProviderUsersPublicKey(this.providerId, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected getCryptoKey() {
|
||||||
|
return this.cryptoService.getProviderKey(this.providerId);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected async postConfirmRequest(userIdsWithKeys: any[]) {
|
||||||
|
const request = new ProviderUserBulkConfirmRequest(userIdsWithKeys);
|
||||||
|
return await this.apiService.postProviderUserBulkConfirm(this.providerId, request);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import {
|
||||||
|
Component,
|
||||||
|
Input,
|
||||||
|
} from '@angular/core';
|
||||||
|
|
||||||
|
import { ProviderUserBulkRequest } from 'jslib-common/models/request/provider/providerUserBulkRequest';
|
||||||
|
|
||||||
|
import { BulkRemoveComponent as OrganizationBulkRemoveComponent } from 'src/app/organizations/manage/bulk/bulk-remove.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
templateUrl: '/src/app/organizations/manage/bulk/bulk-remove.component.html',
|
||||||
|
})
|
||||||
|
export class BulkRemoveComponent extends OrganizationBulkRemoveComponent {
|
||||||
|
|
||||||
|
@Input() providerId: string;
|
||||||
|
|
||||||
|
async deleteUsers() {
|
||||||
|
const request = new ProviderUserBulkRequest(this.users.map(user => user.id));
|
||||||
|
return await this.apiService.deleteManyProviderUsers(this.providerId, request);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
<div class="page-header d-flex">
|
||||||
|
<h1>{{'eventLogs' | i18n}}</h1>
|
||||||
|
<div class="ml-auto d-flex">
|
||||||
|
<div class="form-inline">
|
||||||
|
<label class="sr-only" for="start">{{'startDate' | i18n}}</label>
|
||||||
|
<input type="datetime-local" class="form-control form-control-sm" id="start"
|
||||||
|
placeholder="{{'startDate' | i18n}}" [(ngModel)]="start" placeholder="YYYY-MM-DDTHH:MM"
|
||||||
|
(change)="dirtyDates = true">
|
||||||
|
<span class="mx-2">-</span>
|
||||||
|
<label class="sr-only" for="end">{{'endDate' | i18n}}</label>
|
||||||
|
<input type="datetime-local" class="form-control form-control-sm" id="end"
|
||||||
|
placeholder="{{'endDate' | i18n}}" [(ngModel)]="end" placeholder="YYYY-MM-DDTHH:MM"
|
||||||
|
(change)="dirtyDates = true">
|
||||||
|
</div>
|
||||||
|
<form #refreshForm [appApiAction]="refreshPromise" class="d-inline">
|
||||||
|
<button type="button" class="btn btn-sm btn-outline-primary ml-3" (click)="loadEvents(true)"
|
||||||
|
[disabled]="loaded && refreshForm.loading">
|
||||||
|
<i class="fa fa-refresh fa-fw" aria-hidden="true" [ngClass]="{'fa-spin': loaded && refreshForm.loading}"></i>
|
||||||
|
{{'refresh' | i18n}}
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
<form #exportForm [appApiAction]="exportPromise" class="d-inline">
|
||||||
|
<button type="button" class="btn btn-sm btn-outline-primary btn-submit manual ml-3"
|
||||||
|
[ngClass]="{loading:exportForm.loading}" (click)="exportEvents()"
|
||||||
|
[disabled]="loaded && exportForm.loading || dirtyDates">
|
||||||
|
<i class="fa fa-spinner fa-spin" aria-hidden="true"></i>
|
||||||
|
<span>{{'export' | i18n}}</span>
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<ng-container *ngIf="!loaded">
|
||||||
|
<i class="fa fa-spinner fa-spin text-muted" title="{{'loading' | i18n}}" aria-hidden="true"></i>
|
||||||
|
<span class="sr-only">{{'loading' | i18n}}</span>
|
||||||
|
</ng-container>
|
||||||
|
<ng-container *ngIf="loaded">
|
||||||
|
<p *ngIf="!events || !events.length">{{'noEventsInList' | i18n}}</p>
|
||||||
|
<table class="table table-hover" *ngIf="events && events.length">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="border-top-0" width="210">{{'timestamp' | i18n}}</th>
|
||||||
|
<th class="border-top-0" width="40">
|
||||||
|
<span class="sr-only">{{'device' | i18n}}</span>
|
||||||
|
</th>
|
||||||
|
<th class="border-top-0" width="150">{{'user' | i18n}}</th>
|
||||||
|
<th class="border-top-0">{{'event' | i18n}}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr *ngFor="let e of events">
|
||||||
|
<td>{{e.date | date:'medium'}}</td>
|
||||||
|
<td>
|
||||||
|
<i class="text-muted fa fa-lg {{e.appIcon}}" title="{{e.appName}}, {{e.ip}}" aria-hidden="true"></i>
|
||||||
|
<span class="sr-only">{{e.appName}}, {{e.ip}}</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span title="{{e.userEmail}}">{{e.userName}}</span>
|
||||||
|
</td>
|
||||||
|
<td [innerHTML]="e.message"></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<button #moreBtn [appApiAction]="morePromise" type="button" class="btn btn-block btn-link btn-submit"
|
||||||
|
(click)="loadEvents(false)" [disabled]="loaded && moreBtn.loading" *ngIf="continuationToken">
|
||||||
|
<i class="fa fa-spinner fa-spin" title="{{'loading' | i18n}}" aria-hidden="true"></i>
|
||||||
|
<span>{{'loadMore' | i18n}}</span>
|
||||||
|
</button>
|
||||||
|
</ng-container>
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
import {
|
||||||
|
Component,
|
||||||
|
OnInit,
|
||||||
|
} from '@angular/core';
|
||||||
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
|
import { ToasterService } from 'angular2-toaster';
|
||||||
|
|
||||||
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||||
|
import { ExportService } from 'jslib-common/abstractions/export.service';
|
||||||
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||||
|
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||||
|
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||||
|
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||||
|
|
||||||
|
import { UserNamePipe } from 'jslib-angular/pipes/user-name.pipe';
|
||||||
|
|
||||||
|
import { EventResponse } from 'jslib-common/models/response/eventResponse';
|
||||||
|
|
||||||
|
import { EventService } from 'src/app/services/event.service';
|
||||||
|
|
||||||
|
import { BaseEventsComponent } from 'src/app/common/base.events.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'provider-events',
|
||||||
|
templateUrl: 'events.component.html',
|
||||||
|
})
|
||||||
|
export class EventsComponent extends BaseEventsComponent implements OnInit {
|
||||||
|
exportFileName: string = 'provider-events';
|
||||||
|
providerId: string;
|
||||||
|
|
||||||
|
private providerUsersUserIdMap = new Map<string, any>();
|
||||||
|
private providerUsersIdMap = new Map<string, any>();
|
||||||
|
|
||||||
|
constructor(private apiService: ApiService, private route: ActivatedRoute, eventService: EventService,
|
||||||
|
i18nService: I18nService, toasterService: ToasterService, private userService: UserService,
|
||||||
|
exportService: ExportService, platformUtilsService: PlatformUtilsService, private router: Router,
|
||||||
|
logService: LogService, private userNamePipe: UserNamePipe) {
|
||||||
|
super(eventService, i18nService, toasterService, exportService, platformUtilsService, logService);
|
||||||
|
}
|
||||||
|
|
||||||
|
async ngOnInit() {
|
||||||
|
this.route.parent.parent.params.subscribe(async params => {
|
||||||
|
this.providerId = params.providerId;
|
||||||
|
const provider = await this.userService.getProvider(this.providerId);
|
||||||
|
if (provider == null || !provider.useEvents) {
|
||||||
|
this.router.navigate(['/providers', this.providerId]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await this.load();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async load() {
|
||||||
|
const response = await this.apiService.getProviderUsers(this.providerId);
|
||||||
|
response.data.forEach(u => {
|
||||||
|
const name = this.userNamePipe.transform(u);
|
||||||
|
this.providerUsersIdMap.set(u.id, { name: name, email: u.email });
|
||||||
|
this.providerUsersUserIdMap.set(u.userId, { name: name, email: u.email });
|
||||||
|
});
|
||||||
|
await this.loadEvents(true);
|
||||||
|
this.loaded = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected requestEvents(startDate: string, endDate: string, continuationToken: string) {
|
||||||
|
return this.apiService.getEventsProvider(this.providerId, startDate, endDate, continuationToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected getUserName(r: EventResponse, userId: string) {
|
||||||
|
return userId != null && this.providerUsersUserIdMap.has(userId) ? this.providerUsersUserIdMap.get(userId) : null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<div class="container page-content">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-3">
|
||||||
|
<div class="card" *ngIf="provider">
|
||||||
|
<div class="card-header">{{'manage' | i18n}}</div>
|
||||||
|
<div class="list-group list-group-flush">
|
||||||
|
<a routerLink="people" class="list-group-item" routerLinkActive="active"
|
||||||
|
*ngIf="provider.canManageUsers">
|
||||||
|
{{'people' | i18n}}
|
||||||
|
</a>
|
||||||
|
<a routerLink="events" class="list-group-item" routerLinkActive="active"
|
||||||
|
*ngIf="provider.canAccessEventLogs && accessEvents">
|
||||||
|
{{'eventLogs' | i18n}}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-9">
|
||||||
|
<router-outlet></router-outlet>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
import {
|
||||||
|
Component,
|
||||||
|
OnInit,
|
||||||
|
} from '@angular/core';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
|
||||||
|
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||||
|
|
||||||
|
import { Provider } from 'jslib-common/models/domain/provider';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'provider-manage',
|
||||||
|
templateUrl: 'manage.component.html',
|
||||||
|
})
|
||||||
|
export class ManageComponent implements OnInit {
|
||||||
|
provider: Provider;
|
||||||
|
accessEvents = false;
|
||||||
|
|
||||||
|
constructor(private route: ActivatedRoute, private userService: UserService) { }
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.route.parent.params.subscribe(async params => {
|
||||||
|
this.provider = await this.userService.getProvider(params.providerId);
|
||||||
|
this.accessEvents = this.provider.useEvents;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
149
bitwarden_license/src/app/providers/manage/people.component.html
Normal file
149
bitwarden_license/src/app/providers/manage/people.component.html
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
<div class="page-header d-flex">
|
||||||
|
<h1>{{'people' | i18n}}</h1>
|
||||||
|
<div class="ml-auto d-flex">
|
||||||
|
<div class="btn-group btn-group-sm" role="group">
|
||||||
|
<button type="button" class="btn btn-outline-secondary" [ngClass]="{active: status == null}"
|
||||||
|
(click)="filter(null)">
|
||||||
|
{{'all' | i18n}}
|
||||||
|
<span class="badge badge-pill badge-info" *ngIf="allCount">{{allCount}}</span>
|
||||||
|
</button>
|
||||||
|
<button type="button" class="btn btn-outline-secondary"
|
||||||
|
[ngClass]="{active: status == userStatusType.Invited}"
|
||||||
|
(click)="filter(userStatusType.Invited)">
|
||||||
|
{{'invited' | i18n}}
|
||||||
|
<span class="badge badge-pill badge-info" *ngIf="invitedCount">{{invitedCount}}</span>
|
||||||
|
</button>
|
||||||
|
<button type="button" class="btn btn-outline-secondary"
|
||||||
|
[ngClass]="{active: status == userStatusType.Accepted}"
|
||||||
|
(click)="filter(userStatusType.Accepted)">
|
||||||
|
{{'accepted' | i18n}}
|
||||||
|
<span class="badge badge-pill badge-warning" *ngIf="acceptedCount">{{acceptedCount}}</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="ml-3">
|
||||||
|
<label class="sr-only" for="search">{{'search' | i18n}}</label>
|
||||||
|
<input type="search" class="form-control form-control-sm" id="search" placeholder="{{'search' | i18n}}"
|
||||||
|
[(ngModel)]="searchText">
|
||||||
|
</div>
|
||||||
|
<div class="dropdown ml-3" appListDropdown>
|
||||||
|
<button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button" id="bulkActionsButton"
|
||||||
|
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" appA11yTitle="{{'options' | i18n}}">
|
||||||
|
<i class="fa fa-cog" aria-hidden="true"></i>
|
||||||
|
</button>
|
||||||
|
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="bulkActionsButton">
|
||||||
|
<button class="dropdown-item" appStopClick (click)="bulkReinvite()">
|
||||||
|
<i class="fa fa-fw fa-envelope-o" aria-hidden="true"></i>
|
||||||
|
{{'reinviteSelected' | i18n}}
|
||||||
|
</button>
|
||||||
|
<button class="dropdown-item text-success" appStopClick (click)="bulkConfirm()"
|
||||||
|
*ngIf="showBulkConfirmUsers">
|
||||||
|
<i class="fa fa-fw fa-check" aria-hidden="true"></i>
|
||||||
|
{{'confirmSelected' | i18n}}
|
||||||
|
</button>
|
||||||
|
<button class="dropdown-item text-danger" appStopClick (click)="bulkRemove()">
|
||||||
|
<i class="fa fa-fw fa-remove" aria-hidden="true"></i>
|
||||||
|
{{'remove' | i18n}}
|
||||||
|
</button>
|
||||||
|
<div class="dropdown-divider"></div>
|
||||||
|
<button class="dropdown-item" appStopClick (click)="selectAll(true)">
|
||||||
|
<i class="fa fa-fw fa-check-square-o" aria-hidden="true"></i>
|
||||||
|
{{'selectAll' | i18n}}
|
||||||
|
</button>
|
||||||
|
<button class="dropdown-item" appStopClick (click)="selectAll(false)">
|
||||||
|
<i class="fa fa-fw fa-minus-square-o" aria-hidden="true"></i>
|
||||||
|
{{'unselectAll' | i18n}}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button type="button" class="btn btn-sm btn-outline-primary ml-3" (click)="invite()">
|
||||||
|
<i class="fa fa-plus fa-fw" aria-hidden="true"></i>
|
||||||
|
{{'inviteUser' | i18n}}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<ng-container *ngIf="loading">
|
||||||
|
<i class="fa fa-spinner fa-spin text-muted" title="{{'loading' | i18n}}" aria-hidden="true"></i>
|
||||||
|
<span class="sr-only">{{'loading' | i18n}}</span>
|
||||||
|
</ng-container>
|
||||||
|
<ng-container
|
||||||
|
*ngIf="!loading && (isPaging() ? pagedUsers : users | search:searchText:'name':'email':'id') as searchedUsers">
|
||||||
|
<p *ngIf="!searchedUsers.length">{{'noUsersInList' | i18n}}</p>
|
||||||
|
<ng-container *ngIf="searchedUsers.length">
|
||||||
|
<app-callout type="info" title="{{'confirmUsers' | i18n}}" icon="fa-check-circle" *ngIf="showConfirmUsers">
|
||||||
|
{{'providerUsersNeedConfirmed' | i18n}}
|
||||||
|
</app-callout>
|
||||||
|
<table class="table table-hover table-list" infiniteScroll [infiniteScrollDistance]="1"
|
||||||
|
[infiniteScrollDisabled]="!isPaging()" (scrolled)="loadMore()">
|
||||||
|
<tbody>
|
||||||
|
<tr *ngFor="let u of searchedUsers">
|
||||||
|
<td (click)="checkUser(u)" class="table-list-checkbox">
|
||||||
|
<input type="checkbox" [(ngModel)]="u.checked" appStopProp>
|
||||||
|
</td>
|
||||||
|
<td width="30">
|
||||||
|
<app-avatar [data]="u | userName" [email]="u.email" size="25" [circle]="true"
|
||||||
|
[fontSize]="14"></app-avatar>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="#" appStopClick (click)="edit(u)">{{u.email}}</a>
|
||||||
|
<span class="badge badge-secondary"
|
||||||
|
*ngIf="u.status === userStatusType.Invited">{{'invited' | i18n}}</span>
|
||||||
|
<span class="badge badge-warning"
|
||||||
|
*ngIf="u.status === userStatusType.Accepted">{{'accepted' | i18n}}</span>
|
||||||
|
<small class="text-muted d-block" *ngIf="u.name">{{u.name}}</small>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<ng-container *ngIf="u.twoFactorEnabled">
|
||||||
|
<i class="fa fa-lock" title="{{'userUsingTwoStep' | i18n}}" aria-hidden="true"></i>
|
||||||
|
<span class="sr-only">{{'userUsingTwoStep' | i18n}}</span>
|
||||||
|
</ng-container>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span *ngIf="u.type === userType.ProviderAdmin">{{'providerAdmin' | i18n}}</span>
|
||||||
|
<span *ngIf="u.type === userType.ServiceUser">{{'serviceUser' | i18n}}</span>
|
||||||
|
<span *ngIf="u.type === userType.Custom">{{'custom' | i18n}}</span>
|
||||||
|
</td>
|
||||||
|
<td class="table-list-options">
|
||||||
|
<div class="dropdown" appListDropdown>
|
||||||
|
<button class="btn btn-outline-secondary dropdown-toggle" type="button"
|
||||||
|
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
|
||||||
|
appA11yTitle="{{'options' | i18n}}">
|
||||||
|
<i class="fa fa-cog fa-lg" aria-hidden="true"></i>
|
||||||
|
</button>
|
||||||
|
<div class="dropdown-menu dropdown-menu-right">
|
||||||
|
<a class="dropdown-item" href="#" appStopClick (click)="reinvite(u)"
|
||||||
|
*ngIf="u.status === userStatusType.Invited">
|
||||||
|
<i class="fa fa-fw fa-envelope-o" aria-hidden="true"></i>
|
||||||
|
{{'resendInvitation' | i18n}}
|
||||||
|
</a>
|
||||||
|
<a class="dropdown-item text-success" href="#" appStopClick (click)="confirm(u)"
|
||||||
|
*ngIf="u.status === userStatusType.Accepted">
|
||||||
|
<i class="fa fa-fw fa-check" aria-hidden="true"></i>
|
||||||
|
{{'confirm' | i18n}}
|
||||||
|
</a>
|
||||||
|
<a class="dropdown-item" href="#" appStopClick (click)="groups(u)" *ngIf="accessGroups">
|
||||||
|
<i class="fa fa-fw fa-sitemap" aria-hidden="true"></i>
|
||||||
|
{{'groups' | i18n}}
|
||||||
|
</a>
|
||||||
|
<a class="dropdown-item" href="#" appStopClick (click)="events(u)"
|
||||||
|
*ngIf="accessEvents && u.status === userStatusType.Confirmed">
|
||||||
|
<i class="fa fa-fw fa-file-text-o" aria-hidden="true"></i>
|
||||||
|
{{'eventLogs' | i18n}}
|
||||||
|
</a>
|
||||||
|
<a class="dropdown-item text-danger" href="#" appStopClick (click)="remove(u)">
|
||||||
|
<i class="fa fa-fw fa-remove" aria-hidden="true"></i>
|
||||||
|
{{'remove' | i18n}}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</ng-container>
|
||||||
|
</ng-container>
|
||||||
|
<ng-template #addEdit></ng-template>
|
||||||
|
<ng-template #eventsTemplate></ng-template>
|
||||||
|
<ng-template #confirmTemplate></ng-template>
|
||||||
|
<ng-template #bulkStatusTemplate></ng-template>
|
||||||
|
<ng-template #bulkConfirmTemplate></ng-template>
|
||||||
|
<ng-template #bulkRemoveTemplate></ng-template>
|
||||||
286
bitwarden_license/src/app/providers/manage/people.component.ts
Normal file
286
bitwarden_license/src/app/providers/manage/people.component.ts
Normal file
@@ -0,0 +1,286 @@
|
|||||||
|
import {
|
||||||
|
Component,
|
||||||
|
ComponentFactoryResolver,
|
||||||
|
OnInit,
|
||||||
|
ViewChild,
|
||||||
|
ViewContainerRef
|
||||||
|
} from '@angular/core';
|
||||||
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
|
import { ToasterService } from 'angular2-toaster';
|
||||||
|
|
||||||
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||||
|
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
||||||
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||||
|
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||||
|
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||||
|
import { SearchService } from 'jslib-common/abstractions/search.service';
|
||||||
|
import { StorageService } from 'jslib-common/abstractions/storage.service';
|
||||||
|
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||||
|
|
||||||
|
import { ValidationService } from 'jslib-angular/services/validation.service';
|
||||||
|
|
||||||
|
import { ProviderUserStatusType } from 'jslib-common/enums/providerUserStatusType';
|
||||||
|
import { ProviderUserType } from 'jslib-common/enums/providerUserType';
|
||||||
|
|
||||||
|
import { SearchPipe } from 'jslib-angular/pipes/search.pipe';
|
||||||
|
import { UserNamePipe } from 'jslib-angular/pipes/user-name.pipe';
|
||||||
|
|
||||||
|
import { ListResponse } from 'jslib-common/models/response/listResponse';
|
||||||
|
import { ProviderUserUserDetailsResponse } from 'jslib-common/models/response/provider/providerUserResponse';
|
||||||
|
|
||||||
|
import { ProviderUserBulkRequest } from 'jslib-common/models/request/provider/providerUserBulkRequest';
|
||||||
|
import { ProviderUserConfirmRequest } from 'jslib-common/models/request/provider/providerUserConfirmRequest';
|
||||||
|
import { ProviderUserBulkResponse } from 'jslib-common/models/response/provider/providerUserBulkResponse';
|
||||||
|
|
||||||
|
import { BasePeopleComponent } from 'src/app/common/base.people.component';
|
||||||
|
import { ModalComponent } from 'src/app/modal.component';
|
||||||
|
import { BulkStatusComponent } from 'src/app/organizations/manage/bulk/bulk-status.component';
|
||||||
|
import { EntityEventsComponent } from 'src/app/organizations/manage/entity-events.component';
|
||||||
|
import { BulkConfirmComponent } from './bulk/bulk-confirm.component';
|
||||||
|
import { BulkRemoveComponent } from './bulk/bulk-remove.component';
|
||||||
|
import { UserAddEditComponent } from './user-add-edit.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'provider-people',
|
||||||
|
templateUrl: 'people.component.html',
|
||||||
|
})
|
||||||
|
export class PeopleComponent extends BasePeopleComponent<ProviderUserUserDetailsResponse> implements OnInit {
|
||||||
|
|
||||||
|
@ViewChild('addEdit', { read: ViewContainerRef, static: true }) addEditModalRef: ViewContainerRef;
|
||||||
|
@ViewChild('groupsTemplate', { read: ViewContainerRef, static: true }) groupsModalRef: ViewContainerRef;
|
||||||
|
@ViewChild('eventsTemplate', { read: ViewContainerRef, static: true }) eventsModalRef: ViewContainerRef;
|
||||||
|
@ViewChild('bulkStatusTemplate', { read: ViewContainerRef, static: true }) bulkStatusModalRef: ViewContainerRef;
|
||||||
|
@ViewChild('bulkConfirmTemplate', { read: ViewContainerRef, static: true }) bulkConfirmModalRef: ViewContainerRef;
|
||||||
|
@ViewChild('bulkRemoveTemplate', { read: ViewContainerRef, static: true }) bulkRemoveModalRef: ViewContainerRef;
|
||||||
|
|
||||||
|
userType = ProviderUserType;
|
||||||
|
userStatusType = ProviderUserStatusType;
|
||||||
|
providerId: string;
|
||||||
|
accessEvents = false;
|
||||||
|
|
||||||
|
constructor(apiService: ApiService, private route: ActivatedRoute,
|
||||||
|
i18nService: I18nService, componentFactoryResolver: ComponentFactoryResolver,
|
||||||
|
platformUtilsService: PlatformUtilsService, toasterService: ToasterService,
|
||||||
|
cryptoService: CryptoService, private userService: UserService, private router: Router,
|
||||||
|
storageService: StorageService, searchService: SearchService, validationService: ValidationService,
|
||||||
|
logService: LogService, searchPipe: SearchPipe, userNamePipe: UserNamePipe) {
|
||||||
|
super(apiService, searchService, i18nService, platformUtilsService, toasterService, cryptoService,
|
||||||
|
storageService, validationService, componentFactoryResolver, logService, searchPipe, userNamePipe);
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.route.parent.params.subscribe(async params => {
|
||||||
|
this.providerId = params.providerId;
|
||||||
|
const provider = await this.userService.getProvider(this.providerId);
|
||||||
|
|
||||||
|
if (!provider.canManageUsers) {
|
||||||
|
this.router.navigate(['../'], { relativeTo: this.route });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.accessEvents = provider.useEvents;
|
||||||
|
|
||||||
|
await this.load();
|
||||||
|
|
||||||
|
const queryParamsSub = this.route.queryParams.subscribe(async qParams => {
|
||||||
|
this.searchText = qParams.search;
|
||||||
|
if (qParams.viewEvents != null) {
|
||||||
|
const user = this.users.filter(u => u.id === qParams.viewEvents);
|
||||||
|
if (user.length > 0 && user[0].status === ProviderUserStatusType.Confirmed) {
|
||||||
|
this.events(user[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (queryParamsSub != null) {
|
||||||
|
queryParamsSub.unsubscribe();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
getUsers(): Promise<ListResponse<ProviderUserUserDetailsResponse>> {
|
||||||
|
return this.apiService.getProviderUsers(this.providerId);
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteUser(id: string): Promise<any> {
|
||||||
|
return this.apiService.deleteProviderUser(this.providerId, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
reinviteUser(id: string): Promise<any> {
|
||||||
|
return this.apiService.postProviderUserReinvite(this.providerId, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
async confirmUser(user: ProviderUserUserDetailsResponse, publicKey: Uint8Array): Promise<any> {
|
||||||
|
const providerKey = await this.cryptoService.getProviderKey(this.providerId);
|
||||||
|
const key = await this.cryptoService.rsaEncrypt(providerKey.key, publicKey.buffer);
|
||||||
|
const request = new ProviderUserConfirmRequest();
|
||||||
|
request.key = key.encryptedString;
|
||||||
|
await this.apiService.postProviderUserConfirm(this.providerId, user.id, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
edit(user: ProviderUserUserDetailsResponse) {
|
||||||
|
if (this.modal != null) {
|
||||||
|
this.modal.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);
|
||||||
|
this.modal = this.addEditModalRef.createComponent(factory).instance;
|
||||||
|
const childComponent = this.modal.show<UserAddEditComponent>(
|
||||||
|
UserAddEditComponent, this.addEditModalRef);
|
||||||
|
|
||||||
|
childComponent.name = this.userNamePipe.transform(user);
|
||||||
|
childComponent.providerId = this.providerId;
|
||||||
|
childComponent.providerUserId = user != null ? user.id : null;
|
||||||
|
childComponent.onSavedUser.subscribe(() => {
|
||||||
|
this.modal.close();
|
||||||
|
this.load();
|
||||||
|
});
|
||||||
|
childComponent.onDeletedUser.subscribe(() => {
|
||||||
|
this.modal.close();
|
||||||
|
this.removeUser(user);
|
||||||
|
});
|
||||||
|
|
||||||
|
this.modal.onClosed.subscribe(() => {
|
||||||
|
this.modal = null;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async events(user: ProviderUserUserDetailsResponse) {
|
||||||
|
if (this.modal != null) {
|
||||||
|
this.modal.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);
|
||||||
|
this.modal = this.eventsModalRef.createComponent(factory).instance;
|
||||||
|
const childComponent = this.modal.show<EntityEventsComponent>(
|
||||||
|
EntityEventsComponent, this.eventsModalRef);
|
||||||
|
|
||||||
|
childComponent.name = this.userNamePipe.transform(user);
|
||||||
|
childComponent.providerId = this.providerId;
|
||||||
|
childComponent.entityId = user.id;
|
||||||
|
childComponent.showUser = false;
|
||||||
|
childComponent.entity = 'user';
|
||||||
|
|
||||||
|
this.modal.onClosed.subscribe(() => {
|
||||||
|
this.modal = null;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async bulkRemove() {
|
||||||
|
if (this.actionPromise != null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.modal != null) {
|
||||||
|
this.modal.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);
|
||||||
|
this.modal = this.bulkRemoveModalRef.createComponent(factory).instance;
|
||||||
|
const childComponent = this.modal.show(BulkRemoveComponent, this.bulkRemoveModalRef);
|
||||||
|
|
||||||
|
childComponent.providerId = this.providerId;
|
||||||
|
childComponent.users = this.getCheckedUsers();
|
||||||
|
|
||||||
|
this.modal.onClosed.subscribe(async () => {
|
||||||
|
await this.load();
|
||||||
|
this.modal = null;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async bulkReinvite() {
|
||||||
|
if (this.actionPromise != null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const users = this.getCheckedUsers();
|
||||||
|
const filteredUsers = users.filter(u => u.status === ProviderUserStatusType.Invited);
|
||||||
|
|
||||||
|
if (filteredUsers.length <= 0) {
|
||||||
|
this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),
|
||||||
|
this.i18nService.t('noSelectedUsersApplicable'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const request = new ProviderUserBulkRequest(filteredUsers.map(user => user.id));
|
||||||
|
const response = this.apiService.postManyProviderUserReinvite(this.providerId, request);
|
||||||
|
this.showBulkStatus(users, filteredUsers, response, this.i18nService.t('bulkReinviteMessage'));
|
||||||
|
} catch (e) {
|
||||||
|
this.validationService.showError(e);
|
||||||
|
}
|
||||||
|
this.actionPromise = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
async bulkConfirm() {
|
||||||
|
if (this.actionPromise != null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.modal != null) {
|
||||||
|
this.modal.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);
|
||||||
|
this.modal = this.bulkConfirmModalRef.createComponent(factory).instance;
|
||||||
|
const childComponent = this.modal.show(BulkConfirmComponent, this.bulkConfirmModalRef);
|
||||||
|
|
||||||
|
childComponent.providerId = this.providerId;
|
||||||
|
childComponent.users = this.getCheckedUsers();
|
||||||
|
|
||||||
|
this.modal.onClosed.subscribe(async () => {
|
||||||
|
await this.load();
|
||||||
|
this.modal = null;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private async showBulkStatus(users: ProviderUserUserDetailsResponse[], filteredUsers: ProviderUserUserDetailsResponse[],
|
||||||
|
request: Promise<ListResponse<ProviderUserBulkResponse>>, successfullMessage: string) {
|
||||||
|
|
||||||
|
const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);
|
||||||
|
this.modal = this.bulkStatusModalRef.createComponent(factory).instance;
|
||||||
|
const childComponent = this.modal.show<BulkStatusComponent>(
|
||||||
|
BulkStatusComponent, this.bulkStatusModalRef);
|
||||||
|
|
||||||
|
childComponent.loading = true;
|
||||||
|
|
||||||
|
// Workaround to handle closing the modal shortly after it has been opened
|
||||||
|
let close = false;
|
||||||
|
this.modal.onShown.subscribe(() => {
|
||||||
|
if (close) {
|
||||||
|
this.modal.close();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.modal.onClosed.subscribe(() => {
|
||||||
|
this.modal = null;
|
||||||
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
const response = await request;
|
||||||
|
|
||||||
|
if (this.modal) {
|
||||||
|
const keyedErrors: any = response.data.filter(r => r.error !== '').reduce((a, x) => ({ ...a, [x.id]: x.error }), {});
|
||||||
|
const keyedFilteredUsers: any = filteredUsers.reduce((a, x) => ({ ...a, [x.id]: x }), {});
|
||||||
|
|
||||||
|
childComponent.users = users.map(user => {
|
||||||
|
let message = keyedErrors[user.id] ?? successfullMessage;
|
||||||
|
if (!keyedFilteredUsers.hasOwnProperty(user.id)) {
|
||||||
|
message = this.i18nService.t('bulkFilteredMessage');
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
user: user,
|
||||||
|
error: keyedErrors.hasOwnProperty(user.id),
|
||||||
|
message: message,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
childComponent.loading = false;
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
close = true;
|
||||||
|
if (this.modal) {
|
||||||
|
this.modal.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
<div class="modal fade" tabindex="-1" role="dialog" aria-modal="true" aria-labelledby="userAddEditTitle">
|
||||||
|
<div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
|
||||||
|
<form class="modal-content" #form (ngSubmit)="submit()" [appApiAction]="formPromise" ngNativeValidate>
|
||||||
|
<div class="modal-header">
|
||||||
|
<h2 class="modal-title" id="userAddEditTitle">
|
||||||
|
{{title}}
|
||||||
|
<small class="text-muted" *ngIf="name">{{name}}</small>
|
||||||
|
</h2>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" appA11yTitle="{{'close' | i18n}}">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body" *ngIf="loading">
|
||||||
|
<i class="fa fa-spinner fa-spin text-muted" title="{{'loading' | i18n}}" aria-hidden="true"></i>
|
||||||
|
<span class="sr-only">{{'loading' | i18n}}</span>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body" *ngIf="!loading">
|
||||||
|
<ng-container *ngIf="!editMode">
|
||||||
|
<p>{{'providerInviteUserDesc' | i18n}}</p>
|
||||||
|
<div class="form-group mb-4">
|
||||||
|
<label for="emails">{{'email' | i18n}}</label>
|
||||||
|
<input id="emails" class="form-control" type="text" name="Emails" [(ngModel)]="emails" required
|
||||||
|
appAutoFocus>
|
||||||
|
<small class="text-muted">{{'inviteMultipleEmailDesc' | i18n : '20'}}</small>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
<h3>
|
||||||
|
{{'userType' | i18n}}
|
||||||
|
<a target="_blank" rel="noopener" appA11yTitle="{{'learnMore' | i18n}}"
|
||||||
|
href="https://bitwarden.com/help/article/user-types-access-control/#user-types">
|
||||||
|
<i class="fa fa-question-circle-o" aria-hidden="true"></i>
|
||||||
|
</a>
|
||||||
|
</h3>
|
||||||
|
<div class="form-check mt-2 form-check-block">
|
||||||
|
<input class="form-check-input" type="radio" name="userType" id="userTypeServiceUser"
|
||||||
|
[value]="userType.ServiceUser" [(ngModel)]="type">
|
||||||
|
<label class="form-check-label" for="userTypeServiceUser">
|
||||||
|
{{'serviceUser' | i18n}}
|
||||||
|
<small>{{'serviceUserDesc' | i18n}}</small>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check mt-2 form-check-block">
|
||||||
|
<input class="form-check-input" type="radio" name="userType" id="userTypeProviderAdmin"
|
||||||
|
[value]="userType.ProviderAdmin" [(ngModel)]="type">
|
||||||
|
<label class="form-check-label" for="userTypeProviderAdmin">
|
||||||
|
{{'providerAdmin' | i18n}}
|
||||||
|
<small>{{'providerAdminDesc' | i18n}}</small>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="submit" class="btn btn-primary btn-submit" [disabled]="form.loading">
|
||||||
|
<i class="fa fa-spinner fa-spin" title="{{'loading' | i18n}}" aria-hidden="true"></i>
|
||||||
|
<span>{{'save' | i18n}}</span>
|
||||||
|
</button>
|
||||||
|
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">
|
||||||
|
{{'cancel' | i18n}}
|
||||||
|
</button>
|
||||||
|
<div class="ml-auto">
|
||||||
|
<button #deleteBtn type="button" (click)="delete()" class="btn btn-outline-danger"
|
||||||
|
appA11yTitle="{{'delete' | i18n}}" *ngIf="editMode" [disabled]="deleteBtn.loading"
|
||||||
|
[appApiAction]="deletePromise">
|
||||||
|
<i class="fa fa-trash-o fa-lg fa-fw" [hidden]="deleteBtn.loading" aria-hidden="true"></i>
|
||||||
|
<i class="fa fa-spinner fa-spin fa-lg fa-fw" [hidden]="!deleteBtn.loading"
|
||||||
|
title="{{'loading' | i18n}}" aria-hidden="true"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,104 @@
|
|||||||
|
import {
|
||||||
|
Component,
|
||||||
|
EventEmitter,
|
||||||
|
Input,
|
||||||
|
OnInit,
|
||||||
|
Output,
|
||||||
|
} from '@angular/core';
|
||||||
|
|
||||||
|
import { ToasterService } from 'angular2-toaster';
|
||||||
|
|
||||||
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||||
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||||
|
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||||
|
|
||||||
|
import { ProviderUserInviteRequest } from 'jslib-common/models/request/provider/providerUserInviteRequest';
|
||||||
|
|
||||||
|
import { PermissionsApi } from 'jslib-common/models/api/permissionsApi';
|
||||||
|
|
||||||
|
import { ProviderUserType } from 'jslib-common/enums/providerUserType';
|
||||||
|
import { ProviderUserUpdateRequest } from 'jslib-common/models/request/provider/providerUserUpdateRequest';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'provider-user-add-edit',
|
||||||
|
templateUrl: 'user-add-edit.component.html',
|
||||||
|
})
|
||||||
|
export class UserAddEditComponent implements OnInit {
|
||||||
|
@Input() name: string;
|
||||||
|
@Input() providerUserId: string;
|
||||||
|
@Input() providerId: string;
|
||||||
|
@Output() onSavedUser = new EventEmitter();
|
||||||
|
@Output() onDeletedUser = new EventEmitter();
|
||||||
|
|
||||||
|
loading = true;
|
||||||
|
editMode: boolean = false;
|
||||||
|
title: string;
|
||||||
|
emails: string;
|
||||||
|
type: ProviderUserType = ProviderUserType.ServiceUser;
|
||||||
|
permissions = new PermissionsApi();
|
||||||
|
showCustom = false;
|
||||||
|
access: 'all' | 'selected' = 'selected';
|
||||||
|
formPromise: Promise<any>;
|
||||||
|
deletePromise: Promise<any>;
|
||||||
|
userType = ProviderUserType;
|
||||||
|
|
||||||
|
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||||
|
private toasterService: ToasterService, private platformUtilsService: PlatformUtilsService) { }
|
||||||
|
|
||||||
|
async ngOnInit() {
|
||||||
|
this.editMode = this.loading = this.providerUserId != null;
|
||||||
|
|
||||||
|
if (this.editMode) {
|
||||||
|
this.editMode = true;
|
||||||
|
this.title = this.i18nService.t('editUser');
|
||||||
|
try {
|
||||||
|
const user = await this.apiService.getProviderUser(this.providerId, this.providerUserId);
|
||||||
|
this.type = user.type;
|
||||||
|
} catch { }
|
||||||
|
} else {
|
||||||
|
this.title = this.i18nService.t('inviteUser');
|
||||||
|
}
|
||||||
|
|
||||||
|
this.loading = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
async submit() {
|
||||||
|
try {
|
||||||
|
if (this.editMode) {
|
||||||
|
const request = new ProviderUserUpdateRequest();
|
||||||
|
request.type = this.type;
|
||||||
|
this.formPromise = this.apiService.putProviderUser(this.providerId, this.providerUserId, request);
|
||||||
|
} else {
|
||||||
|
const request = new ProviderUserInviteRequest();
|
||||||
|
request.emails = this.emails.trim().split(/\s*,\s*/);
|
||||||
|
request.type = this.type;
|
||||||
|
this.formPromise = this.apiService.postProviderUserInvite(this.providerId, request);
|
||||||
|
}
|
||||||
|
await this.formPromise;
|
||||||
|
this.toasterService.popAsync('success', null,
|
||||||
|
this.i18nService.t(this.editMode ? 'editedUserId' : 'invitedUsers', this.name));
|
||||||
|
this.onSavedUser.emit();
|
||||||
|
} catch { }
|
||||||
|
}
|
||||||
|
|
||||||
|
async delete() {
|
||||||
|
if (!this.editMode) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const confirmed = await this.platformUtilsService.showDialog(
|
||||||
|
this.i18nService.t('removeUserConfirmation'), this.name,
|
||||||
|
this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');
|
||||||
|
if (!confirmed) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
this.deletePromise = this.apiService.deleteProviderUser(this.providerId, this.providerUserId);
|
||||||
|
await this.deletePromise;
|
||||||
|
this.toasterService.popAsync('success', null, this.i18nService.t('removedUserId', this.name));
|
||||||
|
this.onDeletedUser.emit();
|
||||||
|
} catch { }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
<app-navbar></app-navbar>
|
||||||
|
<div class="org-nav" *ngIf="provider">
|
||||||
|
<div class="container d-flex">
|
||||||
|
<div class="d-flex flex-column">
|
||||||
|
<div class="my-auto d-flex align-items-center pl-1">
|
||||||
|
<app-avatar [data]="provider.name" size="45" [circle]="true"></app-avatar>
|
||||||
|
<div class="org-name ml-3">
|
||||||
|
<span>{{provider.name}}</span>
|
||||||
|
<small class="text-muted">{{'provider' | i18n}}</small>
|
||||||
|
</div>
|
||||||
|
<div class="ml-3 card border-danger text-danger bg-transparent" *ngIf="!provider.enabled">
|
||||||
|
<div class="card-body py-2">
|
||||||
|
<i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
|
||||||
|
{{'providerIsDisabled' | i18n}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<ul class="nav nav-tabs" *ngIf="showMenuBar">
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" routerLink="clients" routerLinkActive="active">
|
||||||
|
<i class="fa fa-university" aria-hidden="true"></i>
|
||||||
|
{{'clients' | i18n}}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item" *ngIf="showManageTab">
|
||||||
|
<a class="nav-link" [routerLink]="manageRoute" routerLinkActive="active">
|
||||||
|
<i class="fa fa-sliders" aria-hidden="true"></i>
|
||||||
|
{{'manage' | i18n}}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item" *ngIf="showSettingsTab">
|
||||||
|
<a class="nav-link" routerLink="settings" routerLinkActive="active">
|
||||||
|
<i class="fa fa-cogs" aria-hidden="true"></i>
|
||||||
|
{{'settings' | i18n}}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="container page-content">
|
||||||
|
<router-outlet></router-outlet>
|
||||||
|
</div>
|
||||||
|
<app-footer></app-footer>
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
|
||||||
|
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||||
|
|
||||||
|
import { Provider } from 'jslib-common/models/domain/provider';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'providers-layout',
|
||||||
|
templateUrl: 'providers-layout.component.html',
|
||||||
|
})
|
||||||
|
export class ProvidersLayoutComponent {
|
||||||
|
|
||||||
|
provider: Provider;
|
||||||
|
private providerId: string;
|
||||||
|
|
||||||
|
constructor(private route: ActivatedRoute, private userService: UserService) { }
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
document.body.classList.remove('layout_frontend');
|
||||||
|
this.route.params.subscribe(async params => {
|
||||||
|
this.providerId = params.providerId;
|
||||||
|
await this.load();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async load() {
|
||||||
|
this.provider = await this.userService.getProvider(this.providerId);
|
||||||
|
}
|
||||||
|
|
||||||
|
get showMenuBar() {
|
||||||
|
return this.showManageTab || this.showSettingsTab;
|
||||||
|
}
|
||||||
|
|
||||||
|
get showManageTab() {
|
||||||
|
return this.provider.canManageUsers || this.provider.canAccessEventLogs;
|
||||||
|
}
|
||||||
|
|
||||||
|
get showSettingsTab() {
|
||||||
|
return this.provider.isProviderAdmin;
|
||||||
|
}
|
||||||
|
|
||||||
|
get manageRoute(): string {
|
||||||
|
switch (true) {
|
||||||
|
case this.provider.canManageUsers:
|
||||||
|
return 'manage/people';
|
||||||
|
case this.provider.canAccessEventLogs:
|
||||||
|
return 'manage/events';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
123
bitwarden_license/src/app/providers/providers-routing.module.ts
Normal file
123
bitwarden_license/src/app/providers/providers-routing.module.ts
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { RouterModule, Routes } from '@angular/router';
|
||||||
|
|
||||||
|
import { AuthGuardService } from 'jslib-angular/services/auth-guard.service';
|
||||||
|
import { Permissions } from 'jslib-common/enums/permissions';
|
||||||
|
|
||||||
|
import { AddOrganizationComponent } from './clients/add-organization.component';
|
||||||
|
import { ClientsComponent } from './clients/clients.component';
|
||||||
|
import { CreateOrganizationComponent } from './clients/create-organization.component';
|
||||||
|
import { AcceptProviderComponent } from './manage/accept-provider.component';
|
||||||
|
import { EventsComponent } from './manage/events.component';
|
||||||
|
import { ManageComponent } from './manage/manage.component';
|
||||||
|
import { PeopleComponent } from './manage/people.component';
|
||||||
|
import { ProvidersLayoutComponent } from './providers-layout.component';
|
||||||
|
import { SettingsComponent } from './settings/settings.component';
|
||||||
|
import { SetupProviderComponent } from './setup/setup-provider.component';
|
||||||
|
import { SetupComponent } from './setup/setup.component';
|
||||||
|
|
||||||
|
import { FrontendLayoutComponent } from 'src/app/layouts/frontend-layout.component';
|
||||||
|
|
||||||
|
import { ProvidersComponent } from 'src/app/providers/providers.component';
|
||||||
|
import { ProviderGuardService } from './services/provider-guard.service';
|
||||||
|
import { ProviderTypeGuardService } from './services/provider-type-guard.service';
|
||||||
|
import { AccountComponent } from './settings/account.component';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
canActivate: [AuthGuardService],
|
||||||
|
component: ProvidersComponent,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: FrontendLayoutComponent,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'setup-provider',
|
||||||
|
component: SetupProviderComponent,
|
||||||
|
data: { titleId: 'setupProvider' },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'accept-provider',
|
||||||
|
component: AcceptProviderComponent,
|
||||||
|
data: { titleId: 'acceptProvider' },
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
canActivate: [AuthGuardService],
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'setup',
|
||||||
|
component: SetupComponent,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: ':providerId',
|
||||||
|
component: ProvidersLayoutComponent,
|
||||||
|
canActivate: [ProviderGuardService],
|
||||||
|
children: [
|
||||||
|
{ path: '', pathMatch: 'full', redirectTo: 'clients' },
|
||||||
|
{ path: 'clients/create', component: CreateOrganizationComponent },
|
||||||
|
{ path: 'clients', component: ClientsComponent, data: { titleId: 'clients' } },
|
||||||
|
{
|
||||||
|
path: 'manage',
|
||||||
|
component: ManageComponent,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
pathMatch: 'full',
|
||||||
|
redirectTo: 'people',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'people',
|
||||||
|
component: PeopleComponent,
|
||||||
|
canActivate: [ProviderTypeGuardService],
|
||||||
|
data: {
|
||||||
|
titleId: 'people',
|
||||||
|
permissions: [Permissions.ManageUsers],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'events',
|
||||||
|
component: EventsComponent,
|
||||||
|
canActivate: [ProviderTypeGuardService],
|
||||||
|
data: {
|
||||||
|
titleId: 'eventLogs',
|
||||||
|
permissions: [Permissions.AccessEventLogs],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'settings',
|
||||||
|
component: SettingsComponent,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
pathMatch: 'full',
|
||||||
|
redirectTo: 'account',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'account',
|
||||||
|
component: AccountComponent,
|
||||||
|
canActivate: [ProviderTypeGuardService],
|
||||||
|
data: {
|
||||||
|
titleId: 'myProvider',
|
||||||
|
permissions: [Permissions.ManageProvider],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule],
|
||||||
|
})
|
||||||
|
export class ProvidersRoutingModule { }
|
||||||
62
bitwarden_license/src/app/providers/providers.module.ts
Normal file
62
bitwarden_license/src/app/providers/providers.module.ts
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
|
||||||
|
import { ProviderGuardService } from './services/provider-guard.service';
|
||||||
|
import { ProviderTypeGuardService } from './services/provider-type-guard.service';
|
||||||
|
import { ProviderService } from './services/provider.service';
|
||||||
|
|
||||||
|
import { ProvidersLayoutComponent } from './providers-layout.component';
|
||||||
|
import { ProvidersRoutingModule } from './providers-routing.module';
|
||||||
|
|
||||||
|
import { AddOrganizationComponent } from './clients/add-organization.component';
|
||||||
|
import { ClientsComponent } from './clients/clients.component';
|
||||||
|
import { CreateOrganizationComponent } from './clients/create-organization.component';
|
||||||
|
|
||||||
|
import { AcceptProviderComponent } from './manage/accept-provider.component';
|
||||||
|
import { BulkConfirmComponent } from './manage/bulk/bulk-confirm.component';
|
||||||
|
import { BulkRemoveComponent } from './manage/bulk/bulk-remove.component';
|
||||||
|
import { EventsComponent } from './manage/events.component';
|
||||||
|
import { ManageComponent } from './manage/manage.component';
|
||||||
|
import { PeopleComponent } from './manage/people.component';
|
||||||
|
import { UserAddEditComponent } from './manage/user-add-edit.component';
|
||||||
|
|
||||||
|
import { AccountComponent } from './settings/account.component';
|
||||||
|
import { SettingsComponent } from './settings/settings.component';
|
||||||
|
|
||||||
|
import { SetupProviderComponent } from './setup/setup-provider.component';
|
||||||
|
import { SetupComponent } from './setup/setup.component';
|
||||||
|
|
||||||
|
import { OssModule } from 'src/app/oss.module';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
FormsModule,
|
||||||
|
OssModule,
|
||||||
|
ProvidersRoutingModule,
|
||||||
|
],
|
||||||
|
declarations: [
|
||||||
|
AcceptProviderComponent,
|
||||||
|
AccountComponent,
|
||||||
|
AddOrganizationComponent,
|
||||||
|
BulkConfirmComponent,
|
||||||
|
BulkRemoveComponent,
|
||||||
|
ClientsComponent,
|
||||||
|
CreateOrganizationComponent,
|
||||||
|
EventsComponent,
|
||||||
|
ManageComponent,
|
||||||
|
PeopleComponent,
|
||||||
|
ProvidersLayoutComponent,
|
||||||
|
SettingsComponent,
|
||||||
|
SetupComponent,
|
||||||
|
SetupProviderComponent,
|
||||||
|
UserAddEditComponent,
|
||||||
|
],
|
||||||
|
providers: [
|
||||||
|
ProviderService,
|
||||||
|
ProviderGuardService,
|
||||||
|
ProviderTypeGuardService,
|
||||||
|
],
|
||||||
|
})
|
||||||
|
export class ProvidersModule {}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import {
|
||||||
|
ActivatedRouteSnapshot,
|
||||||
|
CanActivate,
|
||||||
|
Router,
|
||||||
|
} from '@angular/router';
|
||||||
|
|
||||||
|
import { ToasterService } from 'angular2-toaster';
|
||||||
|
|
||||||
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||||
|
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class ProviderGuardService implements CanActivate {
|
||||||
|
constructor(private userService: UserService, private router: Router,
|
||||||
|
private toasterService: ToasterService, private i18nService: I18nService) { }
|
||||||
|
|
||||||
|
async canActivate(route: ActivatedRouteSnapshot) {
|
||||||
|
const provider = await this.userService.getProvider(route.params.providerId);
|
||||||
|
if (provider == null) {
|
||||||
|
this.router.navigate(['/']);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!provider.isProviderAdmin && !provider.enabled) {
|
||||||
|
this.toasterService.popAsync('error', null, this.i18nService.t('providerIsDisabled'));
|
||||||
|
this.router.navigate(['/']);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import {
|
||||||
|
ActivatedRouteSnapshot,
|
||||||
|
CanActivate,
|
||||||
|
Router,
|
||||||
|
} from '@angular/router';
|
||||||
|
|
||||||
|
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||||
|
|
||||||
|
import { Permissions } from 'jslib-common/enums/permissions';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class ProviderTypeGuardService implements CanActivate {
|
||||||
|
constructor(private userService: UserService, private router: Router) { }
|
||||||
|
|
||||||
|
async canActivate(route: ActivatedRouteSnapshot) {
|
||||||
|
const provider = await this.userService.getProvider(route.params.providerId);
|
||||||
|
const permissions = route.data == null ? null : route.data.permissions as Permissions[];
|
||||||
|
|
||||||
|
if (
|
||||||
|
(permissions.indexOf(Permissions.AccessEventLogs) !== -1 && provider.canAccessEventLogs) ||
|
||||||
|
(permissions.indexOf(Permissions.ManageProvider) !== -1 && provider.isProviderAdmin) ||
|
||||||
|
(permissions.indexOf(Permissions.ManageUsers) !== -1 && provider.canManageUsers)
|
||||||
|
) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.router.navigate(['/providers', provider.id]);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||||
|
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
||||||
|
import { SyncService } from 'jslib-common/abstractions/sync.service';
|
||||||
|
|
||||||
|
import { ProviderAddOrganizationRequest } from 'jslib-common/models/request/provider/providerAddOrganizationRequest';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class ProviderService {
|
||||||
|
constructor(private cryptoService: CryptoService, private syncService: SyncService, private apiService: ApiService) {}
|
||||||
|
|
||||||
|
async addOrganizationToProvider(providerId: string, organizationId: string) {
|
||||||
|
const orgKey = await this.cryptoService.getOrgKey(organizationId);
|
||||||
|
const providerKey = await this.cryptoService.getProviderKey(providerId);
|
||||||
|
|
||||||
|
const encryptedOrgKey = await this.cryptoService.encrypt(orgKey.key, providerKey);
|
||||||
|
|
||||||
|
const request = new ProviderAddOrganizationRequest();
|
||||||
|
request.organizationId = organizationId;
|
||||||
|
request.key = encryptedOrgKey.encryptedString;
|
||||||
|
|
||||||
|
const response = await this.apiService.postProviderAddOrganization(providerId, request);
|
||||||
|
await this.syncService.fullSync(true);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
async detachOrganizastion(providerId: string, organizationId: string): Promise<any> {
|
||||||
|
await this.apiService.deleteProviderOrganization(providerId, organizationId);
|
||||||
|
await this.syncService.fullSync(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
<div class="page-header">
|
||||||
|
<h1>{{'myProvider' | i18n}}</h1>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="loading">
|
||||||
|
<i class="fa fa-spinner fa-spin text-muted" title="{{'loading' | i18n}}" aria-hidden="true"></i>
|
||||||
|
<span class="sr-only">{{'loading' | i18n}}</span>
|
||||||
|
</div>
|
||||||
|
<form *ngIf="provider && !loading" #form (ngSubmit)="submit()" [appApiAction]="formPromise" ngNativeValidate>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="name">{{'providerName' | i18n}}</label>
|
||||||
|
<input id="name" class="form-control" type="text" name="Name" [(ngModel)]="provider.name"
|
||||||
|
[disabled]="selfHosted">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="billingEmail">{{'billingEmail' | i18n}}</label>
|
||||||
|
<input id="billingEmail" class="form-control" type="text" name="BillingEmail"
|
||||||
|
[(ngModel)]="provider.billingEmail" [disabled]="selfHosted">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-6">
|
||||||
|
<app-avatar data="{{provider.name}}" dynamic="true" size="75" fontSize="35"></app-avatar>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button type="submit" class="btn btn-primary btn-submit" [disabled]="form.loading">
|
||||||
|
<i class="fa fa-spinner fa-spin" title="{{'loading' | i18n}}" aria-hidden="true"></i>
|
||||||
|
<span>{{'save' | i18n}}</span>
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
import { ToasterService } from 'angular2-toaster';
|
||||||
|
|
||||||
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||||
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||||
|
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||||
|
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||||
|
import { SyncService } from 'jslib-common/abstractions/sync.service';
|
||||||
|
|
||||||
|
import { ProviderUpdateRequest } from 'jslib-common/models/request/provider/providerUpdateRequest';
|
||||||
|
|
||||||
|
import { ProviderResponse } from 'jslib-common/models/response/provider/providerResponse';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'provider-account',
|
||||||
|
templateUrl: 'account.component.html',
|
||||||
|
})
|
||||||
|
export class AccountComponent {
|
||||||
|
selfHosted = false;
|
||||||
|
loading = true;
|
||||||
|
provider: ProviderResponse;
|
||||||
|
formPromise: Promise<any>;
|
||||||
|
taxFormPromise: Promise<any>;
|
||||||
|
|
||||||
|
private providerId: string;
|
||||||
|
|
||||||
|
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||||
|
private toasterService: ToasterService, private route: ActivatedRoute,
|
||||||
|
private syncService: SyncService, private platformUtilsService: PlatformUtilsService,
|
||||||
|
private logService: LogService) { }
|
||||||
|
|
||||||
|
async ngOnInit() {
|
||||||
|
this.selfHosted = this.platformUtilsService.isSelfHost();
|
||||||
|
this.route.parent.parent.params.subscribe(async params => {
|
||||||
|
this.providerId = params.providerId;
|
||||||
|
try {
|
||||||
|
this.provider = await this.apiService.getProvider(this.providerId);
|
||||||
|
} catch (e) {
|
||||||
|
this.logService.error(`Handled exception: ${e}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.loading = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
async submit() {
|
||||||
|
try {
|
||||||
|
const request = new ProviderUpdateRequest();
|
||||||
|
request.name = this.provider.name;
|
||||||
|
request.businessName = this.provider.businessName;
|
||||||
|
request.billingEmail = this.provider.billingEmail;
|
||||||
|
|
||||||
|
this.formPromise = this.apiService.putProvider(this.providerId, request).then(() => {
|
||||||
|
return this.syncService.fullSync(true);
|
||||||
|
});
|
||||||
|
await this.formPromise;
|
||||||
|
this.toasterService.popAsync('success', null, this.i18nService.t('providerUpdated'));
|
||||||
|
} catch (e) {
|
||||||
|
this.logService.error(`Handled exception: ${e}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<div class="container page-content">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-3">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">{{'settings' | i18n}}</div>
|
||||||
|
<div class="list-group list-group-flush">
|
||||||
|
<a routerLink="account" class="list-group-item" routerLinkActive="active">
|
||||||
|
{{'myProvider' | i18n}}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-9">
|
||||||
|
<router-outlet></router-outlet>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
|
||||||
|
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||||
|
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'provider-settings',
|
||||||
|
templateUrl: 'settings.component.html',
|
||||||
|
})
|
||||||
|
export class SettingsComponent {
|
||||||
|
constructor(private route: ActivatedRoute, private userService: UserService,
|
||||||
|
private platformUtilsService: PlatformUtilsService) { }
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.route.parent.params.subscribe(async params => {
|
||||||
|
const provider = await this.userService.getProvider(params.providerId);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<div class="mt-5 d-flex justify-content-center" *ngIf="loading">
|
||||||
|
<div>
|
||||||
|
<img src="/src/images/logo-dark@2x.png" class="mb-4 logo" alt="Bitwarden">
|
||||||
|
<p class="text-center">
|
||||||
|
<i class="fa fa-spinner fa-spin fa-2x text-muted" title="{{'loading' | i18n}}" aria-hidden="true"></i>
|
||||||
|
<span class="sr-only">{{'loading' | i18n}}</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="container" *ngIf="!loading && !authed">
|
||||||
|
<div class="row justify-content-md-center mt-5">
|
||||||
|
<div class="col-5">
|
||||||
|
<p class="lead text-center mb-4">{{'setupProvider' | i18n}}</p>
|
||||||
|
<div class="card d-block">
|
||||||
|
<div class="card-body">
|
||||||
|
<p>{{'setupProviderLoginDesc' | i18n}}</p>
|
||||||
|
<hr>
|
||||||
|
<div class="d-flex">
|
||||||
|
<a routerLink="/" [queryParams]="{email: email}" class="btn btn-primary btn-block">
|
||||||
|
{{'logIn' | i18n}}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
import { BaseAcceptComponent } from 'src/app/common/base.accept.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-setup-provider',
|
||||||
|
templateUrl: 'setup-provider.component.html',
|
||||||
|
})
|
||||||
|
export class SetupProviderComponent extends BaseAcceptComponent {
|
||||||
|
|
||||||
|
failedShortMessage = 'inviteAcceptFailedShort';
|
||||||
|
failedMessage = 'inviteAcceptFailed';
|
||||||
|
|
||||||
|
requiredParameters = ['providerId', 'email', 'token'];
|
||||||
|
|
||||||
|
async authedHandler(qParams: any) {
|
||||||
|
this.router.navigate(['/providers/setup'], {queryParams: qParams});
|
||||||
|
}
|
||||||
|
|
||||||
|
// tslint:disable-next-line
|
||||||
|
async unauthedHandler(qParams: any) {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<app-navbar></app-navbar>
|
||||||
|
<div class="container page-content">
|
||||||
|
<div class="page-header">
|
||||||
|
<h1>{{'setupProvider' | i18n}}</h1>
|
||||||
|
</div>
|
||||||
|
<p>{{'setupProviderDesc' | i18n}}</p>
|
||||||
|
|
||||||
|
<form #form (ngSubmit)="submit()" [appApiAction]="formPromise" ngNativeValidate *ngIf="loading">
|
||||||
|
<h2 class="mt-5">{{'generalInformation' | i18n}}</h2>
|
||||||
|
<div class="row">
|
||||||
|
<div class="form-group col-6">
|
||||||
|
<label for="name">{{'providerName' | i18n}}</label>
|
||||||
|
<input id="name" class="form-control" type="text" name="Name" [(ngModel)]="name" required>
|
||||||
|
</div>
|
||||||
|
<div class="form-group col-6">
|
||||||
|
<label for="billingEmail">{{'billingEmail' | i18n}}</label>
|
||||||
|
<input id="billingEmail" class="form-control" type="text" name="BillingEmail" [(ngModel)]="billingEmail" required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mt-4">
|
||||||
|
<button type="submit" class="btn btn-primary btn-submit" [disabled]="form.loading">
|
||||||
|
<i class="fa fa-spinner fa-spin" title="{{'loading' | i18n}}" aria-hidden="true"></i>
|
||||||
|
<span>{{'submit' | i18n}}</span>
|
||||||
|
</button>
|
||||||
|
<button type="button" class="btn btn-outline-secondary" (click)="cancel()" *ngIf="showCancel">
|
||||||
|
{{'cancel' | i18n}}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<app-footer></app-footer>
|
||||||
94
bitwarden_license/src/app/providers/setup/setup.component.ts
Normal file
94
bitwarden_license/src/app/providers/setup/setup.component.ts
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
import {
|
||||||
|
Component,
|
||||||
|
OnInit,
|
||||||
|
} from '@angular/core';
|
||||||
|
import {
|
||||||
|
ActivatedRoute,
|
||||||
|
Router,
|
||||||
|
} from '@angular/router';
|
||||||
|
import {
|
||||||
|
Toast,
|
||||||
|
ToasterService,
|
||||||
|
} from 'angular2-toaster';
|
||||||
|
|
||||||
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||||
|
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
||||||
|
|
||||||
|
import { ValidationService } from 'jslib-angular/services/validation.service';
|
||||||
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||||
|
import { SyncService } from 'jslib-common/abstractions/sync.service';
|
||||||
|
import { ProviderSetupRequest } from 'jslib-common/models/request/provider/providerSetupRequest';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'provider-setup',
|
||||||
|
templateUrl: 'setup.component.html',
|
||||||
|
})
|
||||||
|
export class SetupComponent implements OnInit {
|
||||||
|
loading = true;
|
||||||
|
authed = false;
|
||||||
|
email: string;
|
||||||
|
formPromise: Promise<any>;
|
||||||
|
|
||||||
|
providerId: string;
|
||||||
|
token: string;
|
||||||
|
name: string;
|
||||||
|
billingEmail: string;
|
||||||
|
|
||||||
|
constructor(private router: Router, private toasterService: ToasterService,
|
||||||
|
private i18nService: I18nService, private route: ActivatedRoute,
|
||||||
|
private cryptoService: CryptoService, private apiService: ApiService,
|
||||||
|
private syncService: SyncService, private validationService: ValidationService) { }
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
document.body.classList.remove('layout_frontend');
|
||||||
|
let fired = false;
|
||||||
|
this.route.queryParams.subscribe(async qParams => {
|
||||||
|
if (fired) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
fired = true;
|
||||||
|
const error = qParams.providerId == null || qParams.email == null || qParams.token == null;
|
||||||
|
|
||||||
|
if (error) {
|
||||||
|
const toast: Toast = {
|
||||||
|
type: 'error',
|
||||||
|
title: null,
|
||||||
|
body: this.i18nService.t('emergencyInviteAcceptFailed'),
|
||||||
|
timeout: 10000,
|
||||||
|
};
|
||||||
|
this.toasterService.popAsync(toast);
|
||||||
|
this.router.navigate(['/']);
|
||||||
|
} else {
|
||||||
|
this.providerId = qParams.providerId;
|
||||||
|
this.token = qParams.token;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async submit() {
|
||||||
|
this.formPromise = this.doSubmit();
|
||||||
|
await this.formPromise;
|
||||||
|
this.formPromise = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
async doSubmit() {
|
||||||
|
try {
|
||||||
|
const shareKey = await this.cryptoService.makeShareKey();
|
||||||
|
const key = shareKey[0].encryptedString;
|
||||||
|
|
||||||
|
const request = new ProviderSetupRequest();
|
||||||
|
request.name = this.name;
|
||||||
|
request.billingEmail = this.billingEmail;
|
||||||
|
request.token = this.token;
|
||||||
|
request.key = key;
|
||||||
|
|
||||||
|
const provider = await this.apiService.postProviderSetup(this.providerId, request);
|
||||||
|
this.toasterService.popAsync('success', null, this.i18nService.t('providerSetup'));
|
||||||
|
await this.syncService.fullSync(true);
|
||||||
|
|
||||||
|
this.router.navigate(['/providers', provider.id]);
|
||||||
|
} catch (e) {
|
||||||
|
this.validationService.showError(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
12
bitwarden_license/webpack.config.js
Normal file
12
bitwarden_license/webpack.config.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
const AngularCompilerPlugin = require('@ngtools/webpack').AngularCompilerPlugin;
|
||||||
|
|
||||||
|
const webpackConfig = require('../webpack.config');
|
||||||
|
|
||||||
|
webpackConfig.entry['app/main'] = './bitwarden_license/src/app/main.ts';
|
||||||
|
webpackConfig.plugins[webpackConfig.plugins.length -1] = new AngularCompilerPlugin({
|
||||||
|
tsConfigPath: 'tsconfig.json',
|
||||||
|
entryModule: 'bitwarden_license/src/app/app.module#AppModule',
|
||||||
|
sourceMap: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = webpackConfig;
|
||||||
@@ -10,3 +10,4 @@ files:
|
|||||||
zh-TW: zh_TW
|
zh-TW: zh_TW
|
||||||
en-GB: en_GB
|
en-GB: en_GB
|
||||||
en-IN: en_IN
|
en-IN: en_IN
|
||||||
|
sr-CY: sr_CY
|
||||||
|
|||||||
2
jslib
2
jslib
Submodule jslib updated: 31fe643511...0a2ff12bed
118
package-lock.json
generated
118
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "bitwarden-web",
|
"name": "bitwarden-web",
|
||||||
"version": "2.21.0",
|
"version": "2.22.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "bitwarden-web",
|
"name": "bitwarden-web",
|
||||||
"version": "2.20.4",
|
"version": "2.22.0",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -14,13 +14,13 @@
|
|||||||
"@bitwarden/jslib-common": "file:jslib/common",
|
"@bitwarden/jslib-common": "file:jslib/common",
|
||||||
"angular2-toaster": "11.0.1",
|
"angular2-toaster": "11.0.1",
|
||||||
"bootstrap": "4.6.0",
|
"bootstrap": "4.6.0",
|
||||||
"braintree-web-drop-in": "1.28.0",
|
"braintree-web-drop-in": "1.30.1",
|
||||||
"browser-hrtime": "^1.1.8",
|
"browser-hrtime": "^1.1.8",
|
||||||
"core-js": "^3.11.0",
|
"core-js": "^3.11.0",
|
||||||
"date-input-polyfill": "^2.14.0",
|
"date-input-polyfill": "^2.14.0",
|
||||||
"duo_web_sdk": "git+https://github.com/duosecurity/duo_web_sdk.git#5f9a1a8598d2cda494c4f5ee0e38b31474abfee9",
|
|
||||||
"font-awesome": "4.7.0",
|
"font-awesome": "4.7.0",
|
||||||
"jquery": "3.6.0",
|
"jquery": "3.6.0",
|
||||||
|
"ngx-infinite-scroll": "10.0.1",
|
||||||
"popper.js": "1.16.1",
|
"popper.js": "1.16.1",
|
||||||
"qrious": "4.0.2",
|
"qrious": "4.0.2",
|
||||||
"sweetalert2": "^10.16.6",
|
"sweetalert2": "^10.16.6",
|
||||||
@@ -30,7 +30,6 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular/compiler-cli": "^11.2.11",
|
"@angular/compiler-cli": "^11.2.11",
|
||||||
"@ngtools/webpack": "^11.2.10",
|
"@ngtools/webpack": "^11.2.10",
|
||||||
"@types/duo_web_sdk": "^2.7.0",
|
|
||||||
"@types/jquery": "^3.5.5",
|
"@types/jquery": "^3.5.5",
|
||||||
"@types/node": "^14.17.2",
|
"@types/node": "^14.17.2",
|
||||||
"@types/webcrypto": "^0.0.28",
|
"@types/webcrypto": "^0.0.28",
|
||||||
@@ -80,17 +79,19 @@
|
|||||||
"@angular/platform-browser-dynamic": "^11.2.11",
|
"@angular/platform-browser-dynamic": "^11.2.11",
|
||||||
"@angular/router": "^11.2.11",
|
"@angular/router": "^11.2.11",
|
||||||
"@bitwarden/jslib-common": "file:../common",
|
"@bitwarden/jslib-common": "file:../common",
|
||||||
"ngx-infinite-scroll": "10.0.1",
|
"duo_web_sdk": "git+https://github.com/duosecurity/duo_web_sdk.git",
|
||||||
"rxjs": "6.6.7",
|
"rxjs": "6.6.7",
|
||||||
"tldjs": "^2.3.1",
|
"tldjs": "^2.3.1",
|
||||||
"zone.js": "0.11.4"
|
"zone.js": "0.11.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@types/duo_web_sdk": "^2.7.1",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"typescript": "4.1.5"
|
"typescript": "4.1.5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"jslib/common": {
|
"jslib/common": {
|
||||||
|
"name": "@bitwarden/jslib-common",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -101,6 +102,7 @@
|
|||||||
"lunr": "^2.3.9",
|
"lunr": "^2.3.9",
|
||||||
"node-forge": "^0.10.0",
|
"node-forge": "^0.10.0",
|
||||||
"papaparse": "^5.3.0",
|
"papaparse": "^5.3.0",
|
||||||
|
"rxjs": "6.6.7",
|
||||||
"tldjs": "^2.3.1",
|
"tldjs": "^2.3.1",
|
||||||
"zxcvbn": "^4.4.2"
|
"zxcvbn": "^4.4.2"
|
||||||
},
|
},
|
||||||
@@ -596,9 +598,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@braintree/browser-detection": {
|
"node_modules/@braintree/browser-detection": {
|
||||||
"version": "1.11.1",
|
"version": "1.12.0",
|
||||||
"resolved": "https://registry.npmjs.org/@braintree/browser-detection/-/browser-detection-1.11.1.tgz",
|
"resolved": "https://registry.npmjs.org/@braintree/browser-detection/-/browser-detection-1.12.0.tgz",
|
||||||
"integrity": "sha512-jE5GRXNT2Ey3itbR7uTYdzbiLs9CP0kCInjTJFItApMFPj6F2Dm0Yb56C/69f7BL282gcCRqwhXVgaTeVwTWbw=="
|
"integrity": "sha512-fmZcaXYkXr9b0J+3HwXLQogIYV+xSS6aBG7LGu0OjLkSD/k62EAu2xLGEDFHUu6siH/I7vvGoC0/Ds3f3RnS6g=="
|
||||||
},
|
},
|
||||||
"node_modules/@braintree/class-list": {
|
"node_modules/@braintree/class-list": {
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
@@ -621,9 +623,9 @@
|
|||||||
"integrity": "sha512-tVpr7U6u6bqeQlHreEjYMNtnHX62vLnNWziY2kQLqkWhvusPuY5DfuGEIPpWqsd+V/a1slyTQaxK6HWTlH6A/Q=="
|
"integrity": "sha512-tVpr7U6u6bqeQlHreEjYMNtnHX62vLnNWziY2kQLqkWhvusPuY5DfuGEIPpWqsd+V/a1slyTQaxK6HWTlH6A/Q=="
|
||||||
},
|
},
|
||||||
"node_modules/@braintree/sanitize-url": {
|
"node_modules/@braintree/sanitize-url": {
|
||||||
"version": "5.0.1",
|
"version": "5.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-5.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-5.0.2.tgz",
|
||||||
"integrity": "sha512-KzIC8q/UsT8g6bwRAQ0NbOCNxRoGbPKtqGBUtDaN8WN80xqsbHFs8z+Eq0fR0W1wcrcTB5oKNACsrbkK4X+FWA=="
|
"integrity": "sha512-NBEJlHWrhQucLhZGHtSxM2loSaNUMajC7KOYJLyfcdW/6goVoff2HoYI3bz8YCDN0wKGbxtUL0gx2dvHpvnWlw=="
|
||||||
},
|
},
|
||||||
"node_modules/@braintree/uuid": {
|
"node_modules/@braintree/uuid": {
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
@@ -739,9 +741,9 @@
|
|||||||
"hasInstallScript": true
|
"hasInstallScript": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/duo_web_sdk": {
|
"node_modules/@types/duo_web_sdk": {
|
||||||
"version": "2.7.0",
|
"version": "2.7.1",
|
||||||
"resolved": "https://registry.npmjs.org/@types/duo_web_sdk/-/duo_web_sdk-2.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/duo_web_sdk/-/duo_web_sdk-2.7.1.tgz",
|
||||||
"integrity": "sha512-E8cRtor4+hYNVYZ/hk+0WoZtiGOWvxhX3UsJtNtVlDIk2d8dnbYX6wdhqBTwixPpw7ea3I8IS3BAK81GRXyLUQ==",
|
"integrity": "sha512-DePanZjFww36yGSxXwC8B3AsjrrDuPxEcufeh4gTqVsUMpCYByxjX4PERiYZdW0typzKSt9E4I14PPp+PrSIQA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/glob": {
|
"node_modules/@types/glob": {
|
||||||
@@ -1878,20 +1880,20 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/braintree-web": {
|
"node_modules/braintree-web": {
|
||||||
"version": "3.76.3",
|
"version": "3.78.2",
|
||||||
"resolved": "https://registry.npmjs.org/braintree-web/-/braintree-web-3.76.3.tgz",
|
"resolved": "https://registry.npmjs.org/braintree-web/-/braintree-web-3.78.2.tgz",
|
||||||
"integrity": "sha512-msXQ6zAs+lK0x58JOaWf5AM/+MISL4Z9P+Hm4nd6Q8SYeKXmu94wRTWYJYJj0S3PnuyoPyBqh9AYOjs709bkAQ==",
|
"integrity": "sha512-aYKlog3j4BBAgUjRq52gn54/6Kp9zR7PalAzfhych/OArNq9xL0kO+OuQM7V0AxkTyoOHZ1qswIQ9MYPRws/ag==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@braintree/asset-loader": "0.4.4",
|
"@braintree/asset-loader": "0.4.4",
|
||||||
"@braintree/browser-detection": "1.11.1",
|
"@braintree/browser-detection": "1.12.0",
|
||||||
"@braintree/class-list": "0.2.0",
|
"@braintree/class-list": "0.2.0",
|
||||||
"@braintree/event-emitter": "0.4.1",
|
"@braintree/event-emitter": "0.4.1",
|
||||||
"@braintree/extended-promise": "0.4.1",
|
"@braintree/extended-promise": "0.4.1",
|
||||||
"@braintree/iframer": "1.1.0",
|
"@braintree/iframer": "1.1.0",
|
||||||
"@braintree/sanitize-url": "5.0.1",
|
"@braintree/sanitize-url": "5.0.2",
|
||||||
"@braintree/uuid": "0.1.0",
|
"@braintree/uuid": "0.1.0",
|
||||||
"@braintree/wrap-promise": "2.1.0",
|
"@braintree/wrap-promise": "2.1.0",
|
||||||
"card-validator": "8.1.0",
|
"card-validator": "8.1.1",
|
||||||
"credit-card-type": "9.1.0",
|
"credit-card-type": "9.1.0",
|
||||||
"framebus": "5.1.2",
|
"framebus": "5.1.2",
|
||||||
"inject-stylesheet": "4.0.0",
|
"inject-stylesheet": "4.0.0",
|
||||||
@@ -1900,17 +1902,17 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/braintree-web-drop-in": {
|
"node_modules/braintree-web-drop-in": {
|
||||||
"version": "1.28.0",
|
"version": "1.30.1",
|
||||||
"resolved": "https://registry.npmjs.org/braintree-web-drop-in/-/braintree-web-drop-in-1.28.0.tgz",
|
"resolved": "https://registry.npmjs.org/braintree-web-drop-in/-/braintree-web-drop-in-1.30.1.tgz",
|
||||||
"integrity": "sha512-PM4+BgOGWRKvOwNQdNmxhJaezj9Bxz0jXSLs3xK85z/mppBpEOurM0x7xdSiN5gOCJ6PCuGYXLRFYR/+jA27Mg==",
|
"integrity": "sha512-W4sbiHZwrK16RWxBe7iYv986N1TlgO+eBdRdukW0qYNakTWSvgNzB9xk8RNpd1RB3Wt6zb64i4ZMU8A/MW+WAQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@braintree/asset-loader": "0.4.4",
|
"@braintree/asset-loader": "0.4.4",
|
||||||
"@braintree/browser-detection": "1.11.1",
|
"@braintree/browser-detection": "1.12.0",
|
||||||
"@braintree/class-list": "0.2.0",
|
"@braintree/class-list": "0.2.0",
|
||||||
"@braintree/event-emitter": "0.4.1",
|
"@braintree/event-emitter": "0.4.1",
|
||||||
"@braintree/uuid": "0.1.0",
|
"@braintree/uuid": "0.1.0",
|
||||||
"@braintree/wrap-promise": "2.1.0",
|
"@braintree/wrap-promise": "2.1.0",
|
||||||
"braintree-web": "3.76.3",
|
"braintree-web": "3.78.2",
|
||||||
"promise-polyfill": "8.2.0"
|
"promise-polyfill": "8.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -2214,11 +2216,11 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/card-validator": {
|
"node_modules/card-validator": {
|
||||||
"version": "8.1.0",
|
"version": "8.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/card-validator/-/card-validator-8.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/card-validator/-/card-validator-8.1.1.tgz",
|
||||||
"integrity": "sha512-KlWjnGs6DyxRj9DLGPv+sb7AvU9Y6Od7DJWjnTghzplzsKz/vTYqRMK46xO/BCpHNqvnFNNVbSQa1vBFJ+/o8g==",
|
"integrity": "sha512-cN4FsKwoTfTFnqPwVc7TQLSsH/QMDB3n/gWm0XelcApz4sKipnOQ6k33sa3bWsNnnIpgs7eXOF+mUV2UQAX2Sw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"credit-card-type": "^9.0.0"
|
"credit-card-type": "^9.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/caseless": {
|
"node_modules/caseless": {
|
||||||
@@ -3670,7 +3672,7 @@
|
|||||||
},
|
},
|
||||||
"node_modules/duo_web_sdk": {
|
"node_modules/duo_web_sdk": {
|
||||||
"version": "2.7.0",
|
"version": "2.7.0",
|
||||||
"resolved": "git+https://github.com/duosecurity/duo_web_sdk.git#5f9a1a8598d2cda494c4f5ee0e38b31474abfee9",
|
"resolved": "git+ssh://git@github.com/duosecurity/duo_web_sdk.git#5f9a1a8598d2cda494c4f5ee0e38b31474abfee9",
|
||||||
"integrity": "sha512-SYnekrMvi6aON7atFPE8H+F6JjXrz5HgVGbmc7GQH2mvYz6DH0Grh+MWNeB1LwD7D8nzrWbnhbZM77U2hoWrxQ==",
|
"integrity": "sha512-SYnekrMvi6aON7atFPE8H+F6JjXrz5HgVGbmc7GQH2mvYz6DH0Grh+MWNeB1LwD7D8nzrWbnhbZM77U2hoWrxQ==",
|
||||||
"license": "SEE LICENSE IN LICENSE"
|
"license": "SEE LICENSE IN LICENSE"
|
||||||
},
|
},
|
||||||
@@ -14661,7 +14663,8 @@
|
|||||||
"@angular/platform-browser-dynamic": "^11.2.11",
|
"@angular/platform-browser-dynamic": "^11.2.11",
|
||||||
"@angular/router": "^11.2.11",
|
"@angular/router": "^11.2.11",
|
||||||
"@bitwarden/jslib-common": "file:../common",
|
"@bitwarden/jslib-common": "file:../common",
|
||||||
"ngx-infinite-scroll": "10.0.1",
|
"@types/duo_web_sdk": "^2.7.1",
|
||||||
|
"duo_web_sdk": "git+https://github.com/duosecurity/duo_web_sdk.git",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"rxjs": "6.6.7",
|
"rxjs": "6.6.7",
|
||||||
"tldjs": "^2.3.1",
|
"tldjs": "^2.3.1",
|
||||||
@@ -14686,6 +14689,7 @@
|
|||||||
"node-forge": "^0.10.0",
|
"node-forge": "^0.10.0",
|
||||||
"papaparse": "^5.3.0",
|
"papaparse": "^5.3.0",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
|
"rxjs": "6.6.7",
|
||||||
"tldjs": "^2.3.1",
|
"tldjs": "^2.3.1",
|
||||||
"typescript": "4.1.5",
|
"typescript": "4.1.5",
|
||||||
"zxcvbn": "^4.4.2"
|
"zxcvbn": "^4.4.2"
|
||||||
@@ -14700,9 +14704,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@braintree/browser-detection": {
|
"@braintree/browser-detection": {
|
||||||
"version": "1.11.1",
|
"version": "1.12.0",
|
||||||
"resolved": "https://registry.npmjs.org/@braintree/browser-detection/-/browser-detection-1.11.1.tgz",
|
"resolved": "https://registry.npmjs.org/@braintree/browser-detection/-/browser-detection-1.12.0.tgz",
|
||||||
"integrity": "sha512-jE5GRXNT2Ey3itbR7uTYdzbiLs9CP0kCInjTJFItApMFPj6F2Dm0Yb56C/69f7BL282gcCRqwhXVgaTeVwTWbw=="
|
"integrity": "sha512-fmZcaXYkXr9b0J+3HwXLQogIYV+xSS6aBG7LGu0OjLkSD/k62EAu2xLGEDFHUu6siH/I7vvGoC0/Ds3f3RnS6g=="
|
||||||
},
|
},
|
||||||
"@braintree/class-list": {
|
"@braintree/class-list": {
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
@@ -14725,9 +14729,9 @@
|
|||||||
"integrity": "sha512-tVpr7U6u6bqeQlHreEjYMNtnHX62vLnNWziY2kQLqkWhvusPuY5DfuGEIPpWqsd+V/a1slyTQaxK6HWTlH6A/Q=="
|
"integrity": "sha512-tVpr7U6u6bqeQlHreEjYMNtnHX62vLnNWziY2kQLqkWhvusPuY5DfuGEIPpWqsd+V/a1slyTQaxK6HWTlH6A/Q=="
|
||||||
},
|
},
|
||||||
"@braintree/sanitize-url": {
|
"@braintree/sanitize-url": {
|
||||||
"version": "5.0.1",
|
"version": "5.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-5.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-5.0.2.tgz",
|
||||||
"integrity": "sha512-KzIC8q/UsT8g6bwRAQ0NbOCNxRoGbPKtqGBUtDaN8WN80xqsbHFs8z+Eq0fR0W1wcrcTB5oKNACsrbkK4X+FWA=="
|
"integrity": "sha512-NBEJlHWrhQucLhZGHtSxM2loSaNUMajC7KOYJLyfcdW/6goVoff2HoYI3bz8YCDN0wKGbxtUL0gx2dvHpvnWlw=="
|
||||||
},
|
},
|
||||||
"@braintree/uuid": {
|
"@braintree/uuid": {
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
@@ -14817,9 +14821,9 @@
|
|||||||
"integrity": "sha512-b2iE8kjjzzUo2WZ0xuE2N77kfnTds7ClrDxcz3Atz7h2XrNVoAPUoT75i7CY0st5x++70V91Y+c6RpBX9MX7Jg=="
|
"integrity": "sha512-b2iE8kjjzzUo2WZ0xuE2N77kfnTds7ClrDxcz3Atz7h2XrNVoAPUoT75i7CY0st5x++70V91Y+c6RpBX9MX7Jg=="
|
||||||
},
|
},
|
||||||
"@types/duo_web_sdk": {
|
"@types/duo_web_sdk": {
|
||||||
"version": "2.7.0",
|
"version": "2.7.1",
|
||||||
"resolved": "https://registry.npmjs.org/@types/duo_web_sdk/-/duo_web_sdk-2.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/duo_web_sdk/-/duo_web_sdk-2.7.1.tgz",
|
||||||
"integrity": "sha512-E8cRtor4+hYNVYZ/hk+0WoZtiGOWvxhX3UsJtNtVlDIk2d8dnbYX6wdhqBTwixPpw7ea3I8IS3BAK81GRXyLUQ==",
|
"integrity": "sha512-DePanZjFww36yGSxXwC8B3AsjrrDuPxEcufeh4gTqVsUMpCYByxjX4PERiYZdW0typzKSt9E4I14PPp+PrSIQA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/glob": {
|
"@types/glob": {
|
||||||
@@ -15787,20 +15791,20 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"braintree-web": {
|
"braintree-web": {
|
||||||
"version": "3.76.3",
|
"version": "3.78.2",
|
||||||
"resolved": "https://registry.npmjs.org/braintree-web/-/braintree-web-3.76.3.tgz",
|
"resolved": "https://registry.npmjs.org/braintree-web/-/braintree-web-3.78.2.tgz",
|
||||||
"integrity": "sha512-msXQ6zAs+lK0x58JOaWf5AM/+MISL4Z9P+Hm4nd6Q8SYeKXmu94wRTWYJYJj0S3PnuyoPyBqh9AYOjs709bkAQ==",
|
"integrity": "sha512-aYKlog3j4BBAgUjRq52gn54/6Kp9zR7PalAzfhych/OArNq9xL0kO+OuQM7V0AxkTyoOHZ1qswIQ9MYPRws/ag==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@braintree/asset-loader": "0.4.4",
|
"@braintree/asset-loader": "0.4.4",
|
||||||
"@braintree/browser-detection": "1.11.1",
|
"@braintree/browser-detection": "1.12.0",
|
||||||
"@braintree/class-list": "0.2.0",
|
"@braintree/class-list": "0.2.0",
|
||||||
"@braintree/event-emitter": "0.4.1",
|
"@braintree/event-emitter": "0.4.1",
|
||||||
"@braintree/extended-promise": "0.4.1",
|
"@braintree/extended-promise": "0.4.1",
|
||||||
"@braintree/iframer": "1.1.0",
|
"@braintree/iframer": "1.1.0",
|
||||||
"@braintree/sanitize-url": "5.0.1",
|
"@braintree/sanitize-url": "5.0.2",
|
||||||
"@braintree/uuid": "0.1.0",
|
"@braintree/uuid": "0.1.0",
|
||||||
"@braintree/wrap-promise": "2.1.0",
|
"@braintree/wrap-promise": "2.1.0",
|
||||||
"card-validator": "8.1.0",
|
"card-validator": "8.1.1",
|
||||||
"credit-card-type": "9.1.0",
|
"credit-card-type": "9.1.0",
|
||||||
"framebus": "5.1.2",
|
"framebus": "5.1.2",
|
||||||
"inject-stylesheet": "4.0.0",
|
"inject-stylesheet": "4.0.0",
|
||||||
@@ -15809,17 +15813,17 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"braintree-web-drop-in": {
|
"braintree-web-drop-in": {
|
||||||
"version": "1.28.0",
|
"version": "1.30.1",
|
||||||
"resolved": "https://registry.npmjs.org/braintree-web-drop-in/-/braintree-web-drop-in-1.28.0.tgz",
|
"resolved": "https://registry.npmjs.org/braintree-web-drop-in/-/braintree-web-drop-in-1.30.1.tgz",
|
||||||
"integrity": "sha512-PM4+BgOGWRKvOwNQdNmxhJaezj9Bxz0jXSLs3xK85z/mppBpEOurM0x7xdSiN5gOCJ6PCuGYXLRFYR/+jA27Mg==",
|
"integrity": "sha512-W4sbiHZwrK16RWxBe7iYv986N1TlgO+eBdRdukW0qYNakTWSvgNzB9xk8RNpd1RB3Wt6zb64i4ZMU8A/MW+WAQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@braintree/asset-loader": "0.4.4",
|
"@braintree/asset-loader": "0.4.4",
|
||||||
"@braintree/browser-detection": "1.11.1",
|
"@braintree/browser-detection": "1.12.0",
|
||||||
"@braintree/class-list": "0.2.0",
|
"@braintree/class-list": "0.2.0",
|
||||||
"@braintree/event-emitter": "0.4.1",
|
"@braintree/event-emitter": "0.4.1",
|
||||||
"@braintree/uuid": "0.1.0",
|
"@braintree/uuid": "0.1.0",
|
||||||
"@braintree/wrap-promise": "2.1.0",
|
"@braintree/wrap-promise": "2.1.0",
|
||||||
"braintree-web": "3.76.3",
|
"braintree-web": "3.78.2",
|
||||||
"promise-polyfill": "8.2.0"
|
"promise-polyfill": "8.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -16073,11 +16077,11 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"card-validator": {
|
"card-validator": {
|
||||||
"version": "8.1.0",
|
"version": "8.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/card-validator/-/card-validator-8.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/card-validator/-/card-validator-8.1.1.tgz",
|
||||||
"integrity": "sha512-KlWjnGs6DyxRj9DLGPv+sb7AvU9Y6Od7DJWjnTghzplzsKz/vTYqRMK46xO/BCpHNqvnFNNVbSQa1vBFJ+/o8g==",
|
"integrity": "sha512-cN4FsKwoTfTFnqPwVc7TQLSsH/QMDB3n/gWm0XelcApz4sKipnOQ6k33sa3bWsNnnIpgs7eXOF+mUV2UQAX2Sw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"credit-card-type": "^9.0.0"
|
"credit-card-type": "^9.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"caseless": {
|
"caseless": {
|
||||||
@@ -17254,7 +17258,7 @@
|
|||||||
"duo_web_sdk": {
|
"duo_web_sdk": {
|
||||||
"version": "git+ssh://git@github.com/duosecurity/duo_web_sdk.git#5f9a1a8598d2cda494c4f5ee0e38b31474abfee9",
|
"version": "git+ssh://git@github.com/duosecurity/duo_web_sdk.git#5f9a1a8598d2cda494c4f5ee0e38b31474abfee9",
|
||||||
"integrity": "sha512-SYnekrMvi6aON7atFPE8H+F6JjXrz5HgVGbmc7GQH2mvYz6DH0Grh+MWNeB1LwD7D8nzrWbnhbZM77U2hoWrxQ==",
|
"integrity": "sha512-SYnekrMvi6aON7atFPE8H+F6JjXrz5HgVGbmc7GQH2mvYz6DH0Grh+MWNeB1LwD7D8nzrWbnhbZM77U2hoWrxQ==",
|
||||||
"from": "duo_web_sdk@git+https://github.com/duosecurity/duo_web_sdk.git#5f9a1a8598d2cda494c4f5ee0e38b31474abfee9"
|
"from": "duo_web_sdk@git+https://github.com/duosecurity/duo_web_sdk.git"
|
||||||
},
|
},
|
||||||
"duplexify": {
|
"duplexify": {
|
||||||
"version": "3.7.1",
|
"version": "3.7.1",
|
||||||
|
|||||||
41
package.json
41
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "bitwarden-web",
|
"name": "bitwarden-web",
|
||||||
"version": "2.21.0",
|
"version": "2.22.0",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"repository": "https://github.com/bitwarden/web",
|
"repository": "https://github.com/bitwarden/web",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -11,30 +11,35 @@
|
|||||||
"symlink:win": "rm -rf ./jslib && cmd /c mklink /J .\\jslib ..\\jslib",
|
"symlink:win": "rm -rf ./jslib && cmd /c mklink /J .\\jslib ..\\jslib",
|
||||||
"symlink:mac": "npm run symlink:lin",
|
"symlink:mac": "npm run symlink:lin",
|
||||||
"symlink:lin": "rm -rf ./jslib && ln -s ../jslib ./jslib",
|
"symlink:lin": "rm -rf ./jslib && ln -s ../jslib ./jslib",
|
||||||
"build": "gulp prebuild && webpack",
|
"build": "gulp prebuild && webpack -c bitwarden_license/webpack.config.js",
|
||||||
"build:watch": "gulp prebuild && webpack serve",
|
"build:oss": "gulp prebuild && webpack",
|
||||||
"build:dev": "gulp prebuild && cross-env ENV=development webpack",
|
"build:watch": "gulp prebuild && webpack serve -c bitwarden_license/webpack.config.js",
|
||||||
"build:dev:watch": "gulp prebuild && cross-env ENV=development webpack serve",
|
"build:watch:oss": "gulp prebuild && webpack serve",
|
||||||
"build:qa": "gulp prebuild && cross-env NODE_ENV=production ENV=qa webpack",
|
"build:dev": "cross-env ENV=development npm run build",
|
||||||
"build:qa:watch": "gulp prebuild && cross-env NODE_ENV=production ENV=qa webpack serve",
|
"build:dev:watch": "cross-env ENV=development npm run build:watch",
|
||||||
"build:prod": "gulp prebuild && cross-env NODE_ENV=production ENV=production webpack",
|
"build:qa": "cross-env NODE_ENV=production ENV=qa npm run build",
|
||||||
"build:prod:watch": "gulp prebuild && cross-env NODE_ENV=production ENV=production webpack serve",
|
"build:qa:watch": "cross-env NODE_ENV=production ENV=qa npm run build:watch",
|
||||||
"build:selfhost": "gulp prebuild && cross-env SELF_HOST=true webpack serve",
|
"build:prod": "cross-env NODE_ENV=production ENV=production npm run build",
|
||||||
"build:selfhost:watch": "gulp prebuild && cross-env SELF_HOST=true webpack serve",
|
"build:prod:oss": "cross-env NODE_ENV=production ENV=production npm run build:oss",
|
||||||
"build:selfhost:prod": "gulp prebuild && cross-env SELF_HOST=true NODE_ENV=production webpack",
|
"build:prod:watch": "cross-env NODE_ENV=production ENV=production npm run build:watch",
|
||||||
"build:selfhost:prod:watch": "gulp prebuild && cross-env SELF_HOST=true NODE_ENV=production webpack serve",
|
"build:selfhost": "cross-env SELF_HOST=true npm run build:watch",
|
||||||
|
"build:selfhost:watch": "cross-env SELF_HOST=true npm run build:watch",
|
||||||
|
"build:selfhost:prod": "cross-env SELF_HOST=true NODE_ENV=production npm run build",
|
||||||
|
"build:selfhost:prod:oss": "cross-env SELF_HOST=true NODE_ENV=production npm run build:oss",
|
||||||
|
"build:selfhost:prod:watch": "cross-env SELF_HOST=true NODE_ENV=production npm run build:watch",
|
||||||
"clean:l10n": "git push origin --delete l10n_master",
|
"clean:l10n": "git push origin --delete l10n_master",
|
||||||
"dist": "npm run build:prod && gulp postdist",
|
"dist": "npm run build:prod && gulp postdist",
|
||||||
|
"dist:oss": "npm run build:prod:oss && gulp postdist",
|
||||||
"dist:selfhost": "npm run build:selfhost:prod && gulp postdist",
|
"dist:selfhost": "npm run build:selfhost:prod && gulp postdist",
|
||||||
|
"dist:selfhost:oss": "npm run build:selfhost:prod:oss && gulp postdist",
|
||||||
"deploy": "npm run dist && gh-pages -d build",
|
"deploy": "npm run dist && gh-pages -d build",
|
||||||
"deploy:dev": "npm run dist && gh-pages -d build -r git@github.com:kspearrin/bitwarden-web-dev.git",
|
"deploy:dev": "npm run dist && gh-pages -d build -r git@github.com:kspearrin/bitwarden-web-dev.git",
|
||||||
"lint": "tslint 'src/**/*.ts' || true",
|
"lint": "tslint 'src/**/*.ts' 'bitwarden_license/src/**/*.ts' || true",
|
||||||
"lint:fix": "tslint 'src/**/*.ts' --fix"
|
"lint:fix": "tslint 'src/**/*.ts' 'bitwarden_license/src/**/*.ts' --fix"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular/compiler-cli": "^11.2.11",
|
"@angular/compiler-cli": "^11.2.11",
|
||||||
"@ngtools/webpack": "^11.2.10",
|
"@ngtools/webpack": "^11.2.10",
|
||||||
"@types/duo_web_sdk": "^2.7.0",
|
|
||||||
"@types/jquery": "^3.5.5",
|
"@types/jquery": "^3.5.5",
|
||||||
"@types/node": "^14.17.2",
|
"@types/node": "^14.17.2",
|
||||||
"@types/webcrypto": "^0.0.28",
|
"@types/webcrypto": "^0.0.28",
|
||||||
@@ -69,13 +74,13 @@
|
|||||||
"@bitwarden/jslib-common": "file:jslib/common",
|
"@bitwarden/jslib-common": "file:jslib/common",
|
||||||
"angular2-toaster": "11.0.1",
|
"angular2-toaster": "11.0.1",
|
||||||
"bootstrap": "4.6.0",
|
"bootstrap": "4.6.0",
|
||||||
"braintree-web-drop-in": "1.28.0",
|
"braintree-web-drop-in": "1.30.1",
|
||||||
"browser-hrtime": "^1.1.8",
|
"browser-hrtime": "^1.1.8",
|
||||||
"core-js": "^3.11.0",
|
"core-js": "^3.11.0",
|
||||||
"date-input-polyfill": "^2.14.0",
|
"date-input-polyfill": "^2.14.0",
|
||||||
"duo_web_sdk": "git+https://github.com/duosecurity/duo_web_sdk.git#5f9a1a8598d2cda494c4f5ee0e38b31474abfee9",
|
|
||||||
"font-awesome": "4.7.0",
|
"font-awesome": "4.7.0",
|
||||||
"jquery": "3.6.0",
|
"jquery": "3.6.0",
|
||||||
|
"ngx-infinite-scroll": "^10.0.1",
|
||||||
"popper.js": "1.16.1",
|
"popper.js": "1.16.1",
|
||||||
"qrious": "4.0.2",
|
"qrious": "4.0.2",
|
||||||
"sweetalert2": "^10.16.6",
|
"sweetalert2": "^10.16.6",
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
"ids": [
|
"ids": [
|
||||||
"https://vault.bitwarden.com",
|
"https://vault.bitwarden.com",
|
||||||
"ios:bundle-id:com.8bit.bitwarden",
|
"ios:bundle-id:com.8bit.bitwarden",
|
||||||
"android:apk-key-hash:dUGFzUzf3lmHSLBDBIv+WaFyZMI"
|
"android:apk-key-hash:dUGFzUzf3lmHSLBDBIv+WaFyZMI",
|
||||||
|
"android:apk-key-hash:pSCbprJwYtwCZOPOpmU6YuPBs/g"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
import {
|
import { Component } from '@angular/core';
|
||||||
Component,
|
|
||||||
OnInit,
|
|
||||||
} from '@angular/core';
|
|
||||||
import {
|
import {
|
||||||
ActivatedRoute,
|
ActivatedRoute,
|
||||||
Router,
|
Router,
|
||||||
@@ -17,39 +14,30 @@ import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
|||||||
import { StateService } from 'jslib-common/abstractions/state.service';
|
import { StateService } from 'jslib-common/abstractions/state.service';
|
||||||
import { UserService } from 'jslib-common/abstractions/user.service';
|
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||||
import { EmergencyAccessAcceptRequest } from 'jslib-common/models/request/emergencyAccessAcceptRequest';
|
import { EmergencyAccessAcceptRequest } from 'jslib-common/models/request/emergencyAccessAcceptRequest';
|
||||||
|
import { BaseAcceptComponent } from '../common/base.accept.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-accept-emergency',
|
selector: 'app-accept-emergency',
|
||||||
templateUrl: 'accept-emergency.component.html',
|
templateUrl: 'accept-emergency.component.html',
|
||||||
})
|
})
|
||||||
export class AcceptEmergencyComponent implements OnInit {
|
export class AcceptEmergencyComponent extends BaseAcceptComponent {
|
||||||
loading = true;
|
|
||||||
authed = false;
|
|
||||||
name: string;
|
name: string;
|
||||||
email: string;
|
|
||||||
actionPromise: Promise<any>;
|
|
||||||
|
|
||||||
constructor(private router: Router, private toasterService: ToasterService,
|
protected requiredParameters: string[] = ['id', 'name', 'email', 'token'];
|
||||||
private i18nService: I18nService, private route: ActivatedRoute,
|
protected failedShortMessage = 'emergencyInviteAcceptFailedShort';
|
||||||
private apiService: ApiService, private userService: UserService,
|
protected failedMessage = 'emergencyInviteAcceptFailed';
|
||||||
private stateService: StateService) { }
|
|
||||||
|
|
||||||
ngOnInit() {
|
constructor(router: Router, toasterService: ToasterService,
|
||||||
let fired = false;
|
i18nService: I18nService, route: ActivatedRoute,
|
||||||
this.route.queryParams.subscribe(async qParams => {
|
private apiService: ApiService, userService: UserService,
|
||||||
if (fired) {
|
stateService: StateService) {
|
||||||
return;
|
super(router, toasterService, i18nService, route, userService, stateService);
|
||||||
}
|
}
|
||||||
fired = true;
|
|
||||||
await this.stateService.remove('emergencyInvitation');
|
async authedHandler(qParams: any): Promise<void> {
|
||||||
let error = qParams.id == null || qParams.name == null || qParams.email == null || qParams.token == null;
|
|
||||||
let errorMessage: string = null;
|
|
||||||
if (!error) {
|
|
||||||
this.authed = await this.userService.isAuthenticated();
|
|
||||||
if (this.authed) {
|
|
||||||
const request = new EmergencyAccessAcceptRequest();
|
const request = new EmergencyAccessAcceptRequest();
|
||||||
request.token = qParams.token;
|
request.token = qParams.token;
|
||||||
try {
|
|
||||||
this.actionPromise = this.apiService.postEmergencyAccessAccept(qParams.id, request);
|
this.actionPromise = this.apiService.postEmergencyAccessAccept(qParams.id, request);
|
||||||
await this.actionPromise;
|
await this.actionPromise;
|
||||||
const toast: Toast = {
|
const toast: Toast = {
|
||||||
@@ -60,34 +48,13 @@ export class AcceptEmergencyComponent implements OnInit {
|
|||||||
};
|
};
|
||||||
this.toasterService.popAsync(toast);
|
this.toasterService.popAsync(toast);
|
||||||
this.router.navigate(['/vault']);
|
this.router.navigate(['/vault']);
|
||||||
} catch (e) {
|
|
||||||
error = true;
|
|
||||||
errorMessage = e.message;
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
await this.stateService.save('emergencyInvitation', qParams);
|
async unauthedHandler(qParams: any): Promise<void> {
|
||||||
this.email = qParams.email;
|
|
||||||
this.name = qParams.name;
|
this.name = qParams.name;
|
||||||
if (this.name != null) {
|
if (this.name != null) {
|
||||||
// Fix URL encoding of space issue with Angular
|
// Fix URL encoding of space issue with Angular
|
||||||
this.name = this.name.replace(/\+/g, ' ');
|
this.name = this.name.replace(/\+/g, ' ');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (error) {
|
|
||||||
const toast: Toast = {
|
|
||||||
type: 'error',
|
|
||||||
title: null,
|
|
||||||
body: errorMessage != null ? this.i18nService.t('emergencyInviteAcceptFailedShort', errorMessage) :
|
|
||||||
this.i18nService.t('emergencyInviteAcceptFailed'),
|
|
||||||
timeout: 10000,
|
|
||||||
};
|
|
||||||
this.toasterService.popAsync(toast);
|
|
||||||
this.router.navigate(['/']);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
import {
|
import { Component } from '@angular/core';
|
||||||
Component,
|
|
||||||
OnInit,
|
|
||||||
} from '@angular/core';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ActivatedRoute,
|
ActivatedRoute,
|
||||||
Router,
|
Router,
|
||||||
@@ -25,40 +21,28 @@ import { OrganizationUserResetPasswordEnrollmentRequest } from 'jslib-common/mod
|
|||||||
|
|
||||||
import { Utils } from 'jslib-common/misc/utils';
|
import { Utils } from 'jslib-common/misc/utils';
|
||||||
import { Policy } from 'jslib-common/models/domain/policy';
|
import { Policy } from 'jslib-common/models/domain/policy';
|
||||||
|
import { BaseAcceptComponent } from '../common/base.accept.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-accept-organization',
|
selector: 'app-accept-organization',
|
||||||
templateUrl: 'accept-organization.component.html',
|
templateUrl: 'accept-organization.component.html',
|
||||||
})
|
})
|
||||||
export class AcceptOrganizationComponent implements OnInit {
|
export class AcceptOrganizationComponent extends BaseAcceptComponent {
|
||||||
loading = true;
|
|
||||||
authed = false;
|
|
||||||
orgName: string;
|
orgName: string;
|
||||||
email: string;
|
|
||||||
actionPromise: Promise<any>;
|
|
||||||
|
|
||||||
constructor(private router: Router, private toasterService: ToasterService,
|
protected requiredParameters: string[] = ['organizationId', 'organizationUserId', 'token'];
|
||||||
private i18nService: I18nService, private route: ActivatedRoute,
|
|
||||||
private apiService: ApiService, private userService: UserService,
|
|
||||||
private stateService: StateService, private cryptoService: CryptoService,
|
|
||||||
private policyService: PolicyService) { }
|
|
||||||
|
|
||||||
ngOnInit() {
|
constructor(router: Router, toasterService: ToasterService,
|
||||||
let fired = false;
|
i18nService: I18nService, route: ActivatedRoute,
|
||||||
this.route.queryParams.subscribe(async qParams => {
|
private apiService: ApiService, userService: UserService,
|
||||||
if (fired) {
|
stateService: StateService, private cryptoService: CryptoService,
|
||||||
return;
|
private policyService: PolicyService) {
|
||||||
|
super(router, toasterService, i18nService, route, userService, stateService);
|
||||||
}
|
}
|
||||||
fired = true;
|
|
||||||
await this.stateService.remove('orgInvitation');
|
async authedHandler(qParams: any): Promise<void> {
|
||||||
let error = qParams.organizationId == null || qParams.organizationUserId == null || qParams.token == null;
|
|
||||||
let errorMessage: string = null;
|
|
||||||
if (!error) {
|
|
||||||
this.authed = await this.userService.isAuthenticated();
|
|
||||||
if (this.authed) {
|
|
||||||
const request = new OrganizationUserAcceptRequest();
|
const request = new OrganizationUserAcceptRequest();
|
||||||
request.token = qParams.token;
|
request.token = qParams.token;
|
||||||
try {
|
|
||||||
if (await this.performResetPasswordAutoEnroll(qParams)) {
|
if (await this.performResetPasswordAutoEnroll(qParams)) {
|
||||||
this.actionPromise = this.apiService.postOrganizationUserAccept(qParams.organizationId,
|
this.actionPromise = this.apiService.postOrganizationUserAccept(qParams.organizationId,
|
||||||
qParams.organizationUserId, request).then(() => {
|
qParams.organizationUserId, request).then(() => {
|
||||||
@@ -97,36 +81,18 @@ export class AcceptOrganizationComponent implements OnInit {
|
|||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
};
|
};
|
||||||
this.toasterService.popAsync(toast);
|
this.toasterService.popAsync(toast);
|
||||||
|
|
||||||
|
await this.stateService.remove('orgInvitation');
|
||||||
this.router.navigate(['/vault']);
|
this.router.navigate(['/vault']);
|
||||||
} catch (e) {
|
|
||||||
error = true;
|
|
||||||
errorMessage = e.message;
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
await this.stateService.save('orgInvitation', qParams);
|
async unauthedHandler(qParams: any): Promise<void> {
|
||||||
this.email = qParams.email;
|
|
||||||
this.orgName = qParams.organizationName;
|
this.orgName = qParams.organizationName;
|
||||||
if (this.orgName != null) {
|
if (this.orgName != null) {
|
||||||
// Fix URL encoding of space issue with Angular
|
// Fix URL encoding of space issue with Angular
|
||||||
this.orgName = this.orgName.replace(/\+/g, ' ');
|
this.orgName = this.orgName.replace(/\+/g, ' ');
|
||||||
}
|
}
|
||||||
}
|
await this.stateService.save('orgInvitation', qParams);
|
||||||
}
|
|
||||||
|
|
||||||
if (error) {
|
|
||||||
const toast: Toast = {
|
|
||||||
type: 'error',
|
|
||||||
title: null,
|
|
||||||
body: errorMessage != null ? this.i18nService.t('inviteAcceptFailedShort', errorMessage) :
|
|
||||||
this.i18nService.t('inviteAcceptFailed'),
|
|
||||||
timeout: 10000,
|
|
||||||
};
|
|
||||||
this.toasterService.popAsync(toast);
|
|
||||||
this.router.navigate(['/']);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async performResetPasswordAutoEnroll(qParams: any): Promise<boolean> {
|
private async performResetPasswordAutoEnroll(qParams: any): Promise<boolean> {
|
||||||
|
|||||||
@@ -30,11 +30,12 @@
|
|||||||
<a routerLink="/hint">{{'getMasterPasswordHint' | i18n}}</a>
|
<a routerLink="/hint">{{'getMasterPasswordHint' | i18n}}</a>
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check">
|
<div class="form-check mb-3">
|
||||||
<input type="checkbox" class="form-check-input" id="rememberEmail" name="RememberEmail"
|
<input type="checkbox" class="form-check-input" id="rememberEmail" name="RememberEmail"
|
||||||
[(ngModel)]="rememberEmail">
|
[(ngModel)]="rememberEmail">
|
||||||
<label class="form-check-label" for="rememberEmail">{{'rememberEmail' | i18n}}</label>
|
<label class="form-check-label" for="rememberEmail">{{'rememberEmail' | i18n}}</label>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="mb-n3" [hidden]="!showCaptcha()"><iframe id="hcaptcha_iframe" height="80"></iframe></div>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
<button type="submit" class="btn btn-primary btn-block btn-submit" [disabled]="form.loading">
|
<button type="submit" class="btn btn-primary btn-block btn-submit" [disabled]="form.loading">
|
||||||
|
|||||||
@@ -76,13 +76,6 @@ export class LoginComponent extends BaseLoginComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async goAfterLogIn() {
|
async goAfterLogIn() {
|
||||||
const orgInvite = await this.stateService.get<any>('orgInvitation');
|
|
||||||
const emergencyInvite = await this.stateService.get<any>('emergencyInvitation');
|
|
||||||
if (orgInvite != null) {
|
|
||||||
this.router.navigate(['accept-organization'], { queryParams: orgInvite });
|
|
||||||
} else if (emergencyInvite != null) {
|
|
||||||
this.router.navigate(['accept-emergency'], { queryParams: emergencyInvite });
|
|
||||||
} else {
|
|
||||||
const loginRedirect = await this.stateService.get<any>('loginRedirect');
|
const loginRedirect = await this.stateService.get<any>('loginRedirect');
|
||||||
if (loginRedirect != null) {
|
if (loginRedirect != null) {
|
||||||
this.router.navigate([loginRedirect.route], { queryParams: loginRedirect.qParams });
|
this.router.navigate([loginRedirect.route], { queryParams: loginRedirect.qParams });
|
||||||
@@ -91,5 +84,4 @@ export class LoginComponent extends BaseLoginComponent {
|
|||||||
this.router.navigate([this.successRoute]);
|
this.router.navigate([this.successRoute]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,6 +121,7 @@
|
|||||||
<input id="hint" class="form-control" type="text" name="Hint" [(ngModel)]="hint">
|
<input id="hint" class="form-control" type="text" name="Hint" [(ngModel)]="hint">
|
||||||
<small class="form-text text-muted">{{'masterPassHintDesc' | i18n}}</small>
|
<small class="form-text text-muted">{{'masterPassHintDesc' | i18n}}</small>
|
||||||
</div>
|
</div>
|
||||||
|
<div [hidden]="!showCaptcha()"><iframe id="hcaptcha_iframe" height="80"></iframe></div>
|
||||||
<div class="form-group" *ngIf="showTerms">
|
<div class="form-group" *ngIf="showTerms">
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="checkbox" id="acceptPolicies"
|
<input class="form-check-input" type="checkbox" id="acceptPolicies"
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import {
|
|||||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||||
import { AuthService } from 'jslib-common/abstractions/auth.service';
|
import { AuthService } from 'jslib-common/abstractions/auth.service';
|
||||||
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
||||||
|
import { EnvironmentService } from 'jslib-common/abstractions/environment.service';
|
||||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||||
import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service';
|
import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service';
|
||||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||||
@@ -36,9 +37,10 @@ export class RegisterComponent extends BaseRegisterComponent {
|
|||||||
i18nService: I18nService, cryptoService: CryptoService,
|
i18nService: I18nService, cryptoService: CryptoService,
|
||||||
apiService: ApiService, private route: ActivatedRoute,
|
apiService: ApiService, private route: ActivatedRoute,
|
||||||
stateService: StateService, platformUtilsService: PlatformUtilsService,
|
stateService: StateService, platformUtilsService: PlatformUtilsService,
|
||||||
passwordGenerationService: PasswordGenerationService, private policyService: PolicyService) {
|
passwordGenerationService: PasswordGenerationService, private policyService: PolicyService,
|
||||||
|
environmentService: EnvironmentService) {
|
||||||
super(authService, router, i18nService, cryptoService, apiService, stateService, platformUtilsService,
|
super(authService, router, i18nService, cryptoService, apiService, stateService, platformUtilsService,
|
||||||
passwordGenerationService);
|
passwordGenerationService, environmentService);
|
||||||
}
|
}
|
||||||
|
|
||||||
getPasswordScoreAlertDisplay() {
|
getPasswordScoreAlertDisplay() {
|
||||||
@@ -105,6 +107,8 @@ export class RegisterComponent extends BaseRegisterComponent {
|
|||||||
if (this.policies != null) {
|
if (this.policies != null) {
|
||||||
this.enforcedPolicyOptions = await this.policyService.getMasterPasswordPolicyOptions(this.policies);
|
this.enforcedPolicyOptions = await this.policyService.getMasterPasswordPolicyOptions(this.policies);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await super.ngOnInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import {
|
|||||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||||
import { AuthService } from 'jslib-common/abstractions/auth.service';
|
import { AuthService } from 'jslib-common/abstractions/auth.service';
|
||||||
import { CryptoFunctionService } from 'jslib-common/abstractions/cryptoFunction.service';
|
import { CryptoFunctionService } from 'jslib-common/abstractions/cryptoFunction.service';
|
||||||
|
import { EnvironmentService } from 'jslib-common/abstractions/environment.service';
|
||||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||||
import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service';
|
import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service';
|
||||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||||
@@ -26,10 +27,10 @@ export class SsoComponent extends BaseSsoComponent {
|
|||||||
i18nService: I18nService, route: ActivatedRoute,
|
i18nService: I18nService, route: ActivatedRoute,
|
||||||
storageService: StorageService, stateService: StateService,
|
storageService: StorageService, stateService: StateService,
|
||||||
platformUtilsService: PlatformUtilsService, apiService: ApiService,
|
platformUtilsService: PlatformUtilsService, apiService: ApiService,
|
||||||
cryptoFunctionService: CryptoFunctionService,
|
cryptoFunctionService: CryptoFunctionService, environmentService: EnvironmentService,
|
||||||
passwordGenerationService: PasswordGenerationService) {
|
passwordGenerationService: PasswordGenerationService) {
|
||||||
super(authService, router, i18nService, route, storageService, stateService, platformUtilsService,
|
super(authService, router, i18nService, route, storageService, stateService, platformUtilsService,
|
||||||
apiService, cryptoFunctionService, passwordGenerationService);
|
apiService, cryptoFunctionService, environmentService, passwordGenerationService);
|
||||||
this.redirectUri = window.location.origin + '/sso-connector.html';
|
this.redirectUri = window.location.origin + '/sso-connector.html';
|
||||||
this.clientId = 'web';
|
this.clientId = 'web';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container *ngIf="selectedProviderType === providerType.WebAuthn">
|
<ng-container *ngIf="selectedProviderType === providerType.WebAuthn">
|
||||||
<div id="web-authn-frame" class="mb-3">
|
<div id="web-authn-frame" class="mb-3">
|
||||||
<iframe id="webauthn_iframe"></iframe>
|
<iframe id="webauthn_iframe" [allow]="webAuthnAllow"></iframe>
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container *ngIf="selectedProviderType === providerType.Duo ||
|
<ng-container *ngIf="selectedProviderType === providerType.Duo ||
|
||||||
|
|||||||
@@ -60,13 +60,6 @@ export class TwoFactorComponent extends BaseTwoFactorComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async goAfterLogIn() {
|
async goAfterLogIn() {
|
||||||
const orgInvite = await this.stateService.get<any>('orgInvitation');
|
|
||||||
const emergencyInvite = await this.stateService.get<any>('emergencyInvitation');
|
|
||||||
if (orgInvite != null) {
|
|
||||||
this.router.navigate(['accept-organization'], { queryParams: orgInvite });
|
|
||||||
} else if (emergencyInvite != null) {
|
|
||||||
this.router.navigate(['accept-emergency'], { queryParams: emergencyInvite });
|
|
||||||
} else {
|
|
||||||
const loginRedirect = await this.stateService.get<any>('loginRedirect');
|
const loginRedirect = await this.stateService.get<any>('loginRedirect');
|
||||||
if (loginRedirect != null) {
|
if (loginRedirect != null) {
|
||||||
this.router.navigate([loginRedirect.route], { queryParams: loginRedirect.qParams });
|
this.router.navigate([loginRedirect.route], { queryParams: loginRedirect.qParams });
|
||||||
@@ -79,5 +72,4 @@ export class TwoFactorComponent extends BaseTwoFactorComponent {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
81
src/app/accounts/update-temp-password.component.html
Normal file
81
src/app/accounts/update-temp-password.component.html
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
<form #form (ngSubmit)="submit()" [appApiAction]="formPromise" ngNativeValidate autocomplete="off">
|
||||||
|
<div class="row justify-content-md-center mt-5">
|
||||||
|
<div class="col-4">
|
||||||
|
<p class="lead text-center mb-4">{{'updateMasterPassword' | i18n}}</p>
|
||||||
|
<div class="card d-block">
|
||||||
|
<div class="card-body">
|
||||||
|
<app-callout type="warning">{{'updateMasterPasswordWarning' | i18n}}
|
||||||
|
</app-callout>
|
||||||
|
<div class="form-group">
|
||||||
|
<app-callout type="info" *ngIf="enforcedPolicyOptions">
|
||||||
|
{{'masterPasswordPolicyInEffect' | i18n}}
|
||||||
|
<ul class="mb-0">
|
||||||
|
<li *ngIf="enforcedPolicyOptions?.minComplexity > 0">
|
||||||
|
{{'policyInEffectMinComplexity' | i18n : getPasswordScoreAlertDisplay()}}
|
||||||
|
</li>
|
||||||
|
<li *ngIf="enforcedPolicyOptions?.minLength > 0">
|
||||||
|
{{'policyInEffectMinLength' | i18n : enforcedPolicyOptions?.minLength.toString()}}
|
||||||
|
</li>
|
||||||
|
<li *ngIf="enforcedPolicyOptions?.requireUpper">
|
||||||
|
{{'policyInEffectUppercase' | i18n}}</li>
|
||||||
|
<li *ngIf="enforcedPolicyOptions?.requireLower">
|
||||||
|
{{'policyInEffectLowercase' | i18n}}</li>
|
||||||
|
<li *ngIf="enforcedPolicyOptions?.requireNumbers">
|
||||||
|
{{'policyInEffectNumbers' | i18n}}</li>
|
||||||
|
<li *ngIf="enforcedPolicyOptions?.requireSpecial">
|
||||||
|
{{'policyInEffectSpecial' | i18n : '!@#$%^&*'}}</li>
|
||||||
|
</ul>
|
||||||
|
</app-callout>
|
||||||
|
<label for="masterPassword">{{'masterPass' | i18n}}</label>
|
||||||
|
<div class="d-flex">
|
||||||
|
<div class="w-100">
|
||||||
|
<input id="masterPassword" type="{{showPassword ? 'text' : 'password'}}"
|
||||||
|
name="MasterPasswordHash" class="text-monospace form-control mb-1"
|
||||||
|
[(ngModel)]="masterPassword" (input)="updatePasswordStrength()" required
|
||||||
|
appInputVerbatim>
|
||||||
|
<app-password-strength [score]="masterPasswordScore" [showText]="true">
|
||||||
|
</app-password-strength>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<button type="button" class="ml-1 btn btn-link"
|
||||||
|
appA11yTitle="{{'toggleVisibility' | i18n}}" (click)="togglePassword(false)">
|
||||||
|
<i class="fa fa-lg" aria-hidden="true"
|
||||||
|
[ngClass]="{'fa-eye': !showPassword, 'fa-eye-slash': showPassword}"></i>
|
||||||
|
</button>
|
||||||
|
<div class="progress-bar invisible"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="masterPasswordRetype">{{'reTypeMasterPass' | i18n}}</label>
|
||||||
|
<div class="d-flex">
|
||||||
|
<input id="masterPasswordRetype" type="{{showPassword ? 'text' : 'password'}}"
|
||||||
|
name="MasterPasswordRetype" class="text-monospace form-control"
|
||||||
|
[(ngModel)]="masterPasswordRetype" required appInputVerbatim>
|
||||||
|
<button type="button" class="ml-1 btn btn-link" appA11yTitle="{{'toggleVisibility' | i18n}}"
|
||||||
|
(click)="togglePassword(true)">
|
||||||
|
<i class="fa fa-lg" aria-hidden="true"
|
||||||
|
[ngClass]="{'fa-eye': !showPassword, 'fa-eye-slash': showPassword}"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="hint">{{'masterPassHint' | i18n}}</label>
|
||||||
|
<input id="hint" class="form-control" type="text" name="Hint" [(ngModel)]="hint">
|
||||||
|
<small class="form-text text-muted">{{'masterPassHintDesc' | i18n}}</small>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
<div class="d-flex">
|
||||||
|
<button type="submit" class="btn btn-primary btn-block btn-submit" [disabled]="form.loading">
|
||||||
|
<i class="fa fa-spinner fa-spin" title="{{'loading' | i18n}}" aria-hidden="true"></i>
|
||||||
|
<span>{{'submit' | i18n}}</span>
|
||||||
|
</button>
|
||||||
|
<button type="button" class="btn btn-outline-secondary btn-block ml-2 mt-0" (click)="logOut()">
|
||||||
|
{{'logOut' | i18n}}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
27
src/app/accounts/update-temp-password.component.ts
Normal file
27
src/app/accounts/update-temp-password.component.ts
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||||
|
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
||||||
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||||
|
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
|
||||||
|
import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service';
|
||||||
|
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||||
|
import { PolicyService } from 'jslib-common/abstractions/policy.service';
|
||||||
|
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||||
|
|
||||||
|
import { UpdateTempPasswordComponent as BaseUpdateTempPasswordComponent } from 'jslib-angular/components/update-temp-password.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-update-temp-password',
|
||||||
|
templateUrl: 'update-temp-password.component.html',
|
||||||
|
})
|
||||||
|
|
||||||
|
export class UpdateTempPasswordComponent extends BaseUpdateTempPasswordComponent {
|
||||||
|
constructor(i18nService: I18nService, platformUtilsService: PlatformUtilsService,
|
||||||
|
passwordGenerationService: PasswordGenerationService, policyService: PolicyService,
|
||||||
|
cryptoService: CryptoService, userService: UserService,
|
||||||
|
messagingService: MessagingService, apiService: ApiService) {
|
||||||
|
super(i18nService, platformUtilsService, passwordGenerationService, policyService, cryptoService,
|
||||||
|
userService, messagingService, apiService);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,487 +1,27 @@
|
|||||||
import { ToasterModule } from 'angular2-toaster';
|
import { ToasterModule } from 'angular2-toaster';
|
||||||
import { InfiniteScrollModule } from 'ngx-infinite-scroll';
|
import { InfiniteScrollModule } from 'ngx-infinite-scroll';
|
||||||
|
|
||||||
import { AppRoutingModule } from './app-routing.module';
|
|
||||||
|
|
||||||
import { DragDropModule } from '@angular/cdk/drag-drop';
|
import { DragDropModule } from '@angular/cdk/drag-drop';
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
|
||||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
|
|
||||||
import { ServicesModule } from './services/services.module';
|
|
||||||
|
|
||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
import { ModalComponent } from './modal.component';
|
import { OssRoutingModule } from './oss-routing.module';
|
||||||
|
import { OssModule } from './oss.module';
|
||||||
import { AvatarComponent } from './components/avatar.component';
|
import { ServicesModule } from './services/services.module';
|
||||||
import { PasswordStrengthComponent } from './components/password-strength.component';
|
|
||||||
|
|
||||||
import { FooterComponent } from './layouts/footer.component';
|
|
||||||
import { FrontendLayoutComponent } from './layouts/frontend-layout.component';
|
|
||||||
import { NavbarComponent } from './layouts/navbar.component';
|
|
||||||
import { OrganizationLayoutComponent } from './layouts/organization-layout.component';
|
|
||||||
import { UserLayoutComponent } from './layouts/user-layout.component';
|
|
||||||
|
|
||||||
import { AcceptEmergencyComponent } from './accounts/accept-emergency.component';
|
|
||||||
import { AcceptOrganizationComponent } from './accounts/accept-organization.component';
|
|
||||||
import { HintComponent } from './accounts/hint.component';
|
|
||||||
import { LockComponent } from './accounts/lock.component';
|
|
||||||
import { LoginComponent } from './accounts/login.component';
|
|
||||||
import { RecoverDeleteComponent } from './accounts/recover-delete.component';
|
|
||||||
import { RecoverTwoFactorComponent } from './accounts/recover-two-factor.component';
|
|
||||||
import { RegisterComponent } from './accounts/register.component';
|
|
||||||
import { SetPasswordComponent } from './accounts/set-password.component';
|
|
||||||
import { SsoComponent } from './accounts/sso.component';
|
|
||||||
import { TwoFactorOptionsComponent } from './accounts/two-factor-options.component';
|
|
||||||
import { TwoFactorComponent } from './accounts/two-factor.component';
|
|
||||||
import { VerifyEmailTokenComponent } from './accounts/verify-email-token.component';
|
|
||||||
import { VerifyRecoverDeleteComponent } from './accounts/verify-recover-delete.component';
|
|
||||||
|
|
||||||
import { BulkConfirmComponent as OrgBulkConfirmComponent } from './organizations/manage/bulk/bulk-confirm.component';
|
|
||||||
import { BulkRemoveComponent as OrgBulkRemoveComponent } from './organizations/manage/bulk/bulk-remove.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';
|
|
||||||
import { EntityEventsComponent as OrgEntityEventsComponent } from './organizations/manage/entity-events.component';
|
|
||||||
import { EntityUsersComponent as OrgEntityUsersComponent } from './organizations/manage/entity-users.component';
|
|
||||||
import { EventsComponent as OrgEventsComponent } from './organizations/manage/events.component';
|
|
||||||
import { GroupAddEditComponent as OrgGroupAddEditComponent } from './organizations/manage/group-add-edit.component';
|
|
||||||
import { GroupsComponent as OrgGroupsComponent } from './organizations/manage/groups.component';
|
|
||||||
import { ManageComponent as OrgManageComponent } from './organizations/manage/manage.component';
|
|
||||||
import { PeopleComponent as OrgPeopleComponent } from './organizations/manage/people.component';
|
|
||||||
import { PoliciesComponent as OrgPoliciesComponent } from './organizations/manage/policies.component';
|
|
||||||
import { PolicyEditComponent as OrgPolicyEditComponent } from './organizations/manage/policy-edit.component';
|
|
||||||
import { ResetPasswordComponent as OrgResetPasswordComponent } from './organizations/manage/reset-password.component';
|
|
||||||
import { UserAddEditComponent as OrgUserAddEditComponent } from './organizations/manage/user-add-edit.component';
|
|
||||||
import { UserConfirmComponent as OrgUserConfirmComponent } from './organizations/manage/user-confirm.component';
|
|
||||||
import { UserGroupsComponent as OrgUserGroupsComponent } from './organizations/manage/user-groups.component';
|
|
||||||
|
|
||||||
import { AccountComponent as OrgAccountComponent } from './organizations/settings/account.component';
|
|
||||||
import { AdjustSeatsComponent } from './organizations/settings/adjust-seats.component';
|
|
||||||
import { ChangePlanComponent } from './organizations/settings/change-plan.component';
|
|
||||||
import { DeleteOrganizationComponent } from './organizations/settings/delete-organization.component';
|
|
||||||
import { DownloadLicenseComponent } from './organizations/settings/download-license.component';
|
|
||||||
import { OrganizationBillingComponent } from './organizations/settings/organization-billing.component';
|
|
||||||
import { OrganizationSubscriptionComponent } from './organizations/settings/organization-subscription.component';
|
|
||||||
import { SettingsComponent as OrgSettingComponent } from './organizations/settings/settings.component';
|
|
||||||
import {
|
|
||||||
TwoFactorSetupComponent as OrgTwoFactorSetupComponent,
|
|
||||||
} from './organizations/settings/two-factor-setup.component';
|
|
||||||
|
|
||||||
import { ExportComponent as OrgExportComponent } from './organizations/tools/export.component';
|
|
||||||
import {
|
|
||||||
ExposedPasswordsReportComponent as OrgExposedPasswordsReportComponent,
|
|
||||||
} from './organizations/tools/exposed-passwords-report.component';
|
|
||||||
import { ImportComponent as OrgImportComponent } from './organizations/tools/import.component';
|
|
||||||
import {
|
|
||||||
InactiveTwoFactorReportComponent as OrgInactiveTwoFactorReportComponent,
|
|
||||||
} from './organizations/tools/inactive-two-factor-report.component';
|
|
||||||
import {
|
|
||||||
ReusedPasswordsReportComponent as OrgReusedPasswordsReportComponent,
|
|
||||||
} from './organizations/tools/reused-passwords-report.component';
|
|
||||||
import { ToolsComponent as OrgToolsComponent } from './organizations/tools/tools.component';
|
|
||||||
import {
|
|
||||||
UnsecuredWebsitesReportComponent as OrgUnsecuredWebsitesReportComponent,
|
|
||||||
} from './organizations/tools/unsecured-websites-report.component';
|
|
||||||
import {
|
|
||||||
WeakPasswordsReportComponent as OrgWeakPasswordsReportComponent,
|
|
||||||
} from './organizations/tools/weak-passwords-report.component';
|
|
||||||
|
|
||||||
import { AddEditComponent as OrgAddEditComponent } from './organizations/vault/add-edit.component';
|
|
||||||
import { AttachmentsComponent as OrgAttachmentsComponent } from './organizations/vault/attachments.component';
|
|
||||||
import { CiphersComponent as OrgCiphersComponent } from './organizations/vault/ciphers.component';
|
|
||||||
import { CollectionsComponent as OrgCollectionsComponent } from './organizations/vault/collections.component';
|
|
||||||
import { GroupingsComponent as OrgGroupingsComponent } from './organizations/vault/groupings.component';
|
|
||||||
import { VaultComponent as OrgVaultComponent } from './organizations/vault/vault.component';
|
|
||||||
|
|
||||||
import { AccessComponent } from './send/access.component';
|
|
||||||
import { AddEditComponent as SendAddEditComponent } from './send/add-edit.component';
|
|
||||||
import { SendComponent } from './send/send.component';
|
|
||||||
|
|
||||||
import { AccountComponent } from './settings/account.component';
|
|
||||||
import { AddCreditComponent } from './settings/add-credit.component';
|
|
||||||
import { AdjustPaymentComponent } from './settings/adjust-payment.component';
|
|
||||||
import { AdjustStorageComponent } from './settings/adjust-storage.component';
|
|
||||||
import { ApiKeyComponent } from './settings/api-key.component';
|
|
||||||
import { ChangeEmailComponent } from './settings/change-email.component';
|
|
||||||
import { ChangeKdfComponent } from './settings/change-kdf.component';
|
|
||||||
import { ChangePasswordComponent } from './settings/change-password.component';
|
|
||||||
import { CreateOrganizationComponent } from './settings/create-organization.component';
|
|
||||||
import { DeauthorizeSessionsComponent } from './settings/deauthorize-sessions.component';
|
|
||||||
import { DeleteAccountComponent } from './settings/delete-account.component';
|
|
||||||
import { DomainRulesComponent } from './settings/domain-rules.component';
|
|
||||||
import { EmergencyAccessAddEditComponent } from './settings/emergency-access-add-edit.component';
|
|
||||||
import { EmergencyAccessAttachmentsComponent } from './settings/emergency-access-attachments.component';
|
|
||||||
import { EmergencyAccessConfirmComponent } from './settings/emergency-access-confirm.component';
|
|
||||||
import { EmergencyAccessTakeoverComponent } from './settings/emergency-access-takeover.component';
|
|
||||||
import { EmergencyAccessViewComponent } from './settings/emergency-access-view.component';
|
|
||||||
import { EmergencyAccessComponent } from './settings/emergency-access.component';
|
|
||||||
import { EmergencyAddEditComponent } from './settings/emergency-add-edit.component';
|
|
||||||
import { LinkSsoComponent } from './settings/link-sso.component';
|
|
||||||
import { OptionsComponent } from './settings/options.component';
|
|
||||||
import { OrganizationPlansComponent } from './settings/organization-plans.component';
|
|
||||||
import { OrganizationsComponent } from './settings/organizations.component';
|
|
||||||
import { PaymentComponent } from './settings/payment.component';
|
|
||||||
import { PremiumComponent } from './settings/premium.component';
|
|
||||||
import { ProfileComponent } from './settings/profile.component';
|
|
||||||
import { PurgeVaultComponent } from './settings/purge-vault.component';
|
|
||||||
import { SettingsComponent } from './settings/settings.component';
|
|
||||||
import { TaxInfoComponent } from './settings/tax-info.component';
|
|
||||||
import { TwoFactorAuthenticatorComponent } from './settings/two-factor-authenticator.component';
|
|
||||||
import { TwoFactorDuoComponent } from './settings/two-factor-duo.component';
|
|
||||||
import { TwoFactorEmailComponent } from './settings/two-factor-email.component';
|
|
||||||
import { TwoFactorRecoveryComponent } from './settings/two-factor-recovery.component';
|
|
||||||
import { TwoFactorSetupComponent } from './settings/two-factor-setup.component';
|
|
||||||
import { TwoFactorVerifyComponent } from './settings/two-factor-verify.component';
|
|
||||||
import { TwoFactorWebAuthnComponent } from './settings/two-factor-webauthn.component';
|
|
||||||
import { TwoFactorYubiKeyComponent } from './settings/two-factor-yubikey.component';
|
|
||||||
import { UpdateKeyComponent } from './settings/update-key.component';
|
|
||||||
import { UpdateLicenseComponent } from './settings/update-license.component';
|
|
||||||
import { UserBillingComponent } from './settings/user-billing.component';
|
|
||||||
import { UserSubscriptionComponent } from './settings/user-subscription.component';
|
|
||||||
import { VerifyEmailComponent } from './settings/verify-email.component';
|
|
||||||
|
|
||||||
import { BreachReportComponent } from './tools/breach-report.component';
|
|
||||||
import { ExportComponent } from './tools/export.component';
|
|
||||||
import { ExposedPasswordsReportComponent } from './tools/exposed-passwords-report.component';
|
|
||||||
import { ImportComponent } from './tools/import.component';
|
|
||||||
import { InactiveTwoFactorReportComponent } from './tools/inactive-two-factor-report.component';
|
|
||||||
import { PasswordGeneratorHistoryComponent } from './tools/password-generator-history.component';
|
|
||||||
import { PasswordGeneratorComponent } from './tools/password-generator.component';
|
|
||||||
import { ReusedPasswordsReportComponent } from './tools/reused-passwords-report.component';
|
|
||||||
import { ToolsComponent } from './tools/tools.component';
|
|
||||||
import { UnsecuredWebsitesReportComponent } from './tools/unsecured-websites-report.component';
|
|
||||||
import { WeakPasswordsReportComponent } from './tools/weak-passwords-report.component';
|
|
||||||
|
|
||||||
import { AddEditComponent } from './vault/add-edit.component';
|
|
||||||
import { AttachmentsComponent } from './vault/attachments.component';
|
|
||||||
import { BulkActionsComponent } from './vault/bulk-actions.component';
|
|
||||||
import { BulkDeleteComponent } from './vault/bulk-delete.component';
|
|
||||||
import { BulkMoveComponent } from './vault/bulk-move.component';
|
|
||||||
import { BulkRestoreComponent } from './vault/bulk-restore.component';
|
|
||||||
import { BulkShareComponent } from './vault/bulk-share.component';
|
|
||||||
import { CiphersComponent } from './vault/ciphers.component';
|
|
||||||
import { CollectionsComponent } from './vault/collections.component';
|
|
||||||
import { FolderAddEditComponent } from './vault/folder-add-edit.component';
|
|
||||||
import { GroupingsComponent } from './vault/groupings.component';
|
|
||||||
import { SendInfoComponent } from './vault/send-info.component';
|
|
||||||
import { ShareComponent } from './vault/share.component';
|
|
||||||
import { VaultComponent } from './vault/vault.component';
|
|
||||||
|
|
||||||
import { CalloutComponent } from 'jslib-angular/components/callout.component';
|
|
||||||
import { IconComponent } from 'jslib-angular/components/icon.component';
|
|
||||||
|
|
||||||
import { A11yTitleDirective } from 'jslib-angular/directives/a11y-title.directive';
|
|
||||||
import { ApiActionDirective } from 'jslib-angular/directives/api-action.directive';
|
|
||||||
import { AutofocusDirective } from 'jslib-angular/directives/autofocus.directive';
|
|
||||||
import { BlurClickDirective } from 'jslib-angular/directives/blur-click.directive';
|
|
||||||
import { BoxRowDirective } from 'jslib-angular/directives/box-row.directive';
|
|
||||||
import { FallbackSrcDirective } from 'jslib-angular/directives/fallback-src.directive';
|
|
||||||
import { InputVerbatimDirective } from 'jslib-angular/directives/input-verbatim.directive';
|
|
||||||
import { SelectCopyDirective } from 'jslib-angular/directives/select-copy.directive';
|
|
||||||
import { StopClickDirective } from 'jslib-angular/directives/stop-click.directive';
|
|
||||||
import { StopPropDirective } from 'jslib-angular/directives/stop-prop.directive';
|
|
||||||
import { TrueFalseValueDirective } from 'jslib-angular/directives/true-false-value.directive';
|
|
||||||
|
|
||||||
import { ColorPasswordPipe } from 'jslib-angular/pipes/color-password.pipe';
|
|
||||||
import { I18nPipe } from 'jslib-angular/pipes/i18n.pipe';
|
|
||||||
import { SearchCiphersPipe } from 'jslib-angular/pipes/search-ciphers.pipe';
|
|
||||||
import { SearchPipe } from 'jslib-angular/pipes/search.pipe';
|
|
||||||
|
|
||||||
import {
|
|
||||||
DatePipe,
|
|
||||||
registerLocaleData,
|
|
||||||
} from '@angular/common';
|
|
||||||
import localeBg from '@angular/common/locales/bg';
|
|
||||||
import localeCa from '@angular/common/locales/ca';
|
|
||||||
import localeCs from '@angular/common/locales/cs';
|
|
||||||
import localeDa from '@angular/common/locales/da';
|
|
||||||
import localeDe from '@angular/common/locales/de';
|
|
||||||
import localeEl from '@angular/common/locales/el';
|
|
||||||
import localeEnGb from '@angular/common/locales/en-GB';
|
|
||||||
import localeEnIn from '@angular/common/locales/en-IN';
|
|
||||||
import localeEo from '@angular/common/locales/eo';
|
|
||||||
import localeEs from '@angular/common/locales/es';
|
|
||||||
import localeEt from '@angular/common/locales/et';
|
|
||||||
import localeFi from '@angular/common/locales/fi';
|
|
||||||
import localeFr from '@angular/common/locales/fr';
|
|
||||||
import localeHe from '@angular/common/locales/he';
|
|
||||||
import localeHr from '@angular/common/locales/hr';
|
|
||||||
import localeHu from '@angular/common/locales/hu';
|
|
||||||
import localeId from '@angular/common/locales/id';
|
|
||||||
import localeIt from '@angular/common/locales/it';
|
|
||||||
import localeJa from '@angular/common/locales/ja';
|
|
||||||
import localeKo from '@angular/common/locales/ko';
|
|
||||||
import localeLv from '@angular/common/locales/lv';
|
|
||||||
import localeMl from '@angular/common/locales/ml';
|
|
||||||
import localeNb from '@angular/common/locales/nb';
|
|
||||||
import localeNl from '@angular/common/locales/nl';
|
|
||||||
import localePl from '@angular/common/locales/pl';
|
|
||||||
import localePtBr from '@angular/common/locales/pt';
|
|
||||||
import localePtPt from '@angular/common/locales/pt-PT';
|
|
||||||
import localeRo from '@angular/common/locales/ro';
|
|
||||||
import localeRu from '@angular/common/locales/ru';
|
|
||||||
import localeSk from '@angular/common/locales/sk';
|
|
||||||
import localeSr from '@angular/common/locales/sr';
|
|
||||||
import localeSv from '@angular/common/locales/sv';
|
|
||||||
import localeTr from '@angular/common/locales/tr';
|
|
||||||
import localeUk from '@angular/common/locales/uk';
|
|
||||||
import localeZhCn from '@angular/common/locales/zh-Hans';
|
|
||||||
import localeZhTw from '@angular/common/locales/zh-Hant';
|
|
||||||
|
|
||||||
registerLocaleData(localeCa, 'ca');
|
|
||||||
registerLocaleData(localeCs, 'cs');
|
|
||||||
registerLocaleData(localeBg, 'bg');
|
|
||||||
registerLocaleData(localeDa, 'da');
|
|
||||||
registerLocaleData(localeDe, 'de');
|
|
||||||
registerLocaleData(localeEl, 'el');
|
|
||||||
registerLocaleData(localeEnGb, 'en-GB');
|
|
||||||
registerLocaleData(localeEnIn, 'en-IN');
|
|
||||||
registerLocaleData(localeEs, 'es');
|
|
||||||
registerLocaleData(localeEt, 'et');
|
|
||||||
registerLocaleData(localeEo, 'eo');
|
|
||||||
registerLocaleData(localeFi, 'fi');
|
|
||||||
registerLocaleData(localeFr, 'fr');
|
|
||||||
registerLocaleData(localeHe, 'he');
|
|
||||||
registerLocaleData(localeHr, 'hr');
|
|
||||||
registerLocaleData(localeHu, 'hu');
|
|
||||||
registerLocaleData(localeId, 'id');
|
|
||||||
registerLocaleData(localeIt, 'it');
|
|
||||||
registerLocaleData(localeJa, 'ja');
|
|
||||||
registerLocaleData(localeKo, 'ko');
|
|
||||||
registerLocaleData(localeLv, 'lv');
|
|
||||||
registerLocaleData(localeMl, 'ml');
|
|
||||||
registerLocaleData(localeNb, 'nb');
|
|
||||||
registerLocaleData(localeNl, 'nl');
|
|
||||||
registerLocaleData(localePl, 'pl');
|
|
||||||
registerLocaleData(localePtBr, 'pt-BR');
|
|
||||||
registerLocaleData(localePtPt, 'pt-PT');
|
|
||||||
registerLocaleData(localeRo, 'ro');
|
|
||||||
registerLocaleData(localeRu, 'ru');
|
|
||||||
registerLocaleData(localeSk, 'sk');
|
|
||||||
registerLocaleData(localeSr, 'sr');
|
|
||||||
registerLocaleData(localeSv, 'sv');
|
|
||||||
registerLocaleData(localeTr, 'tr');
|
|
||||||
registerLocaleData(localeUk, 'uk');
|
|
||||||
registerLocaleData(localeZhCn, 'zh-CN');
|
|
||||||
registerLocaleData(localeZhTw, 'zh-TW');
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
OssModule,
|
||||||
BrowserAnimationsModule,
|
BrowserAnimationsModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
AppRoutingModule,
|
|
||||||
ServicesModule,
|
ServicesModule,
|
||||||
ToasterModule.forRoot(),
|
ToasterModule.forRoot(),
|
||||||
InfiniteScrollModule,
|
InfiniteScrollModule,
|
||||||
DragDropModule,
|
DragDropModule,
|
||||||
|
OssRoutingModule,
|
||||||
],
|
],
|
||||||
declarations: [
|
|
||||||
A11yTitleDirective,
|
|
||||||
AcceptEmergencyComponent,
|
|
||||||
AccessComponent,
|
|
||||||
AcceptOrganizationComponent,
|
|
||||||
AccountComponent,
|
|
||||||
SetPasswordComponent,
|
|
||||||
AddCreditComponent,
|
|
||||||
AddEditComponent,
|
|
||||||
AdjustPaymentComponent,
|
|
||||||
AdjustSeatsComponent,
|
|
||||||
AdjustStorageComponent,
|
|
||||||
ApiActionDirective,
|
|
||||||
ApiKeyComponent,
|
|
||||||
AppComponent,
|
|
||||||
AttachmentsComponent,
|
|
||||||
AutofocusDirective,
|
|
||||||
AvatarComponent,
|
|
||||||
BlurClickDirective,
|
|
||||||
BoxRowDirective,
|
|
||||||
BreachReportComponent,
|
|
||||||
BulkActionsComponent,
|
|
||||||
BulkDeleteComponent,
|
|
||||||
BulkMoveComponent,
|
|
||||||
BulkRestoreComponent,
|
|
||||||
BulkShareComponent,
|
|
||||||
CalloutComponent,
|
|
||||||
ChangeEmailComponent,
|
|
||||||
ChangeKdfComponent,
|
|
||||||
ChangePasswordComponent,
|
|
||||||
ChangePlanComponent,
|
|
||||||
CiphersComponent,
|
|
||||||
CollectionsComponent,
|
|
||||||
ColorPasswordPipe,
|
|
||||||
CreateOrganizationComponent,
|
|
||||||
DeauthorizeSessionsComponent,
|
|
||||||
DeleteAccountComponent,
|
|
||||||
DeleteOrganizationComponent,
|
|
||||||
DomainRulesComponent,
|
|
||||||
DownloadLicenseComponent,
|
|
||||||
EmergencyAccessAddEditComponent,
|
|
||||||
EmergencyAccessAttachmentsComponent,
|
|
||||||
EmergencyAccessComponent,
|
|
||||||
EmergencyAccessConfirmComponent,
|
|
||||||
EmergencyAccessTakeoverComponent,
|
|
||||||
EmergencyAccessViewComponent,
|
|
||||||
EmergencyAddEditComponent,
|
|
||||||
ExportComponent,
|
|
||||||
ExposedPasswordsReportComponent,
|
|
||||||
FallbackSrcDirective,
|
|
||||||
FolderAddEditComponent,
|
|
||||||
FooterComponent,
|
|
||||||
FrontendLayoutComponent,
|
|
||||||
GroupingsComponent,
|
|
||||||
HintComponent,
|
|
||||||
I18nPipe,
|
|
||||||
IconComponent,
|
|
||||||
ImportComponent,
|
|
||||||
InactiveTwoFactorReportComponent,
|
|
||||||
InputVerbatimDirective,
|
|
||||||
LinkSsoComponent,
|
|
||||||
LockComponent,
|
|
||||||
LoginComponent,
|
|
||||||
ModalComponent,
|
|
||||||
NavbarComponent,
|
|
||||||
OptionsComponent,
|
|
||||||
OrgAccountComponent,
|
|
||||||
OrgAddEditComponent,
|
|
||||||
OrganizationBillingComponent,
|
|
||||||
OrganizationPlansComponent,
|
|
||||||
OrganizationSubscriptionComponent,
|
|
||||||
OrgAttachmentsComponent,
|
|
||||||
OrgBulkStatusComponent,
|
|
||||||
OrgBulkConfirmComponent,
|
|
||||||
OrgBulkRemoveComponent,
|
|
||||||
OrgCiphersComponent,
|
|
||||||
OrgCollectionAddEditComponent,
|
|
||||||
OrgCollectionsComponent,
|
|
||||||
OrgEntityEventsComponent,
|
|
||||||
OrgEntityUsersComponent,
|
|
||||||
OrgEventsComponent,
|
|
||||||
OrgExportComponent,
|
|
||||||
OrgExposedPasswordsReportComponent,
|
|
||||||
OrgImportComponent,
|
|
||||||
OrgInactiveTwoFactorReportComponent,
|
|
||||||
OrgGroupAddEditComponent,
|
|
||||||
OrgGroupingsComponent,
|
|
||||||
OrgGroupsComponent,
|
|
||||||
OrgManageCollectionsComponent,
|
|
||||||
OrgManageComponent,
|
|
||||||
OrgPeopleComponent,
|
|
||||||
OrgPolicyEditComponent,
|
|
||||||
OrgPoliciesComponent,
|
|
||||||
OrgResetPasswordComponent,
|
|
||||||
OrgReusedPasswordsReportComponent,
|
|
||||||
OrgSettingComponent,
|
|
||||||
OrgToolsComponent,
|
|
||||||
OrgTwoFactorSetupComponent,
|
|
||||||
OrgUserAddEditComponent,
|
|
||||||
OrgUserConfirmComponent,
|
|
||||||
OrgUserGroupsComponent,
|
|
||||||
OrganizationsComponent,
|
|
||||||
OrganizationLayoutComponent,
|
|
||||||
OrgUnsecuredWebsitesReportComponent,
|
|
||||||
OrgVaultComponent,
|
|
||||||
OrgWeakPasswordsReportComponent,
|
|
||||||
PasswordGeneratorComponent,
|
|
||||||
PasswordGeneratorHistoryComponent,
|
|
||||||
PasswordStrengthComponent,
|
|
||||||
PaymentComponent,
|
|
||||||
PremiumComponent,
|
|
||||||
ProfileComponent,
|
|
||||||
PurgeVaultComponent,
|
|
||||||
RecoverDeleteComponent,
|
|
||||||
RecoverTwoFactorComponent,
|
|
||||||
RegisterComponent,
|
|
||||||
ReusedPasswordsReportComponent,
|
|
||||||
SearchCiphersPipe,
|
|
||||||
SearchPipe,
|
|
||||||
SelectCopyDirective,
|
|
||||||
SendAddEditComponent,
|
|
||||||
SendComponent,
|
|
||||||
SendInfoComponent,
|
|
||||||
SettingsComponent,
|
|
||||||
ShareComponent,
|
|
||||||
SsoComponent,
|
|
||||||
StopClickDirective,
|
|
||||||
StopPropDirective,
|
|
||||||
TaxInfoComponent,
|
|
||||||
ToolsComponent,
|
|
||||||
TrueFalseValueDirective,
|
|
||||||
TwoFactorAuthenticatorComponent,
|
|
||||||
TwoFactorComponent,
|
|
||||||
TwoFactorDuoComponent,
|
|
||||||
TwoFactorEmailComponent,
|
|
||||||
TwoFactorOptionsComponent,
|
|
||||||
TwoFactorRecoveryComponent,
|
|
||||||
TwoFactorSetupComponent,
|
|
||||||
TwoFactorVerifyComponent,
|
|
||||||
TwoFactorWebAuthnComponent,
|
|
||||||
TwoFactorYubiKeyComponent,
|
|
||||||
UnsecuredWebsitesReportComponent,
|
|
||||||
UpdateKeyComponent,
|
|
||||||
UpdateLicenseComponent,
|
|
||||||
UserBillingComponent,
|
|
||||||
UserLayoutComponent,
|
|
||||||
UserSubscriptionComponent,
|
|
||||||
VaultComponent,
|
|
||||||
VerifyEmailComponent,
|
|
||||||
VerifyEmailTokenComponent,
|
|
||||||
VerifyRecoverDeleteComponent,
|
|
||||||
WeakPasswordsReportComponent,
|
|
||||||
],
|
|
||||||
entryComponents: [
|
|
||||||
AddEditComponent,
|
|
||||||
ApiKeyComponent,
|
|
||||||
AttachmentsComponent,
|
|
||||||
BulkActionsComponent,
|
|
||||||
BulkDeleteComponent,
|
|
||||||
BulkMoveComponent,
|
|
||||||
BulkRestoreComponent,
|
|
||||||
BulkShareComponent,
|
|
||||||
CollectionsComponent,
|
|
||||||
DeauthorizeSessionsComponent,
|
|
||||||
DeleteAccountComponent,
|
|
||||||
DeleteOrganizationComponent,
|
|
||||||
EmergencyAccessAddEditComponent,
|
|
||||||
EmergencyAccessAttachmentsComponent,
|
|
||||||
EmergencyAccessConfirmComponent,
|
|
||||||
EmergencyAccessTakeoverComponent,
|
|
||||||
EmergencyAddEditComponent,
|
|
||||||
FolderAddEditComponent,
|
|
||||||
ModalComponent,
|
|
||||||
OrgAddEditComponent,
|
|
||||||
OrgAttachmentsComponent,
|
|
||||||
OrgBulkStatusComponent,
|
|
||||||
OrgBulkConfirmComponent,
|
|
||||||
OrgBulkRemoveComponent,
|
|
||||||
OrgCollectionAddEditComponent,
|
|
||||||
OrgCollectionsComponent,
|
|
||||||
OrgEntityEventsComponent,
|
|
||||||
OrgEntityUsersComponent,
|
|
||||||
OrgGroupAddEditComponent,
|
|
||||||
OrgPolicyEditComponent,
|
|
||||||
OrgResetPasswordComponent,
|
|
||||||
OrgUserAddEditComponent,
|
|
||||||
OrgUserConfirmComponent,
|
|
||||||
OrgUserGroupsComponent,
|
|
||||||
PasswordGeneratorHistoryComponent,
|
|
||||||
PurgeVaultComponent,
|
|
||||||
SendAddEditComponent,
|
|
||||||
ShareComponent,
|
|
||||||
TwoFactorAuthenticatorComponent,
|
|
||||||
TwoFactorDuoComponent,
|
|
||||||
TwoFactorEmailComponent,
|
|
||||||
TwoFactorOptionsComponent,
|
|
||||||
TwoFactorRecoveryComponent,
|
|
||||||
TwoFactorWebAuthnComponent,
|
|
||||||
TwoFactorYubiKeyComponent,
|
|
||||||
UpdateKeyComponent,
|
|
||||||
],
|
|
||||||
providers: [DatePipe, SearchPipe],
|
|
||||||
bootstrap: [AppComponent],
|
bootstrap: [AppComponent],
|
||||||
})
|
})
|
||||||
export class AppModule { }
|
export class AppModule { }
|
||||||
|
|||||||
90
src/app/common/base.accept.component.ts
Normal file
90
src/app/common/base.accept.component.ts
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
import {
|
||||||
|
Directive,
|
||||||
|
OnInit,
|
||||||
|
} from '@angular/core';
|
||||||
|
import {
|
||||||
|
ActivatedRoute,
|
||||||
|
Router,
|
||||||
|
} from '@angular/router';
|
||||||
|
|
||||||
|
import {
|
||||||
|
Toast,
|
||||||
|
ToasterService,
|
||||||
|
} from 'angular2-toaster';
|
||||||
|
|
||||||
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||||
|
import { StateService } from 'jslib-common/abstractions/state.service';
|
||||||
|
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||||
|
|
||||||
|
@Directive()
|
||||||
|
export abstract class BaseAcceptComponent implements OnInit {
|
||||||
|
loading = true;
|
||||||
|
authed = false;
|
||||||
|
email: string;
|
||||||
|
actionPromise: Promise<any>;
|
||||||
|
|
||||||
|
protected requiredParameters: string[] = [];
|
||||||
|
protected failedShortMessage = 'inviteAcceptFailedShort';
|
||||||
|
protected failedMessage = 'inviteAcceptFailed';
|
||||||
|
|
||||||
|
constructor(protected router: Router, protected toasterService: ToasterService,
|
||||||
|
protected i18nService: I18nService, protected route: ActivatedRoute,
|
||||||
|
protected userService: UserService, protected stateService: StateService) { }
|
||||||
|
|
||||||
|
abstract authedHandler(qParams: any): Promise<void>;
|
||||||
|
abstract unauthedHandler(qParams: any): Promise<void>;
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
let fired = false;
|
||||||
|
this.route.queryParams.subscribe(async qParams => {
|
||||||
|
if (fired) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
fired = true;
|
||||||
|
await this.stateService.remove('loginRedirect');
|
||||||
|
|
||||||
|
let error = this.requiredParameters.some(e => qParams?.[e] == null || qParams[e] === '');
|
||||||
|
let errorMessage: string = null;
|
||||||
|
if (!error) {
|
||||||
|
this.authed = await this.userService.isAuthenticated();
|
||||||
|
|
||||||
|
if (this.authed) {
|
||||||
|
try {
|
||||||
|
await this.authedHandler(qParams);
|
||||||
|
} catch (e) {
|
||||||
|
error = true;
|
||||||
|
errorMessage = e.message;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
await this.stateService.save('loginRedirect', {
|
||||||
|
route: this.getRedirectRoute(),
|
||||||
|
qParams: qParams,
|
||||||
|
});
|
||||||
|
|
||||||
|
this.email = qParams.email;
|
||||||
|
await this.unauthedHandler(qParams);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (error) {
|
||||||
|
const toast: Toast = {
|
||||||
|
type: 'error',
|
||||||
|
title: null,
|
||||||
|
body: errorMessage != null ? this.i18nService.t(this.failedShortMessage, errorMessage) :
|
||||||
|
this.i18nService.t(this.failedMessage),
|
||||||
|
timeout: 10000,
|
||||||
|
};
|
||||||
|
this.toasterService.popAsync(toast);
|
||||||
|
this.router.navigate(['/']);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
getRedirectRoute() {
|
||||||
|
const urlTree = this.router.parseUrl(this.router.url);
|
||||||
|
urlTree.queryParams = {};
|
||||||
|
return urlTree.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
157
src/app/common/base.events.component.ts
Normal file
157
src/app/common/base.events.component.ts
Normal file
@@ -0,0 +1,157 @@
|
|||||||
|
import { Directive } from '@angular/core';
|
||||||
|
import { ToasterService } from 'angular2-toaster';
|
||||||
|
|
||||||
|
import { ExportService } from 'jslib-common/abstractions/export.service';
|
||||||
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||||
|
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||||
|
|
||||||
|
import { EventView } from 'jslib-common/models/view/eventView';
|
||||||
|
|
||||||
|
import { ListResponse } from 'jslib-common/models/response';
|
||||||
|
import { EventResponse } from 'jslib-common/models/response/eventResponse';
|
||||||
|
|
||||||
|
import { LogService } from 'jslib-common/abstractions';
|
||||||
|
import { EventService } from 'src/app/services/event.service';
|
||||||
|
|
||||||
|
@Directive()
|
||||||
|
export abstract class BaseEventsComponent {
|
||||||
|
loading = true;
|
||||||
|
loaded = false;
|
||||||
|
events: EventView[];
|
||||||
|
start: string;
|
||||||
|
end: string;
|
||||||
|
dirtyDates: boolean = true;
|
||||||
|
continuationToken: string;
|
||||||
|
refreshPromise: Promise<any>;
|
||||||
|
exportPromise: Promise<any>;
|
||||||
|
morePromise: Promise<any>;
|
||||||
|
|
||||||
|
abstract readonly exportFileName: string;
|
||||||
|
|
||||||
|
constructor(protected eventService: EventService, protected i18nService: I18nService,
|
||||||
|
protected toasterService: ToasterService, protected exportService: ExportService,
|
||||||
|
protected platformUtilsService: PlatformUtilsService, protected logService: LogService) {
|
||||||
|
const defaultDates = this.eventService.getDefaultDateFilters();
|
||||||
|
this.start = defaultDates[0];
|
||||||
|
this.end = defaultDates[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
async exportEvents() {
|
||||||
|
if (this.appApiPromiseUnfulfilled() || this.dirtyDates) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.loading = true;
|
||||||
|
|
||||||
|
const dates = this.parseDates();
|
||||||
|
if (dates == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
this.exportPromise = this.export(dates[0], dates[1]);
|
||||||
|
|
||||||
|
await this.exportPromise;
|
||||||
|
} catch (e) {
|
||||||
|
this.logService.error(`Handled exception: ${e}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.exportPromise = null;
|
||||||
|
this.loading = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
async loadEvents(clearExisting: boolean) {
|
||||||
|
if (this.appApiPromiseUnfulfilled()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const dates = this.parseDates();
|
||||||
|
if (dates == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.loading = true;
|
||||||
|
let events: EventView[] = [];
|
||||||
|
try {
|
||||||
|
const promise = this.loadAndParseEvents(dates[0], dates[1], clearExisting ? null : this.continuationToken);
|
||||||
|
if (clearExisting) {
|
||||||
|
this.refreshPromise = promise;
|
||||||
|
} else {
|
||||||
|
this.morePromise = promise;
|
||||||
|
}
|
||||||
|
const result = await promise;
|
||||||
|
this.continuationToken = result.continuationToken;
|
||||||
|
events = result.events;
|
||||||
|
} catch (e) {
|
||||||
|
this.logService.error(`Handled exception: ${e}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!clearExisting && this.events != null && this.events.length > 0) {
|
||||||
|
this.events = this.events.concat(events);
|
||||||
|
} else {
|
||||||
|
this.events = events;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.dirtyDates = false;
|
||||||
|
this.loading = false;
|
||||||
|
this.morePromise = null;
|
||||||
|
this.refreshPromise = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract requestEvents(startDate: string, endDate: string, continuationToken: string): Promise<ListResponse<EventResponse>>;
|
||||||
|
protected abstract getUserName(r: EventResponse, userId: string): { name: string, email: string };
|
||||||
|
|
||||||
|
protected async loadAndParseEvents(startDate: string, endDate: string, continuationToken: string) {
|
||||||
|
const response = await this.requestEvents(startDate, endDate, continuationToken);
|
||||||
|
|
||||||
|
const events = await Promise.all(response.data.map(async r => {
|
||||||
|
const userId = r.actingUserId == null ? r.userId : r.actingUserId;
|
||||||
|
const eventInfo = await this.eventService.getEventInfo(r);
|
||||||
|
const user = this.getUserName(r, userId);
|
||||||
|
return new EventView({
|
||||||
|
message: eventInfo.message,
|
||||||
|
humanReadableMessage: eventInfo.humanReadableMessage,
|
||||||
|
appIcon: eventInfo.appIcon,
|
||||||
|
appName: eventInfo.appName,
|
||||||
|
userId: userId,
|
||||||
|
userName: user != null ? user.name : this.i18nService.t('unknown'),
|
||||||
|
userEmail: user != null ? user.email : '',
|
||||||
|
date: r.date,
|
||||||
|
ip: r.ipAddress,
|
||||||
|
type: r.type,
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
return { continuationToken: response.continuationToken, events: events };
|
||||||
|
}
|
||||||
|
|
||||||
|
protected parseDates() {
|
||||||
|
let dates: string[] = null;
|
||||||
|
try {
|
||||||
|
dates = this.eventService.formatDateFilters(this.start, this.end);
|
||||||
|
} catch (e) {
|
||||||
|
this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),
|
||||||
|
this.i18nService.t('invalidDateRange'));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return dates;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected appApiPromiseUnfulfilled() {
|
||||||
|
return this.refreshPromise != null || this.morePromise != null || this.exportPromise != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private async export(start: string, end: string) {
|
||||||
|
let continuationToken = this.continuationToken;
|
||||||
|
let events = [].concat(this.events);
|
||||||
|
|
||||||
|
while (continuationToken != null) {
|
||||||
|
const result = await this.loadAndParseEvents(start, end, continuationToken);
|
||||||
|
continuationToken = result.continuationToken;
|
||||||
|
events = events.concat(result.events);
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = await this.exportService.getEventExport(events);
|
||||||
|
const fileName = this.exportService.getFileName(this.exportFileName, 'csv');
|
||||||
|
this.platformUtilsService.saveFile(window, data, { type: 'text/plain' }, fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
318
src/app/common/base.people.component.ts
Normal file
318
src/app/common/base.people.component.ts
Normal file
@@ -0,0 +1,318 @@
|
|||||||
|
import {
|
||||||
|
ComponentFactoryResolver,
|
||||||
|
Directive,
|
||||||
|
ViewChild,
|
||||||
|
ViewContainerRef
|
||||||
|
} from '@angular/core';
|
||||||
|
import { ToasterService } from 'angular2-toaster';
|
||||||
|
|
||||||
|
import { ValidationService } from 'jslib-angular/services/validation.service';
|
||||||
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||||
|
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
||||||
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||||
|
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||||
|
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||||
|
import { SearchService } from 'jslib-common/abstractions/search.service';
|
||||||
|
import { StorageService } from 'jslib-common/abstractions/storage.service';
|
||||||
|
|
||||||
|
import { ConstantsService } from 'jslib-common/services/constants.service';
|
||||||
|
|
||||||
|
import { SearchPipe } from 'jslib-angular/pipes/search.pipe';
|
||||||
|
import { UserNamePipe } from 'jslib-angular/pipes/user-name.pipe';
|
||||||
|
|
||||||
|
import { OrganizationUserStatusType } from 'jslib-common/enums/organizationUserStatusType';
|
||||||
|
import { OrganizationUserType } from 'jslib-common/enums/organizationUserType';
|
||||||
|
import { ProviderUserStatusType } from 'jslib-common/enums/providerUserStatusType';
|
||||||
|
import { ProviderUserType } from 'jslib-common/enums/providerUserType';
|
||||||
|
|
||||||
|
import { ListResponse } from 'jslib-common/models/response/listResponse';
|
||||||
|
import { OrganizationUserUserDetailsResponse } from 'jslib-common/models/response/organizationUserResponse';
|
||||||
|
import { ProviderUserUserDetailsResponse } from 'jslib-common/models/response/provider/providerUserResponse';
|
||||||
|
|
||||||
|
import { Utils } from 'jslib-common/misc/utils';
|
||||||
|
|
||||||
|
import { ModalComponent } from '../modal.component';
|
||||||
|
import { UserConfirmComponent } from '../organizations/manage/user-confirm.component';
|
||||||
|
|
||||||
|
type StatusType = OrganizationUserStatusType | ProviderUserStatusType;
|
||||||
|
|
||||||
|
const MaxCheckedCount = 500;
|
||||||
|
|
||||||
|
@Directive()
|
||||||
|
export abstract class BasePeopleComponent<UserType extends ProviderUserUserDetailsResponse | OrganizationUserUserDetailsResponse> {
|
||||||
|
|
||||||
|
@ViewChild('confirmTemplate', { read: ViewContainerRef, static: true }) confirmModalRef: ViewContainerRef;
|
||||||
|
|
||||||
|
get allCount() {
|
||||||
|
return this.allUsers != null ? this.allUsers.length : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
get invitedCount() {
|
||||||
|
return this.statusMap.has(this.userStatusType.Invited) ?
|
||||||
|
this.statusMap.get(this.userStatusType.Invited).length : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
get acceptedCount() {
|
||||||
|
return this.statusMap.has(this.userStatusType.Accepted) ?
|
||||||
|
this.statusMap.get(this.userStatusType.Accepted).length : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
get confirmedCount() {
|
||||||
|
return this.statusMap.has(this.userStatusType.Confirmed) ?
|
||||||
|
this.statusMap.get(this.userStatusType.Confirmed).length : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
get showConfirmUsers(): boolean {
|
||||||
|
return this.allUsers != null && this.statusMap != null && this.allUsers.length > 1 &&
|
||||||
|
this.confirmedCount > 0 && this.confirmedCount < 3 && this.acceptedCount > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
get showBulkConfirmUsers(): boolean {
|
||||||
|
return this.acceptedCount > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract userType: typeof OrganizationUserType | typeof ProviderUserType;
|
||||||
|
abstract userStatusType: typeof OrganizationUserStatusType | typeof ProviderUserStatusType;
|
||||||
|
|
||||||
|
loading = true;
|
||||||
|
statusMap = new Map<StatusType, UserType[]>();
|
||||||
|
status: StatusType;
|
||||||
|
users: UserType[] = [];
|
||||||
|
pagedUsers: UserType[] = [];
|
||||||
|
searchText: string;
|
||||||
|
actionPromise: Promise<any>;
|
||||||
|
|
||||||
|
protected allUsers: UserType[] = [];
|
||||||
|
|
||||||
|
protected didScroll = false;
|
||||||
|
protected pageSize = 100;
|
||||||
|
protected modal: ModalComponent = null;
|
||||||
|
|
||||||
|
private pagedUsersCount = 0;
|
||||||
|
|
||||||
|
constructor(protected apiService: ApiService, private searchService: SearchService,
|
||||||
|
protected i18nService: I18nService, private platformUtilsService: PlatformUtilsService,
|
||||||
|
protected toasterService: ToasterService, protected cryptoService: CryptoService,
|
||||||
|
private storageService: StorageService, protected validationService: ValidationService,
|
||||||
|
protected componentFactoryResolver: ComponentFactoryResolver, private logService: LogService,
|
||||||
|
private searchPipe: SearchPipe, protected userNamePipe: UserNamePipe) { }
|
||||||
|
|
||||||
|
abstract edit(user: UserType): void;
|
||||||
|
abstract getUsers(): Promise<ListResponse<UserType>>;
|
||||||
|
abstract deleteUser(id: string): Promise<any>;
|
||||||
|
abstract reinviteUser(id: string): Promise<any>;
|
||||||
|
abstract confirmUser(user: UserType, publicKey: Uint8Array): Promise<any>;
|
||||||
|
|
||||||
|
async load() {
|
||||||
|
const response = await this.getUsers();
|
||||||
|
this.statusMap.clear();
|
||||||
|
for (const status of Utils.iterateEnum(this.userStatusType)) {
|
||||||
|
this.statusMap.set(status, []);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.allUsers = response.data != null && response.data.length > 0 ? response.data : [];
|
||||||
|
this.allUsers.sort(Utils.getSortFunction(this.i18nService, 'email'));
|
||||||
|
this.allUsers.forEach(u => {
|
||||||
|
if (!this.statusMap.has(u.status)) {
|
||||||
|
this.statusMap.set(u.status, [u]);
|
||||||
|
} else {
|
||||||
|
this.statusMap.get(u.status).push(u);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.filter(this.status);
|
||||||
|
this.loading = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
filter(status: StatusType) {
|
||||||
|
this.status = status;
|
||||||
|
if (this.status != null) {
|
||||||
|
this.users = this.statusMap.get(this.status);
|
||||||
|
} else {
|
||||||
|
this.users = this.allUsers;
|
||||||
|
}
|
||||||
|
// Reset checkbox selecton
|
||||||
|
this.selectAll(false);
|
||||||
|
this.resetPaging();
|
||||||
|
}
|
||||||
|
|
||||||
|
loadMore() {
|
||||||
|
if (!this.users || this.users.length <= this.pageSize) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const pagedLength = this.pagedUsers.length;
|
||||||
|
let pagedSize = this.pageSize;
|
||||||
|
if (pagedLength === 0 && this.pagedUsersCount > this.pageSize) {
|
||||||
|
pagedSize = this.pagedUsersCount;
|
||||||
|
}
|
||||||
|
if (this.users.length > pagedLength) {
|
||||||
|
this.pagedUsers = this.pagedUsers.concat(this.users.slice(pagedLength, pagedLength + pagedSize));
|
||||||
|
}
|
||||||
|
this.pagedUsersCount = this.pagedUsers.length;
|
||||||
|
this.didScroll = this.pagedUsers.length > this.pageSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
checkUser(user: OrganizationUserUserDetailsResponse, select?: boolean) {
|
||||||
|
(user as any).checked = select == null ? !(user as any).checked : select;
|
||||||
|
}
|
||||||
|
|
||||||
|
selectAll(select: boolean) {
|
||||||
|
if (select) {
|
||||||
|
this.selectAll(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
const filteredUsers = this.searchPipe.transform(this.users, this.searchText, 'name', 'email', 'id');
|
||||||
|
|
||||||
|
const selectCount = select && filteredUsers.length > MaxCheckedCount
|
||||||
|
? MaxCheckedCount
|
||||||
|
: filteredUsers.length;
|
||||||
|
for (let i = 0; i < selectCount; i++) {
|
||||||
|
this.checkUser(filteredUsers[i], select);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async resetPaging() {
|
||||||
|
this.pagedUsers = [];
|
||||||
|
this.loadMore();
|
||||||
|
}
|
||||||
|
|
||||||
|
invite() {
|
||||||
|
this.edit(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
async remove(user: UserType) {
|
||||||
|
const confirmed = await this.platformUtilsService.showDialog(
|
||||||
|
this.i18nService.t('removeUserConfirmation'), this.userNamePipe.transform(user),
|
||||||
|
this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');
|
||||||
|
|
||||||
|
if (!confirmed) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.actionPromise = this.deleteUser(user.id);
|
||||||
|
try {
|
||||||
|
await this.actionPromise;
|
||||||
|
this.toasterService.popAsync('success', null, this.i18nService.t('removedUserId', this.userNamePipe.transform(user)));
|
||||||
|
this.removeUser(user);
|
||||||
|
} catch (e) {
|
||||||
|
this.validationService.showError(e);
|
||||||
|
}
|
||||||
|
this.actionPromise = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
async reinvite(user: UserType) {
|
||||||
|
if (this.actionPromise != null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.actionPromise = this.reinviteUser(user.id);
|
||||||
|
try {
|
||||||
|
await this.actionPromise;
|
||||||
|
this.toasterService.popAsync('success', null, this.i18nService.t('hasBeenReinvited', this.userNamePipe.transform(user)));
|
||||||
|
} catch (e) {
|
||||||
|
this.validationService.showError(e);
|
||||||
|
}
|
||||||
|
this.actionPromise = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
async confirm(user: UserType) {
|
||||||
|
function updateUser(self: BasePeopleComponent<UserType>) {
|
||||||
|
user.status = self.userStatusType.Confirmed;
|
||||||
|
const mapIndex = self.statusMap.get(self.userStatusType.Accepted).indexOf(user);
|
||||||
|
if (mapIndex > -1) {
|
||||||
|
self.statusMap.get(self.userStatusType.Accepted).splice(mapIndex, 1);
|
||||||
|
self.statusMap.get(self.userStatusType.Confirmed).push(user);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const confirmUser = async (publicKey: Uint8Array) => {
|
||||||
|
try {
|
||||||
|
this.actionPromise = this.confirmUser(user, publicKey);
|
||||||
|
await this.actionPromise;
|
||||||
|
updateUser(this);
|
||||||
|
this.toasterService.popAsync('success', null, this.i18nService.t('hasBeenConfirmed', this.userNamePipe.transform(user)));
|
||||||
|
} catch (e) {
|
||||||
|
this.validationService.showError(e);
|
||||||
|
throw e;
|
||||||
|
} finally {
|
||||||
|
this.actionPromise = null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (this.actionPromise != null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const publicKeyResponse = await this.apiService.getUserPublicKey(user.userId);
|
||||||
|
const publicKey = Utils.fromB64ToArray(publicKeyResponse.publicKey);
|
||||||
|
|
||||||
|
const autoConfirm = await this.storageService.get<boolean>(ConstantsService.autoConfirmFingerprints);
|
||||||
|
if (autoConfirm == null || !autoConfirm) {
|
||||||
|
if (this.modal != null) {
|
||||||
|
this.modal.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);
|
||||||
|
this.modal = this.confirmModalRef.createComponent(factory).instance;
|
||||||
|
const childComponent = this.modal.show<UserConfirmComponent>(
|
||||||
|
UserConfirmComponent, this.confirmModalRef);
|
||||||
|
|
||||||
|
childComponent.name = this.userNamePipe.transform(user);
|
||||||
|
childComponent.userId = user != null ? user.userId : null;
|
||||||
|
childComponent.publicKey = publicKey;
|
||||||
|
childComponent.onConfirmedUser.subscribe(async () => {
|
||||||
|
try {
|
||||||
|
await confirmUser(publicKey);
|
||||||
|
this.modal.close();
|
||||||
|
} catch (e) {
|
||||||
|
this.logService.error(`Handled exception: ${e}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.modal.onClosed.subscribe(() => {
|
||||||
|
this.modal = null;
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const fingerprint = await this.cryptoService.getFingerprint(user.userId, publicKey.buffer);
|
||||||
|
this.logService.info(`User's fingerprint: ${fingerprint.join('-')}`);
|
||||||
|
} catch { }
|
||||||
|
await confirmUser(publicKey);
|
||||||
|
} catch (e) {
|
||||||
|
this.logService.error(`Handled exception: ${e}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
isSearching() {
|
||||||
|
return this.searchService.isSearchable(this.searchText);
|
||||||
|
}
|
||||||
|
|
||||||
|
isPaging() {
|
||||||
|
const searching = this.isSearching();
|
||||||
|
if (searching && this.didScroll) {
|
||||||
|
this.resetPaging();
|
||||||
|
}
|
||||||
|
return !searching && this.users && this.users.length > this.pageSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected getCheckedUsers() {
|
||||||
|
return this.users.filter(u => (u as any).checked);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected removeUser(user: UserType) {
|
||||||
|
let index = this.users.indexOf(user);
|
||||||
|
if (index > -1) {
|
||||||
|
this.users.splice(index, 1);
|
||||||
|
this.resetPaging();
|
||||||
|
}
|
||||||
|
if (this.statusMap.has(user.status)) {
|
||||||
|
index = this.statusMap.get(user.status).indexOf(user);
|
||||||
|
if (index > -1) {
|
||||||
|
this.statusMap.get(user.status).splice(index, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -58,7 +58,12 @@ export class AvatarComponent implements OnChanges, OnInit {
|
|||||||
chars = this.getFirstLetters(upperData, this.charCount);
|
chars = this.getFirstLetters(upperData, this.charCount);
|
||||||
}
|
}
|
||||||
if (chars == null) {
|
if (chars == null) {
|
||||||
chars = upperData.substr(0, this.charCount);
|
chars = this.unicodeSafeSubstring(upperData, this.charCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the chars contain an emoji, only show it.
|
||||||
|
if (chars.match(Utils.regexpEmojiPresentation)) {
|
||||||
|
chars = chars.match(Utils.regexpEmojiPresentation)[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
const charObj = this.getCharText(chars);
|
const charObj = this.getCharText(chars);
|
||||||
@@ -91,7 +96,7 @@ export class AvatarComponent implements OnChanges, OnInit {
|
|||||||
if (parts.length > 1) {
|
if (parts.length > 1) {
|
||||||
let text = '';
|
let text = '';
|
||||||
for (let i = 0; i < count; i++) {
|
for (let i = 0; i < count; i++) {
|
||||||
text += parts[i].substr(0, 1);
|
text += this.unicodeSafeSubstring(parts[i], 1);
|
||||||
}
|
}
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
@@ -125,4 +130,9 @@ export class AvatarComponent implements OnChanges, OnInit {
|
|||||||
textTag.style.fontSize = this.fontSize + 'px';
|
textTag.style.fontSize = this.fontSize + 'px';
|
||||||
return textTag;
|
return textTag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private unicodeSafeSubstring(str: string, count: number) {
|
||||||
|
const characters = str.match(/./ug);
|
||||||
|
return characters != null ? characters.slice(0, count).join('') : '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,14 @@
|
|||||||
<li class="nav-item" routerLinkActive="active">
|
<li class="nav-item" routerLinkActive="active">
|
||||||
<a class="nav-link" routerLink="/sends">{{'send' | i18n}}</a>
|
<a class="nav-link" routerLink="/sends">{{'send' | i18n}}</a>
|
||||||
</li>
|
</li>
|
||||||
|
<ng-container *ngIf="providers.length >= 1">
|
||||||
|
<li class="nav-item" routerLinkActive="active" *ngIf="providers.length == 1">
|
||||||
|
<a class="nav-link" [routerLink]="['/providers', providers[0].id]">{{'provider' | i18n}}</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item" routerLinkActive="active" *ngIf="providers.length > 1">
|
||||||
|
<a class="nav-link" routerLink="/providers">{{'provider' | i18n}}</a>
|
||||||
|
</li>
|
||||||
|
</ng-container>
|
||||||
<li class="nav-item" routerLinkActive="active">
|
<li class="nav-item" routerLinkActive="active">
|
||||||
<a class="nav-link" routerLink="/tools">{{'tools' | i18n}}</a>
|
<a class="nav-link" routerLink="/tools">{{'tools' | i18n}}</a>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -5,7 +5,11 @@ import {
|
|||||||
|
|
||||||
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
|
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
|
||||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||||
|
import { SyncService } from 'jslib-common/abstractions/sync.service';
|
||||||
import { TokenService } from 'jslib-common/abstractions/token.service';
|
import { TokenService } from 'jslib-common/abstractions/token.service';
|
||||||
|
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||||
|
|
||||||
|
import { Provider } from 'jslib-common/models/domain/provider';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-navbar',
|
selector: 'app-navbar',
|
||||||
@@ -15,9 +19,10 @@ export class NavbarComponent implements OnInit {
|
|||||||
selfHosted = false;
|
selfHosted = false;
|
||||||
name: string;
|
name: string;
|
||||||
email: string;
|
email: string;
|
||||||
|
providers: Provider[] = [];
|
||||||
|
|
||||||
constructor(private messagingService: MessagingService, private platformUtilsService: PlatformUtilsService,
|
constructor(private messagingService: MessagingService, private platformUtilsService: PlatformUtilsService,
|
||||||
private tokenService: TokenService) {
|
private tokenService: TokenService, private userService: UserService, private syncService: SyncService) {
|
||||||
this.selfHosted = this.platformUtilsService.isSelfHost();
|
this.selfHosted = this.platformUtilsService.isSelfHost();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,6 +32,12 @@ export class NavbarComponent implements OnInit {
|
|||||||
if (this.name == null || this.name.trim() === '') {
|
if (this.name == null || this.name.trim() === '') {
|
||||||
this.name = this.email;
|
this.name = this.email;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure provides are loaded
|
||||||
|
if (await this.syncService.getLastSync() == null) {
|
||||||
|
await this.syncService.fullSync(false);
|
||||||
|
}
|
||||||
|
this.providers = await this.userService.getAllProviders();
|
||||||
}
|
}
|
||||||
|
|
||||||
lock() {
|
lock() {
|
||||||
|
|||||||
@@ -14,6 +14,12 @@
|
|||||||
{{'organizationIsDisabled' | i18n}}
|
{{'organizationIsDisabled' | i18n}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="ml-3 card border-info text-info bg-transparent" *ngIf="organization.isProviderUser">
|
||||||
|
<div class="card-body py-2">
|
||||||
|
<i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
|
||||||
|
{{'accessingUsingProvider' | i18n : organization.providerName}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ul class="nav nav-tabs" *ngIf="showMenuBar">
|
<ul class="nav nav-tabs" *ngIf="showMenuBar">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
|
|||||||
@@ -34,12 +34,7 @@ export class OrganizationLayoutComponent implements OnInit, OnDestroy {
|
|||||||
private environmentService: EnvironmentService) { }
|
private environmentService: EnvironmentService) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.businessUrl = 'https://portal.bitwarden.com';
|
this.businessUrl = this.environmentService.getEnterpriseUrl();
|
||||||
if (this.environmentService.enterpriseUrl != null) {
|
|
||||||
this.businessUrl = this.environmentService.enterpriseUrl;
|
|
||||||
} else if (this.environmentService.baseUrl != null) {
|
|
||||||
this.businessUrl = this.environmentService.baseUrl + '/portal';
|
|
||||||
}
|
|
||||||
|
|
||||||
document.body.classList.remove('layout_frontend');
|
document.body.classList.remove('layout_frontend');
|
||||||
this.route.params.subscribe(async params => {
|
this.route.params.subscribe(async params => {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ require('../scss/styles.scss');
|
|||||||
|
|
||||||
import { AppModule } from './app.module';
|
import { AppModule } from './app.module';
|
||||||
|
|
||||||
if (process.env.ENV === 'production') {
|
if (process.env.NODE_ENV === 'production') {
|
||||||
enableProdMode();
|
enableProdMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tr *ngFor="let user of filteredUsers">
|
<tr *ngFor="let user of filteredUsers">
|
||||||
<td width="30">
|
<td width="30">
|
||||||
<app-avatar [data]="user.name || user.email" [email]="user.email" size="25" [circle]="true"
|
<app-avatar [data]="user | userName" [email]="user.email" size="25" [circle]="true"
|
||||||
[fontSize]="14"></app-avatar>
|
[fontSize]="14"></app-avatar>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr *ngFor="let user of excludedUsers">
|
<tr *ngFor="let user of excludedUsers">
|
||||||
<td width="30">
|
<td width="30">
|
||||||
<app-avatar [data]="user.name || user.email" [email]="user.email" size="25" [circle]="true"
|
<app-avatar [data]="user | userName" [email]="user.email" size="25" [circle]="true"
|
||||||
[fontSize]="14"></app-avatar>
|
[fontSize]="14"></app-avatar>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tr *ngFor="let user of filteredUsers">
|
<tr *ngFor="let user of filteredUsers">
|
||||||
<td width="30">
|
<td width="30">
|
||||||
<app-avatar [data]="user.name || user.email" [email]="user.email" size="25" [circle]="true"
|
<app-avatar [data]="user | userName" [email]="user.email" size="25" [circle]="true"
|
||||||
[fontSize]="14"></app-avatar>
|
[fontSize]="14"></app-avatar>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -11,11 +11,10 @@ import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
|||||||
import { OrganizationUserBulkConfirmRequest } from 'jslib-common/models/request/organizationUserBulkConfirmRequest';
|
import { OrganizationUserBulkConfirmRequest } from 'jslib-common/models/request/organizationUserBulkConfirmRequest';
|
||||||
import { OrganizationUserBulkRequest } from 'jslib-common/models/request/organizationUserBulkRequest';
|
import { OrganizationUserBulkRequest } from 'jslib-common/models/request/organizationUserBulkRequest';
|
||||||
|
|
||||||
import { OrganizationUserUserDetailsResponse } from 'jslib-common/models/response/organizationUserResponse';
|
|
||||||
|
|
||||||
import { OrganizationUserStatusType } from 'jslib-common/enums/organizationUserStatusType';
|
import { OrganizationUserStatusType } from 'jslib-common/enums/organizationUserStatusType';
|
||||||
|
|
||||||
import { Utils } from 'jslib-common/misc/utils';
|
import { Utils } from 'jslib-common/misc/utils';
|
||||||
|
import { BulkUserDetails } from './bulk-status.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-bulk-confirm',
|
selector: 'app-bulk-confirm',
|
||||||
@@ -24,10 +23,10 @@ import { Utils } from 'jslib-common/misc/utils';
|
|||||||
export class BulkConfirmComponent implements OnInit {
|
export class BulkConfirmComponent implements OnInit {
|
||||||
|
|
||||||
@Input() organizationId: string;
|
@Input() organizationId: string;
|
||||||
@Input() users: OrganizationUserUserDetailsResponse[];
|
@Input() users: BulkUserDetails[];
|
||||||
|
|
||||||
excludedUsers: OrganizationUserUserDetailsResponse[];
|
excludedUsers: BulkUserDetails[];
|
||||||
filteredUsers: OrganizationUserUserDetailsResponse[];
|
filteredUsers: BulkUserDetails[];
|
||||||
publicKeys: Map<string, Uint8Array> = new Map();
|
publicKeys: Map<string, Uint8Array> = new Map();
|
||||||
fingerprints: Map<string, string> = new Map();
|
fingerprints: Map<string, string> = new Map();
|
||||||
statuses: Map<string, string> = new Map();
|
statuses: Map<string, string> = new Map();
|
||||||
@@ -36,23 +35,22 @@ export class BulkConfirmComponent implements OnInit {
|
|||||||
done: boolean = false;
|
done: boolean = false;
|
||||||
error: string;
|
error: string;
|
||||||
|
|
||||||
constructor(private cryptoService: CryptoService, private apiService: ApiService,
|
constructor(protected cryptoService: CryptoService, protected apiService: ApiService,
|
||||||
private i18nService: I18nService) { }
|
private i18nService: I18nService) { }
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this.excludedUsers = this.users.filter(user => user.status !== OrganizationUserStatusType.Accepted);
|
this.excludedUsers = this.users.filter(u => !this.isAccepted(u));
|
||||||
this.filteredUsers = this.users.filter(user => user.status === OrganizationUserStatusType.Accepted);
|
this.filteredUsers = this.users.filter(u => this.isAccepted(u));
|
||||||
|
|
||||||
if (this.filteredUsers.length <= 0) {
|
if (this.filteredUsers.length <= 0) {
|
||||||
this.done = true;
|
this.done = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const request = new OrganizationUserBulkRequest(this.filteredUsers.map(user => user.id));
|
const response = await this.getPublicKeys();
|
||||||
const response = await this.apiService.postOrganizationUsersPublicKey(this.organizationId, request);
|
|
||||||
|
|
||||||
for (const entry of response.data) {
|
for (const entry of response.data) {
|
||||||
const publicKey = Utils.fromB64ToArray(entry.key);
|
const publicKey = Utils.fromB64ToArray(entry.key);
|
||||||
const fingerprint = await this.cryptoService.getFingerprint(entry.id, publicKey.buffer);
|
const fingerprint = await this.cryptoService.getFingerprint(entry.userId, publicKey.buffer);
|
||||||
if (fingerprint != null) {
|
if (fingerprint != null) {
|
||||||
this.publicKeys.set(entry.id, publicKey);
|
this.publicKeys.set(entry.id, publicKey);
|
||||||
this.fingerprints.set(entry.id, fingerprint.join('-'));
|
this.fingerprints.set(entry.id, fingerprint.join('-'));
|
||||||
@@ -65,21 +63,20 @@ export class BulkConfirmComponent implements OnInit {
|
|||||||
async submit() {
|
async submit() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
try {
|
try {
|
||||||
const orgKey = await this.cryptoService.getOrgKey(this.organizationId);
|
const key = await this.getCryptoKey();
|
||||||
const userIdsWithKeys: any[] = [];
|
const userIdsWithKeys: any[] = [];
|
||||||
for (const user of this.filteredUsers) {
|
for (const user of this.filteredUsers) {
|
||||||
const publicKey = this.publicKeys.get(user.id);
|
const publicKey = this.publicKeys.get(user.id);
|
||||||
if (publicKey == null) {
|
if (publicKey == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const key = await this.cryptoService.rsaEncrypt(orgKey.key, publicKey.buffer);
|
const encryptedKey = await this.cryptoService.rsaEncrypt(key.key, publicKey.buffer);
|
||||||
userIdsWithKeys.push({
|
userIdsWithKeys.push({
|
||||||
id: user.id,
|
id: user.id,
|
||||||
key: key.encryptedString,
|
key: encryptedKey.encryptedString,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const request = new OrganizationUserBulkConfirmRequest(userIdsWithKeys);
|
const response = await this.postConfirmRequest(userIdsWithKeys);
|
||||||
const response = await this.apiService.postOrganizationUserBulkConfirm(this.organizationId, request);
|
|
||||||
|
|
||||||
response.data.forEach(entry => {
|
response.data.forEach(entry => {
|
||||||
const error = entry.error !== '' ? entry.error : this.i18nService.t('bulkConfirmMessage');
|
const error = entry.error !== '' ? entry.error : this.i18nService.t('bulkConfirmMessage');
|
||||||
@@ -92,4 +89,22 @@ export class BulkConfirmComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected isAccepted(user: BulkUserDetails) {
|
||||||
|
return user.status === OrganizationUserStatusType.Accepted;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected async getPublicKeys() {
|
||||||
|
const request = new OrganizationUserBulkRequest(this.filteredUsers.map(user => user.id));
|
||||||
|
return await this.apiService.postOrganizationUsersPublicKey(this.organizationId, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected getCryptoKey() {
|
||||||
|
return this.cryptoService.getOrgKey(this.organizationId);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected async postConfirmRequest(userIdsWithKeys: any[]) {
|
||||||
|
const request = new OrganizationUserBulkConfirmRequest(userIdsWithKeys);
|
||||||
|
return await this.apiService.postOrganizationUserBulkConfirm(this.organizationId, request);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,17 +10,13 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="card-body text-center" *ngIf="loading">
|
|
||||||
<i class="fa fa-spinner fa-spin" title="{{'loading' | i18n}}" aria-hidden="true"></i>
|
|
||||||
{{'loading' | i18n}}
|
|
||||||
</div>
|
|
||||||
<app-callout type="danger" *ngIf="users.length <= 0">
|
<app-callout type="danger" *ngIf="users.length <= 0">
|
||||||
{{'noSelectedUsersApplicable' | i18n}}
|
{{'noSelectedUsersApplicable' | i18n}}
|
||||||
</app-callout>
|
</app-callout>
|
||||||
<app-callout type="error" *ngIf="error">
|
<app-callout type="error" *ngIf="error">
|
||||||
{{error}}
|
{{error}}
|
||||||
</app-callout>
|
</app-callout>
|
||||||
<ng-container *ngIf="!loading && !done">
|
<ng-container *ngIf="!done">
|
||||||
<app-callout type="warning" *ngIf="users.length > 0 && !error">
|
<app-callout type="warning" *ngIf="users.length > 0 && !error">
|
||||||
{{'removeUsersWarning' | i18n}}
|
{{'removeUsersWarning' | i18n}}
|
||||||
</app-callout>
|
</app-callout>
|
||||||
@@ -32,7 +28,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tr *ngFor="let user of users">
|
<tr *ngFor="let user of users">
|
||||||
<td width="30">
|
<td width="30">
|
||||||
<app-avatar [data]="user.name || user.email" [email]="user.email" size="25" [circle]="true"
|
<app-avatar [data]="user | userName" [email]="user.email" size="25" [circle]="true"
|
||||||
[fontSize]="14"></app-avatar>
|
[fontSize]="14"></app-avatar>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -42,7 +38,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container *ngIf="!loading && done">
|
<ng-container *ngIf="done">
|
||||||
<table class="table table-hover table-list">
|
<table class="table table-hover table-list">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -52,7 +48,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tr *ngFor="let user of users">
|
<tr *ngFor="let user of users">
|
||||||
<td width="30">
|
<td width="30">
|
||||||
<app-avatar [data]="user.name || user.email" [email]="user.email" size="25" [circle]="true"
|
<app-avatar [data]="user | userName" [email]="user.email" size="25" [circle]="true"
|
||||||
[fontSize]="14"></app-avatar>
|
[fontSize]="14"></app-avatar>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { ApiService } from 'jslib-common/abstractions/api.service';
|
|||||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||||
import { OrganizationUserBulkRequest } from 'jslib-common/models/request/organizationUserBulkRequest';
|
import { OrganizationUserBulkRequest } from 'jslib-common/models/request/organizationUserBulkRequest';
|
||||||
|
|
||||||
import { OrganizationUserUserDetailsResponse } from 'jslib-common/models/response/organizationUserResponse';
|
import { BulkUserDetails } from './bulk-status.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-bulk-remove',
|
selector: 'app-bulk-remove',
|
||||||
@@ -16,7 +16,7 @@ import { OrganizationUserUserDetailsResponse } from 'jslib-common/models/respons
|
|||||||
export class BulkRemoveComponent {
|
export class BulkRemoveComponent {
|
||||||
|
|
||||||
@Input() organizationId: string;
|
@Input() organizationId: string;
|
||||||
@Input() users: OrganizationUserUserDetailsResponse[];
|
@Input() users: BulkUserDetails[];
|
||||||
|
|
||||||
statuses: Map<string, string> = new Map();
|
statuses: Map<string, string> = new Map();
|
||||||
|
|
||||||
@@ -24,13 +24,12 @@ export class BulkRemoveComponent {
|
|||||||
done: boolean = false;
|
done: boolean = false;
|
||||||
error: string;
|
error: string;
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private i18nService: I18nService) { }
|
constructor(protected apiService: ApiService, protected i18nService: I18nService) { }
|
||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
try {
|
try {
|
||||||
const request = new OrganizationUserBulkRequest(this.users.map(user => user.id));
|
const response = await this.deleteUsers();
|
||||||
const response = await this.apiService.deleteManyOrganizationUsers(this.organizationId, request);
|
|
||||||
|
|
||||||
response.data.forEach(entry => {
|
response.data.forEach(entry => {
|
||||||
const error = entry.error !== '' ? entry.error : this.i18nService.t('bulkRemovedMessage');
|
const error = entry.error !== '' ? entry.error : this.i18nService.t('bulkRemovedMessage');
|
||||||
@@ -43,4 +42,9 @@ export class BulkRemoveComponent {
|
|||||||
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected async deleteUsers() {
|
||||||
|
const request = new OrganizationUserBulkRequest(this.users.map(user => user.id));
|
||||||
|
return await this.apiService.deleteManyOrganizationUsers(this.organizationId, request);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tr *ngFor="let item of users">
|
<tr *ngFor="let item of users">
|
||||||
<td width="30">
|
<td width="30">
|
||||||
<app-avatar [data]="item.user.name || item.user.email" [email]="item.user.email" size="25" [circle]="true"
|
<app-avatar [data]="item.user | userName" [email]="item.user.email" size="25" [circle]="true"
|
||||||
[fontSize]="14"></app-avatar>
|
[fontSize]="14"></app-avatar>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -1,9 +1,16 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
import { OrganizationUserStatusType } from 'jslib-common/enums/organizationUserStatusType';
|
||||||
|
import { ProviderUserStatusType } from 'jslib-common/enums/providerUserStatusType';
|
||||||
|
|
||||||
import { OrganizationUserUserDetailsResponse } from 'jslib-common/models/response/organizationUserResponse';
|
export interface BulkUserDetails {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
email: string;
|
||||||
|
status: OrganizationUserStatusType | ProviderUserStatusType;
|
||||||
|
}
|
||||||
|
|
||||||
type BulkStatusEntry = {
|
type BulkStatusEntry = {
|
||||||
user: OrganizationUserUserDetailsResponse,
|
user: BulkUserDetails,
|
||||||
error: boolean,
|
error: boolean,
|
||||||
message: string,
|
message: string,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
|||||||
|
|
||||||
import { EventService } from '../../services/event.service';
|
import { EventService } from '../../services/event.service';
|
||||||
|
|
||||||
|
import { UserNamePipe } from 'jslib-angular/pipes/user-name.pipe';
|
||||||
|
|
||||||
import { EventResponse } from 'jslib-common/models/response/eventResponse';
|
import { EventResponse } from 'jslib-common/models/response/eventResponse';
|
||||||
import { ListResponse } from 'jslib-common/models/response/listResponse';
|
import { ListResponse } from 'jslib-common/models/response/listResponse';
|
||||||
|
|
||||||
@@ -23,6 +25,7 @@ export class EntityEventsComponent implements OnInit {
|
|||||||
@Input() entity: 'user' | 'cipher';
|
@Input() entity: 'user' | 'cipher';
|
||||||
@Input() entityId: string;
|
@Input() entityId: string;
|
||||||
@Input() organizationId: string;
|
@Input() organizationId: string;
|
||||||
|
@Input() providerId: string;
|
||||||
@Input() showUser = false;
|
@Input() showUser = false;
|
||||||
|
|
||||||
loading = true;
|
loading = true;
|
||||||
@@ -38,7 +41,8 @@ export class EntityEventsComponent implements OnInit {
|
|||||||
private orgUsersIdMap = new Map<string, any>();
|
private orgUsersIdMap = new Map<string, any>();
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||||
private eventService: EventService, private toasterService: ToasterService) { }
|
private eventService: EventService, private toasterService: ToasterService,
|
||||||
|
private userNamePipe: UserNamePipe) { }
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
const defaultDates = this.eventService.getDefaultDateFilters();
|
const defaultDates = this.eventService.getDefaultDateFilters();
|
||||||
@@ -51,7 +55,7 @@ export class EntityEventsComponent implements OnInit {
|
|||||||
if (this.showUser) {
|
if (this.showUser) {
|
||||||
const response = await this.apiService.getOrganizationUsers(this.organizationId);
|
const response = await this.apiService.getOrganizationUsers(this.organizationId);
|
||||||
response.data.forEach(u => {
|
response.data.forEach(u => {
|
||||||
const name = u.name == null || u.name.trim() === '' ? u.email : u.name;
|
const name = this.userNamePipe.transform(u);
|
||||||
this.orgUsersIdMap.set(u.id, { name: name, email: u.email });
|
this.orgUsersIdMap.set(u.id, { name: name, email: u.email });
|
||||||
this.orgUsersUserIdMap.set(u.userId, { name: name, email: u.email });
|
this.orgUsersUserIdMap.set(u.userId, { name: name, email: u.email });
|
||||||
});
|
});
|
||||||
@@ -78,7 +82,10 @@ export class EntityEventsComponent implements OnInit {
|
|||||||
let response: ListResponse<EventResponse>;
|
let response: ListResponse<EventResponse>;
|
||||||
try {
|
try {
|
||||||
let promise: Promise<any>;
|
let promise: Promise<any>;
|
||||||
if (this.entity === 'user') {
|
if (this.entity === 'user' && this.providerId) {
|
||||||
|
promise = this.apiService.getEventsProviderUser(this.providerId, this.entityId,
|
||||||
|
dates[0], dates[1], clearExisting ? null : this.continuationToken);
|
||||||
|
} else if (this.entity === 'user') {
|
||||||
promise = this.apiService.getEventsOrganizationUser(this.organizationId, this.entityId,
|
promise = this.apiService.getEventsOrganizationUser(this.organizationId, this.entityId,
|
||||||
dates[0], dates[1], clearExisting ? null : this.continuationToken);
|
dates[0], dates[1], clearExisting ? null : this.continuationToken);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
(change)="selectedChanged(u)" appStopProp>
|
(change)="selectedChanged(u)" appStopProp>
|
||||||
</td>
|
</td>
|
||||||
<td width="30" (click)="check(u)">
|
<td width="30" (click)="check(u)">
|
||||||
<app-avatar [data]="u.name || u.email" [email]="u.email" size="25" [circle]="true"
|
<app-avatar [data]="u | userName" [email]="u.email" size="25" [circle]="true"
|
||||||
[fontSize]="14"></app-avatar>
|
[fontSize]="14"></app-avatar>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -3,57 +3,51 @@ import {
|
|||||||
OnInit,
|
OnInit,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
|
|
||||||
|
import { UserNamePipe } from 'jslib-angular/pipes/user-name.pipe';
|
||||||
|
|
||||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||||
import { ExportService } from 'jslib-common/abstractions/export.service';
|
import { ExportService } from 'jslib-common/abstractions/export.service';
|
||||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||||
|
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||||
import { UserService } from 'jslib-common/abstractions/user.service';
|
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||||
|
|
||||||
|
import { Organization } from 'jslib-common/models/domain/organization';
|
||||||
import { EventResponse } from 'jslib-common/models/response/eventResponse';
|
import { EventResponse } from 'jslib-common/models/response/eventResponse';
|
||||||
import { ListResponse } from 'jslib-common/models/response/listResponse';
|
|
||||||
import { EventView } from 'jslib-common/models/view/eventView';
|
|
||||||
|
|
||||||
import { EventService } from '../../services/event.service';
|
import { EventService } from '../../services/event.service';
|
||||||
|
|
||||||
|
import { BaseEventsComponent } from '../../common/base.events.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-org-events',
|
selector: 'app-org-events',
|
||||||
templateUrl: 'events.component.html',
|
templateUrl: 'events.component.html',
|
||||||
})
|
})
|
||||||
export class EventsComponent implements OnInit {
|
export class EventsComponent extends BaseEventsComponent implements OnInit {
|
||||||
loading = true;
|
exportFileName: string = 'org-events';
|
||||||
loaded = false;
|
|
||||||
organizationId: string;
|
organizationId: string;
|
||||||
events: EventView[];
|
organization: Organization;
|
||||||
start: string;
|
|
||||||
end: string;
|
|
||||||
dirtyDates: boolean = true;
|
|
||||||
continuationToken: string;
|
|
||||||
refreshPromise: Promise<any>;
|
|
||||||
exportPromise: Promise<any>;
|
|
||||||
morePromise: Promise<any>;
|
|
||||||
|
|
||||||
private orgUsersUserIdMap = new Map<string, any>();
|
private orgUsersUserIdMap = new Map<string, any>();
|
||||||
private orgUsersIdMap = new Map<string, any>();
|
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private route: ActivatedRoute, private eventService: EventService,
|
constructor(private apiService: ApiService, private route: ActivatedRoute, eventService: EventService,
|
||||||
private i18nService: I18nService, private toasterService: ToasterService, private userService: UserService,
|
i18nService: I18nService, toasterService: ToasterService, private userService: UserService,
|
||||||
private exportService: ExportService, private platformUtilsService: PlatformUtilsService,
|
exportService: ExportService, platformUtilsService: PlatformUtilsService, private router: Router,
|
||||||
private router: Router) { }
|
logService: LogService, private userNamePipe: UserNamePipe) {
|
||||||
|
super(eventService, i18nService, toasterService, exportService, platformUtilsService, logService);
|
||||||
|
}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this.route.parent.parent.params.subscribe(async params => {
|
this.route.parent.parent.params.subscribe(async params => {
|
||||||
this.organizationId = params.organizationId;
|
this.organizationId = params.organizationId;
|
||||||
const organization = await this.userService.getOrganization(this.organizationId);
|
this.organization = await this.userService.getOrganization(this.organizationId);
|
||||||
if (organization == null || !organization.useEvents) {
|
if (this.organization == null || !this.organization.useEvents) {
|
||||||
this.router.navigate(['/organizations', this.organizationId]);
|
this.router.navigate(['/organizations', this.organizationId]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const defaultDates = this.eventService.getDefaultDateFilters();
|
|
||||||
this.start = defaultDates[0];
|
|
||||||
this.end = defaultDates[1];
|
|
||||||
await this.load();
|
await this.load();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -61,125 +55,48 @@ export class EventsComponent implements OnInit {
|
|||||||
async load() {
|
async load() {
|
||||||
const response = await this.apiService.getOrganizationUsers(this.organizationId);
|
const response = await this.apiService.getOrganizationUsers(this.organizationId);
|
||||||
response.data.forEach(u => {
|
response.data.forEach(u => {
|
||||||
const name = u.name == null || u.name.trim() === '' ? u.email : u.name;
|
const name = this.userNamePipe.transform(u);
|
||||||
this.orgUsersIdMap.set(u.id, { name: name, email: u.email });
|
|
||||||
this.orgUsersUserIdMap.set(u.userId, { name: name, email: u.email });
|
this.orgUsersUserIdMap.set(u.userId, { name: name, email: u.email });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (this.organization.providerId != null) {
|
||||||
|
try {
|
||||||
|
const provider = await this.userService.getProvider(this.organization.providerId);
|
||||||
|
if (provider != null && (await this.userService.getProvider(this.organization.providerId)).canManageUsers) {
|
||||||
|
const providerUsersResponse = await this.apiService.getProviderUsers(this.organization.providerId);
|
||||||
|
providerUsersResponse.data.forEach(u => {
|
||||||
|
const name = this.userNamePipe.transform(u);
|
||||||
|
this.orgUsersUserIdMap.set(u.userId, { name: `${name} (${this.organization.providerName})`, email: u.email });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
this.logService.warning(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
await this.loadEvents(true);
|
await this.loadEvents(true);
|
||||||
this.loaded = true;
|
this.loaded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
async exportEvents() {
|
protected requestEvents(startDate: string, endDate: string, continuationToken: string) {
|
||||||
if (this.appApiPromiseUnfulfilled() || this.dirtyDates) {
|
return this.apiService.getEventsOrganization(this.organizationId, startDate, endDate, continuationToken);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.loading = true;
|
protected getUserName(r: EventResponse, userId: string) {
|
||||||
|
if (userId == null) {
|
||||||
const dates = this.parseDates();
|
|
||||||
if (dates == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
this.exportPromise = this.export(dates[0], dates[1]);
|
|
||||||
|
|
||||||
await this.exportPromise;
|
|
||||||
} catch { }
|
|
||||||
|
|
||||||
this.exportPromise = null;
|
|
||||||
this.loading = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
async loadEvents(clearExisting: boolean) {
|
|
||||||
if (this.appApiPromiseUnfulfilled()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const dates = this.parseDates();
|
|
||||||
if (dates == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.loading = true;
|
|
||||||
let events: EventView[] = [];
|
|
||||||
try {
|
|
||||||
const promise = this.loadAndParseEvents(dates[0], dates[1], clearExisting ? null : this.continuationToken);
|
|
||||||
if (clearExisting) {
|
|
||||||
this.refreshPromise = promise;
|
|
||||||
} else {
|
|
||||||
this.morePromise = promise;
|
|
||||||
}
|
|
||||||
const result = await promise;
|
|
||||||
this.continuationToken = result.continuationToken;
|
|
||||||
events = result.events;
|
|
||||||
} catch { }
|
|
||||||
|
|
||||||
if (!clearExisting && this.events != null && this.events.length > 0) {
|
|
||||||
this.events = this.events.concat(events);
|
|
||||||
} else {
|
|
||||||
this.events = events;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.dirtyDates = false;
|
|
||||||
this.loading = false;
|
|
||||||
this.morePromise = null;
|
|
||||||
this.refreshPromise = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private async export(start: string, end: string) {
|
|
||||||
let continuationToken = this.continuationToken;
|
|
||||||
let events = [].concat(this.events);
|
|
||||||
|
|
||||||
while (continuationToken != null) {
|
|
||||||
const result = await this.loadAndParseEvents(start, end, continuationToken);
|
|
||||||
continuationToken = result.continuationToken;
|
|
||||||
events = events.concat(result.events);
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = await this.exportService.getEventExport(events);
|
|
||||||
const fileName = this.exportService.getFileName('org-events', 'csv');
|
|
||||||
this.platformUtilsService.saveFile(window, data, { type: 'text/plain' }, fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
private async loadAndParseEvents(startDate: string, endDate: string, continuationToken: string) {
|
|
||||||
const response = await this.apiService.getEventsOrganization(this.organizationId, startDate, endDate,
|
|
||||||
continuationToken);
|
|
||||||
|
|
||||||
const events = await Promise.all(response.data.map(async r => {
|
|
||||||
const userId = r.actingUserId == null ? r.userId : r.actingUserId;
|
|
||||||
const eventInfo = await this.eventService.getEventInfo(r);
|
|
||||||
const user = userId != null && this.orgUsersUserIdMap.has(userId) ?
|
|
||||||
this.orgUsersUserIdMap.get(userId) : null;
|
|
||||||
return new EventView({
|
|
||||||
message: eventInfo.message,
|
|
||||||
humanReadableMessage: eventInfo.humanReadableMessage,
|
|
||||||
appIcon: eventInfo.appIcon,
|
|
||||||
appName: eventInfo.appName,
|
|
||||||
userId: userId,
|
|
||||||
userName: user != null ? user.name : this.i18nService.t('unknown'),
|
|
||||||
userEmail: user != null ? user.email : '',
|
|
||||||
date: r.date,
|
|
||||||
ip: r.ipAddress,
|
|
||||||
type: r.type,
|
|
||||||
});
|
|
||||||
}));
|
|
||||||
return { continuationToken: response.continuationToken, events: events };
|
|
||||||
}
|
|
||||||
|
|
||||||
private parseDates() {
|
|
||||||
let dates: string[] = null;
|
|
||||||
try {
|
|
||||||
dates = this.eventService.formatDateFilters(this.start, this.end);
|
|
||||||
} catch (e) {
|
|
||||||
this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),
|
|
||||||
this.i18nService.t('invalidDateRange'));
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return dates;
|
|
||||||
|
if (this.orgUsersUserIdMap.has(userId)) {
|
||||||
|
return this.orgUsersUserIdMap.get(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private appApiPromiseUnfulfilled() {
|
if (r.providerId != null && r.providerId === this.organization.providerId) {
|
||||||
return this.refreshPromise != null || this.morePromise != null || this.exportPromise != null;
|
return {
|
||||||
|
'name': this.organization.providerName,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,14 +8,14 @@
|
|||||||
<span class="badge badge-pill badge-info" *ngIf="allCount">{{allCount}}</span>
|
<span class="badge badge-pill badge-info" *ngIf="allCount">{{allCount}}</span>
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-outline-secondary"
|
<button type="button" class="btn btn-outline-secondary"
|
||||||
[ngClass]="{active: status == organizationUserStatusType.Invited}"
|
[ngClass]="{active: status == userStatusType.Invited}"
|
||||||
(click)="filter(organizationUserStatusType.Invited)">
|
(click)="filter(userStatusType.Invited)">
|
||||||
{{'invited' | i18n}}
|
{{'invited' | i18n}}
|
||||||
<span class="badge badge-pill badge-info" *ngIf="invitedCount">{{invitedCount}}</span>
|
<span class="badge badge-pill badge-info" *ngIf="invitedCount">{{invitedCount}}</span>
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-outline-secondary"
|
<button type="button" class="btn btn-outline-secondary"
|
||||||
[ngClass]="{active: status == organizationUserStatusType.Accepted}"
|
[ngClass]="{active: status == userStatusType.Accepted}"
|
||||||
(click)="filter(organizationUserStatusType.Accepted)">
|
(click)="filter(userStatusType.Accepted)">
|
||||||
{{'accepted' | i18n}}
|
{{'accepted' | i18n}}
|
||||||
<span class="badge badge-pill badge-warning" *ngIf="acceptedCount">{{acceptedCount}}</span>
|
<span class="badge badge-pill badge-warning" *ngIf="acceptedCount">{{acceptedCount}}</span>
|
||||||
</button>
|
</button>
|
||||||
@@ -80,15 +80,15 @@
|
|||||||
<input type="checkbox" [(ngModel)]="u.checked" appStopProp>
|
<input type="checkbox" [(ngModel)]="u.checked" appStopProp>
|
||||||
</td>
|
</td>
|
||||||
<td width="30">
|
<td width="30">
|
||||||
<app-avatar [data]="u.name || u.email" [email]="u.email" size="25" [circle]="true"
|
<app-avatar [data]="u | userName" [email]="u.email" size="25" [circle]="true"
|
||||||
[fontSize]="14"></app-avatar>
|
[fontSize]="14"></app-avatar>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="#" appStopClick (click)="edit(u)">{{u.email}}</a>
|
<a href="#" appStopClick (click)="edit(u)">{{u.email}}</a>
|
||||||
<span class="badge badge-secondary"
|
<span class="badge badge-secondary"
|
||||||
*ngIf="u.status === organizationUserStatusType.Invited">{{'invited' | i18n}}</span>
|
*ngIf="u.status === userStatusType.Invited">{{'invited' | i18n}}</span>
|
||||||
<span class="badge badge-warning"
|
<span class="badge badge-warning"
|
||||||
*ngIf="u.status === organizationUserStatusType.Accepted">{{'accepted' | i18n}}</span>
|
*ngIf="u.status === userStatusType.Accepted">{{'accepted' | i18n}}</span>
|
||||||
<small class="text-muted d-block" *ngIf="u.name">{{u.name}}</small>
|
<small class="text-muted d-block" *ngIf="u.name">{{u.name}}</small>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -102,11 +102,11 @@
|
|||||||
</ng-container>
|
</ng-container>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span *ngIf="u.type === organizationUserType.Owner">{{'owner' | i18n}}</span>
|
<span *ngIf="u.type === userType.Owner">{{'owner' | i18n}}</span>
|
||||||
<span *ngIf="u.type === organizationUserType.Admin">{{'admin' | i18n}}</span>
|
<span *ngIf="u.type === userType.Admin">{{'admin' | i18n}}</span>
|
||||||
<span *ngIf="u.type === organizationUserType.Manager">{{'manager' | i18n}}</span>
|
<span *ngIf="u.type === userType.Manager">{{'manager' | i18n}}</span>
|
||||||
<span *ngIf="u.type === organizationUserType.User">{{'user' | i18n}}</span>
|
<span *ngIf="u.type === userType.User">{{'user' | i18n}}</span>
|
||||||
<span *ngIf="u.type === organizationUserType.Custom">{{'custom' | i18n}}</span>
|
<span *ngIf="u.type === userType.Custom">{{'custom' | i18n}}</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="table-list-options">
|
<td class="table-list-options">
|
||||||
<div class="dropdown" appListDropdown>
|
<div class="dropdown" appListDropdown>
|
||||||
@@ -117,12 +117,12 @@
|
|||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu dropdown-menu-right">
|
<div class="dropdown-menu dropdown-menu-right">
|
||||||
<a class="dropdown-item" href="#" appStopClick (click)="reinvite(u)"
|
<a class="dropdown-item" href="#" appStopClick (click)="reinvite(u)"
|
||||||
*ngIf="u.status === organizationUserStatusType.Invited">
|
*ngIf="u.status === userStatusType.Invited">
|
||||||
<i class="fa fa-fw fa-envelope-o" aria-hidden="true"></i>
|
<i class="fa fa-fw fa-envelope-o" aria-hidden="true"></i>
|
||||||
{{'resendInvitation' | i18n}}
|
{{'resendInvitation' | i18n}}
|
||||||
</a>
|
</a>
|
||||||
<a class="dropdown-item text-success" href="#" appStopClick (click)="confirm(u)"
|
<a class="dropdown-item text-success" href="#" appStopClick (click)="confirm(u)"
|
||||||
*ngIf="u.status === organizationUserStatusType.Accepted">
|
*ngIf="u.status === userStatusType.Accepted">
|
||||||
<i class="fa fa-fw fa-check" aria-hidden="true"></i>
|
<i class="fa fa-fw fa-check" aria-hidden="true"></i>
|
||||||
{{'confirm' | i18n}}
|
{{'confirm' | i18n}}
|
||||||
</a>
|
</a>
|
||||||
@@ -131,7 +131,7 @@
|
|||||||
{{'groups' | i18n}}
|
{{'groups' | i18n}}
|
||||||
</a>
|
</a>
|
||||||
<a class="dropdown-item" href="#" appStopClick (click)="events(u)"
|
<a class="dropdown-item" href="#" appStopClick (click)="events(u)"
|
||||||
*ngIf="accessEvents && u.status === organizationUserStatusType.Confirmed">
|
*ngIf="accessEvents && u.status === userStatusType.Confirmed">
|
||||||
<i class="fa fa-fw fa-file-text-o" aria-hidden="true"></i>
|
<i class="fa fa-fw fa-file-text-o" aria-hidden="true"></i>
|
||||||
{{'eventLogs' | i18n}}
|
{{'eventLogs' | i18n}}
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -14,15 +14,16 @@ import {
|
|||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
|
|
||||||
import { ValidationService } from 'jslib-angular/services/validation.service';
|
import { ValidationService } from 'jslib-angular/services/validation.service';
|
||||||
import { ConstantsService } from 'jslib-common/services/constants.service';
|
|
||||||
|
|
||||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||||
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
||||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||||
|
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||||
import { PolicyService } from 'jslib-common/abstractions/policy.service';
|
import { PolicyService } from 'jslib-common/abstractions/policy.service';
|
||||||
import { SearchService } from 'jslib-common/abstractions/search.service';
|
import { SearchService } from 'jslib-common/abstractions/search.service';
|
||||||
import { StorageService } from 'jslib-common/abstractions/storage.service';
|
import { StorageService } from 'jslib-common/abstractions/storage.service';
|
||||||
|
import { SyncService } from 'jslib-common/abstractions/sync.service';
|
||||||
import { UserService } from 'jslib-common/abstractions/user.service';
|
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||||
|
|
||||||
import { OrganizationKeysRequest } from 'jslib-common/models/request/organizationKeysRequest';
|
import { OrganizationKeysRequest } from 'jslib-common/models/request/organizationKeysRequest';
|
||||||
@@ -36,11 +37,12 @@ import { OrganizationUserUserDetailsResponse } from 'jslib-common/models/respons
|
|||||||
import { OrganizationUserStatusType } from 'jslib-common/enums/organizationUserStatusType';
|
import { OrganizationUserStatusType } from 'jslib-common/enums/organizationUserStatusType';
|
||||||
import { OrganizationUserType } from 'jslib-common/enums/organizationUserType';
|
import { OrganizationUserType } from 'jslib-common/enums/organizationUserType';
|
||||||
import { PolicyType } from 'jslib-common/enums/policyType';
|
import { PolicyType } from 'jslib-common/enums/policyType';
|
||||||
|
import { ProviderUserType } from 'jslib-common/enums/providerUserType';
|
||||||
|
|
||||||
import { SearchPipe } from 'jslib-angular/pipes/search.pipe';
|
import { SearchPipe } from 'jslib-angular/pipes/search.pipe';
|
||||||
|
import { UserNamePipe } from 'jslib-angular/pipes/user-name.pipe';
|
||||||
|
|
||||||
import { Utils } from 'jslib-common/misc/utils';
|
import { BasePeopleComponent } from '../../common/base.people.component';
|
||||||
|
|
||||||
import { ModalComponent } from '../../modal.component';
|
import { ModalComponent } from '../../modal.component';
|
||||||
import { BulkConfirmComponent } from './bulk/bulk-confirm.component';
|
import { BulkConfirmComponent } from './bulk/bulk-confirm.component';
|
||||||
import { BulkRemoveComponent } from './bulk/bulk-remove.component';
|
import { BulkRemoveComponent } from './bulk/bulk-remove.component';
|
||||||
@@ -48,16 +50,13 @@ import { BulkStatusComponent } from './bulk/bulk-status.component';
|
|||||||
import { EntityEventsComponent } from './entity-events.component';
|
import { EntityEventsComponent } from './entity-events.component';
|
||||||
import { ResetPasswordComponent } from './reset-password.component';
|
import { ResetPasswordComponent } from './reset-password.component';
|
||||||
import { UserAddEditComponent } from './user-add-edit.component';
|
import { UserAddEditComponent } from './user-add-edit.component';
|
||||||
import { UserConfirmComponent } from './user-confirm.component';
|
|
||||||
import { UserGroupsComponent } from './user-groups.component';
|
import { UserGroupsComponent } from './user-groups.component';
|
||||||
|
|
||||||
const MaxCheckedCount = 500;
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-org-people',
|
selector: 'app-org-people',
|
||||||
templateUrl: 'people.component.html',
|
templateUrl: 'people.component.html',
|
||||||
})
|
})
|
||||||
export class PeopleComponent implements OnInit {
|
export class PeopleComponent extends BasePeopleComponent<OrganizationUserUserDetailsResponse> implements OnInit {
|
||||||
@ViewChild('addEdit', { read: ViewContainerRef, static: true }) addEditModalRef: ViewContainerRef;
|
@ViewChild('addEdit', { read: ViewContainerRef, static: true }) addEditModalRef: ViewContainerRef;
|
||||||
@ViewChild('groupsTemplate', { read: ViewContainerRef, static: true }) groupsModalRef: ViewContainerRef;
|
@ViewChild('groupsTemplate', { read: ViewContainerRef, static: true }) groupsModalRef: ViewContainerRef;
|
||||||
@ViewChild('eventsTemplate', { read: ViewContainerRef, static: true }) eventsModalRef: ViewContainerRef;
|
@ViewChild('eventsTemplate', { read: ViewContainerRef, static: true }) eventsModalRef: ViewContainerRef;
|
||||||
@@ -67,16 +66,11 @@ export class PeopleComponent implements OnInit {
|
|||||||
@ViewChild('bulkConfirmTemplate', { read: ViewContainerRef, static: true }) bulkConfirmModalRef: ViewContainerRef;
|
@ViewChild('bulkConfirmTemplate', { read: ViewContainerRef, static: true }) bulkConfirmModalRef: ViewContainerRef;
|
||||||
@ViewChild('bulkRemoveTemplate', { read: ViewContainerRef, static: true }) bulkRemoveModalRef: ViewContainerRef;
|
@ViewChild('bulkRemoveTemplate', { read: ViewContainerRef, static: true }) bulkRemoveModalRef: ViewContainerRef;
|
||||||
|
|
||||||
loading = true;
|
userType = ProviderUserType;
|
||||||
|
userStatusType = OrganizationUserStatusType;
|
||||||
|
|
||||||
organizationId: string;
|
organizationId: string;
|
||||||
users: OrganizationUserUserDetailsResponse[];
|
|
||||||
pagedUsers: OrganizationUserUserDetailsResponse[];
|
|
||||||
searchText: string;
|
|
||||||
status: OrganizationUserStatusType = null;
|
status: OrganizationUserStatusType = null;
|
||||||
statusMap = new Map<OrganizationUserStatusType, OrganizationUserUserDetailsResponse[]>();
|
|
||||||
organizationUserType = OrganizationUserType;
|
|
||||||
organizationUserStatusType = OrganizationUserStatusType;
|
|
||||||
actionPromise: Promise<any>;
|
|
||||||
accessEvents = false;
|
accessEvents = false;
|
||||||
accessGroups = false;
|
accessGroups = false;
|
||||||
canResetPassword = false; // User permission (admin/custom)
|
canResetPassword = false; // User permission (admin/custom)
|
||||||
@@ -85,20 +79,16 @@ export class PeopleComponent implements OnInit {
|
|||||||
orgResetPasswordPolicyEnabled = false;
|
orgResetPasswordPolicyEnabled = false;
|
||||||
callingUserType: OrganizationUserType = null;
|
callingUserType: OrganizationUserType = null;
|
||||||
|
|
||||||
protected didScroll = false;
|
constructor(apiService: ApiService, private route: ActivatedRoute,
|
||||||
protected pageSize = 100;
|
i18nService: I18nService, componentFactoryResolver: ComponentFactoryResolver,
|
||||||
|
platformUtilsService: PlatformUtilsService, toasterService: ToasterService,
|
||||||
private pagedUsersCount = 0;
|
cryptoService: CryptoService, private userService: UserService, private router: Router,
|
||||||
private modal: ModalComponent = null;
|
storageService: StorageService, searchService: SearchService,
|
||||||
private allUsers: OrganizationUserUserDetailsResponse[];
|
validationService: ValidationService, private policyService: PolicyService,
|
||||||
|
logService: LogService, searchPipe: SearchPipe, userNamePipe: UserNamePipe, private syncService: SyncService) {
|
||||||
constructor(private apiService: ApiService, private route: ActivatedRoute,
|
super(apiService, searchService, i18nService, platformUtilsService, toasterService, cryptoService,
|
||||||
private i18nService: I18nService, private componentFactoryResolver: ComponentFactoryResolver,
|
storageService, validationService, componentFactoryResolver, logService, searchPipe, userNamePipe);
|
||||||
private platformUtilsService: PlatformUtilsService, private toasterService: ToasterService,
|
}
|
||||||
private cryptoService: CryptoService, private userService: UserService, private router: Router,
|
|
||||||
private storageService: StorageService, private searchService: SearchService,
|
|
||||||
private validationService: ValidationService, private policyService: PolicyService,
|
|
||||||
private searchPipe: SearchPipe) { }
|
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this.route.parent.parent.params.subscribe(async params => {
|
this.route.parent.parent.params.subscribe(async params => {
|
||||||
@@ -113,20 +103,20 @@ export class PeopleComponent implements OnInit {
|
|||||||
this.canResetPassword = organization.canManageUsersPassword;
|
this.canResetPassword = organization.canManageUsersPassword;
|
||||||
this.orgUseResetPassword = organization.useResetPassword;
|
this.orgUseResetPassword = organization.useResetPassword;
|
||||||
this.callingUserType = organization.type;
|
this.callingUserType = organization.type;
|
||||||
|
this.orgHasKeys = organization.hasPublicAndPrivateKeys;
|
||||||
|
|
||||||
// Backfill pub/priv key if necessary
|
// Backfill pub/priv key if necessary
|
||||||
if (!organization.hasPublicAndPrivateKeys) {
|
if (this.canResetPassword && !this.orgHasKeys) {
|
||||||
const orgShareKey = await this.cryptoService.getOrgKey(this.organizationId);
|
const orgShareKey = await this.cryptoService.getOrgKey(this.organizationId);
|
||||||
const orgKeys = await this.cryptoService.makeKeyPair(orgShareKey);
|
const orgKeys = await this.cryptoService.makeKeyPair(orgShareKey);
|
||||||
const request = new OrganizationKeysRequest(orgKeys[0], orgKeys[1].encryptedString);
|
const request = new OrganizationKeysRequest(orgKeys[0], orgKeys[1].encryptedString);
|
||||||
const response = await this.apiService.postOrganizationKeys(this.organizationId, request);
|
const response = await this.apiService.postOrganizationKeys(this.organizationId, request);
|
||||||
if (response != null) {
|
if (response != null) {
|
||||||
this.orgHasKeys = response.publicKey != null && response.privateKey != null;
|
this.orgHasKeys = response.publicKey != null && response.privateKey != null;
|
||||||
|
await this.syncService.fullSync(true); // Replace oganizations with new data
|
||||||
} else {
|
} else {
|
||||||
throw new Error(this.i18nService.t('resetPasswordOrgKeysError'));
|
throw new Error(this.i18nService.t('resetPasswordOrgKeysError'));
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
this.orgHasKeys = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.load();
|
await this.load();
|
||||||
@@ -147,21 +137,29 @@ export class PeopleComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async load() {
|
async load() {
|
||||||
const response = await this.apiService.getOrganizationUsers(this.organizationId);
|
|
||||||
this.statusMap.clear();
|
|
||||||
this.allUsers = response.data != null && response.data.length > 0 ? response.data : [];
|
|
||||||
this.allUsers.sort(Utils.getSortFunction(this.i18nService, 'email'));
|
|
||||||
this.allUsers.forEach(u => {
|
|
||||||
if (!this.statusMap.has(u.status)) {
|
|
||||||
this.statusMap.set(u.status, [u]);
|
|
||||||
} else {
|
|
||||||
this.statusMap.get(u.status).push(u);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.filter(this.status);
|
|
||||||
const policies = await this.policyService.getAll(PolicyType.ResetPassword);
|
const policies = await this.policyService.getAll(PolicyType.ResetPassword);
|
||||||
this.orgResetPasswordPolicyEnabled = policies.some(p => p.organizationId === this.organizationId && p.enabled);
|
this.orgResetPasswordPolicyEnabled = policies.some(p => p.organizationId === this.organizationId && p.enabled);
|
||||||
this.loading = false;
|
super.load();
|
||||||
|
}
|
||||||
|
|
||||||
|
getUsers(): Promise<ListResponse<OrganizationUserUserDetailsResponse>> {
|
||||||
|
return this.apiService.getOrganizationUsers(this.organizationId);
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteUser(id: string): Promise<any> {
|
||||||
|
return this.apiService.deleteOrganizationUser(this.organizationId, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
reinviteUser(id: string): Promise<any> {
|
||||||
|
return this.apiService.postOrganizationUserReinvite(this.organizationId, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
async confirmUser(user: OrganizationUserUserDetailsResponse, publicKey: Uint8Array): Promise<any> {
|
||||||
|
const orgKey = await this.cryptoService.getOrgKey(this.organizationId);
|
||||||
|
const key = await this.cryptoService.rsaEncrypt(orgKey.key, publicKey.buffer);
|
||||||
|
const request = new OrganizationUserConfirmRequest();
|
||||||
|
request.key = key.encryptedString;
|
||||||
|
await this.apiService.postOrganizationUserConfirm(this.organizationId, user.id, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
allowResetPassword(orgUser: OrganizationUserUserDetailsResponse): boolean {
|
allowResetPassword(orgUser: OrganizationUserUserDetailsResponse): boolean {
|
||||||
@@ -191,62 +189,6 @@ export class PeopleComponent implements OnInit {
|
|||||||
return this.orgUseResetPassword && orgUser.resetPasswordEnrolled && this.orgResetPasswordPolicyEnabled;
|
return this.orgUseResetPassword && orgUser.resetPasswordEnrolled && this.orgResetPasswordPolicyEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
filter(status: OrganizationUserStatusType) {
|
|
||||||
this.status = status;
|
|
||||||
if (this.status != null) {
|
|
||||||
this.users = this.statusMap.get(this.status);
|
|
||||||
} else {
|
|
||||||
this.users = this.allUsers;
|
|
||||||
}
|
|
||||||
// Reset checkbox selecton
|
|
||||||
this.selectAll(false);
|
|
||||||
this.resetPaging();
|
|
||||||
}
|
|
||||||
|
|
||||||
loadMore() {
|
|
||||||
if (!this.users || this.users.length <= this.pageSize) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const pagedLength = this.pagedUsers.length;
|
|
||||||
let pagedSize = this.pageSize;
|
|
||||||
if (pagedLength === 0 && this.pagedUsersCount > this.pageSize) {
|
|
||||||
pagedSize = this.pagedUsersCount;
|
|
||||||
}
|
|
||||||
if (this.users.length > pagedLength) {
|
|
||||||
this.pagedUsers = this.pagedUsers.concat(this.users.slice(pagedLength, pagedLength + pagedSize));
|
|
||||||
}
|
|
||||||
this.pagedUsersCount = this.pagedUsers.length;
|
|
||||||
this.didScroll = this.pagedUsers.length > this.pageSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
get allCount() {
|
|
||||||
return this.allUsers != null ? this.allUsers.length : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
get invitedCount() {
|
|
||||||
return this.statusMap.has(OrganizationUserStatusType.Invited) ?
|
|
||||||
this.statusMap.get(OrganizationUserStatusType.Invited).length : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
get acceptedCount() {
|
|
||||||
return this.statusMap.has(OrganizationUserStatusType.Accepted) ?
|
|
||||||
this.statusMap.get(OrganizationUserStatusType.Accepted).length : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
get confirmedCount() {
|
|
||||||
return this.statusMap.has(OrganizationUserStatusType.Confirmed) ?
|
|
||||||
this.statusMap.get(OrganizationUserStatusType.Confirmed).length : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
get showConfirmUsers(): boolean {
|
|
||||||
return this.allUsers != null && this.statusMap != null && this.allUsers.length > 1 &&
|
|
||||||
this.confirmedCount > 0 && this.confirmedCount < 3 && this.acceptedCount > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
get showBulkConfirmUsers(): boolean {
|
|
||||||
return this.acceptedCount > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
edit(user: OrganizationUserUserDetailsResponse) {
|
edit(user: OrganizationUserUserDetailsResponse) {
|
||||||
if (this.modal != null) {
|
if (this.modal != null) {
|
||||||
this.modal.close();
|
this.modal.close();
|
||||||
@@ -257,7 +199,7 @@ export class PeopleComponent implements OnInit {
|
|||||||
const childComponent = this.modal.show<UserAddEditComponent>(
|
const childComponent = this.modal.show<UserAddEditComponent>(
|
||||||
UserAddEditComponent, this.addEditModalRef);
|
UserAddEditComponent, this.addEditModalRef);
|
||||||
|
|
||||||
childComponent.name = user != null ? user.name || user.email : null;
|
childComponent.name = this.userNamePipe.transform(user);
|
||||||
childComponent.organizationId = this.organizationId;
|
childComponent.organizationId = this.organizationId;
|
||||||
childComponent.organizationUserId = user != null ? user.id : null;
|
childComponent.organizationUserId = user != null ? user.id : null;
|
||||||
childComponent.onSavedUser.subscribe(() => {
|
childComponent.onSavedUser.subscribe(() => {
|
||||||
@@ -274,10 +216,6 @@ export class PeopleComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
invite() {
|
|
||||||
this.edit(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
groups(user: OrganizationUserUserDetailsResponse) {
|
groups(user: OrganizationUserUserDetailsResponse) {
|
||||||
if (this.modal != null) {
|
if (this.modal != null) {
|
||||||
this.modal.close();
|
this.modal.close();
|
||||||
@@ -288,7 +226,7 @@ export class PeopleComponent implements OnInit {
|
|||||||
const childComponent = this.modal.show<UserGroupsComponent>(
|
const childComponent = this.modal.show<UserGroupsComponent>(
|
||||||
UserGroupsComponent, this.groupsModalRef);
|
UserGroupsComponent, this.groupsModalRef);
|
||||||
|
|
||||||
childComponent.name = user != null ? user.name || user.email : null;
|
childComponent.name = this.userNamePipe.transform(user);
|
||||||
childComponent.organizationId = this.organizationId;
|
childComponent.organizationId = this.organizationId;
|
||||||
childComponent.organizationUserId = user != null ? user.id : null;
|
childComponent.organizationUserId = user != null ? user.id : null;
|
||||||
childComponent.onSavedUser.subscribe(() => {
|
childComponent.onSavedUser.subscribe(() => {
|
||||||
@@ -300,40 +238,6 @@ export class PeopleComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async remove(user: OrganizationUserUserDetailsResponse) {
|
|
||||||
const confirmed = await this.platformUtilsService.showDialog(
|
|
||||||
this.i18nService.t('removeUserConfirmation'), user.name || user.email,
|
|
||||||
this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');
|
|
||||||
if (!confirmed) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.actionPromise = this.apiService.deleteOrganizationUser(this.organizationId, user.id);
|
|
||||||
try {
|
|
||||||
await this.actionPromise;
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('removedUserId', user.name || user.email));
|
|
||||||
this.removeUser(user);
|
|
||||||
} catch (e) {
|
|
||||||
this.validationService.showError(e);
|
|
||||||
}
|
|
||||||
this.actionPromise = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
async reinvite(user: OrganizationUserUserDetailsResponse) {
|
|
||||||
if (this.actionPromise != null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.actionPromise = this.apiService.postOrganizationUserReinvite(this.organizationId, user.id);
|
|
||||||
try {
|
|
||||||
await this.actionPromise;
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('hasBeenReinvited', user.name || user.email));
|
|
||||||
} catch (e) {
|
|
||||||
this.validationService.showError(e);
|
|
||||||
}
|
|
||||||
this.actionPromise = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
async bulkRemove() {
|
async bulkRemove() {
|
||||||
if (this.actionPromise != null) {
|
if (this.actionPromise != null) {
|
||||||
return;
|
return;
|
||||||
@@ -403,80 +307,6 @@ export class PeopleComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async confirm(user: OrganizationUserUserDetailsResponse) {
|
|
||||||
function updateUser(self: PeopleComponent) {
|
|
||||||
user.status = OrganizationUserStatusType.Confirmed;
|
|
||||||
const mapIndex = self.statusMap.get(OrganizationUserStatusType.Accepted).indexOf(user);
|
|
||||||
if (mapIndex > -1) {
|
|
||||||
self.statusMap.get(OrganizationUserStatusType.Accepted).splice(mapIndex, 1);
|
|
||||||
self.statusMap.get(OrganizationUserStatusType.Confirmed).push(user);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const confirmUser = async (publicKey: Uint8Array) => {
|
|
||||||
try {
|
|
||||||
this.actionPromise = this.doConfirmation(user, publicKey);
|
|
||||||
await this.actionPromise;
|
|
||||||
updateUser(this);
|
|
||||||
this.toasterService.popAsync('success', null, this.i18nService.t('hasBeenConfirmed', user.name || user.email));
|
|
||||||
} catch (e) {
|
|
||||||
this.validationService.showError(e);
|
|
||||||
throw e;
|
|
||||||
} finally {
|
|
||||||
this.actionPromise = null;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
if (this.actionPromise != null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const autoConfirm = await this.storageService.get<boolean>(ConstantsService.autoConfirmFingerprints);
|
|
||||||
if (autoConfirm == null || !autoConfirm) {
|
|
||||||
if (this.modal != null) {
|
|
||||||
this.modal.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);
|
|
||||||
this.modal = this.confirmModalRef.createComponent(factory).instance;
|
|
||||||
const childComponent = this.modal.show<UserConfirmComponent>(
|
|
||||||
UserConfirmComponent, this.confirmModalRef);
|
|
||||||
|
|
||||||
childComponent.name = user != null ? user.name || user.email : null;
|
|
||||||
childComponent.organizationId = this.organizationId;
|
|
||||||
childComponent.organizationUserId = user != null ? user.id : null;
|
|
||||||
childComponent.userId = user != null ? user.userId : null;
|
|
||||||
childComponent.onConfirmedUser.subscribe(async (publicKey: Uint8Array) => {
|
|
||||||
try {
|
|
||||||
await confirmUser(publicKey);
|
|
||||||
this.modal.close();
|
|
||||||
} catch (e) {
|
|
||||||
// tslint:disable-next-line
|
|
||||||
console.error('Handled exception:', e);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.modal.onClosed.subscribe(() => {
|
|
||||||
this.modal = null;
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
const publicKeyResponse = await this.apiService.getUserPublicKey(user.userId);
|
|
||||||
const publicKey = Utils.fromB64ToArray(publicKeyResponse.publicKey);
|
|
||||||
try {
|
|
||||||
// tslint:disable-next-line
|
|
||||||
console.log('User\'s fingerprint: ' +
|
|
||||||
(await this.cryptoService.getFingerprint(user.userId, publicKey.buffer)).join('-'));
|
|
||||||
} catch { }
|
|
||||||
await confirmUser(publicKey);
|
|
||||||
} catch (e) {
|
|
||||||
// tslint:disable-next-line
|
|
||||||
console.error('Handled exception:', e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async events(user: OrganizationUserUserDetailsResponse) {
|
async events(user: OrganizationUserUserDetailsResponse) {
|
||||||
if (this.modal != null) {
|
if (this.modal != null) {
|
||||||
this.modal.close();
|
this.modal.close();
|
||||||
@@ -487,7 +317,7 @@ export class PeopleComponent implements OnInit {
|
|||||||
const childComponent = this.modal.show<EntityEventsComponent>(
|
const childComponent = this.modal.show<EntityEventsComponent>(
|
||||||
EntityEventsComponent, this.eventsModalRef);
|
EntityEventsComponent, this.eventsModalRef);
|
||||||
|
|
||||||
childComponent.name = user.name || user.email;
|
childComponent.name = this.userNamePipe.transform(user);
|
||||||
childComponent.organizationId = this.organizationId;
|
childComponent.organizationId = this.organizationId;
|
||||||
childComponent.entityId = user.id;
|
childComponent.entityId = user.id;
|
||||||
childComponent.showUser = false;
|
childComponent.showUser = false;
|
||||||
@@ -498,23 +328,6 @@ export class PeopleComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async resetPaging() {
|
|
||||||
this.pagedUsers = [];
|
|
||||||
this.loadMore();
|
|
||||||
}
|
|
||||||
|
|
||||||
isSearching() {
|
|
||||||
return this.searchService.isSearchable(this.searchText);
|
|
||||||
}
|
|
||||||
|
|
||||||
isPaging() {
|
|
||||||
const searching = this.isSearching();
|
|
||||||
if (searching && this.didScroll) {
|
|
||||||
this.resetPaging();
|
|
||||||
}
|
|
||||||
return !searching && this.users && this.users.length > this.pageSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
async resetPassword(user: OrganizationUserUserDetailsResponse) {
|
async resetPassword(user: OrganizationUserUserDetailsResponse) {
|
||||||
if (this.modal != null) {
|
if (this.modal != null) {
|
||||||
this.modal.close();
|
this.modal.close();
|
||||||
@@ -525,7 +338,7 @@ export class PeopleComponent implements OnInit {
|
|||||||
const childComponent = this.modal.show<ResetPasswordComponent>(
|
const childComponent = this.modal.show<ResetPasswordComponent>(
|
||||||
ResetPasswordComponent, this.resetPasswordModalRef);
|
ResetPasswordComponent, this.resetPasswordModalRef);
|
||||||
|
|
||||||
childComponent.name = user != null ? user.name || user.email : null;
|
childComponent.name = this.userNamePipe.transform(user);
|
||||||
childComponent.email = user != null ? user.email : null;
|
childComponent.email = user != null ? user.email : null;
|
||||||
childComponent.organizationId = this.organizationId;
|
childComponent.organizationId = this.organizationId;
|
||||||
childComponent.id = user != null ? user.id : null;
|
childComponent.id = user != null ? user.id : null;
|
||||||
@@ -540,25 +353,6 @@ export class PeopleComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
checkUser(user: OrganizationUserUserDetailsResponse, select?: boolean) {
|
|
||||||
(user as any).checked = select == null ? !(user as any).checked : select;
|
|
||||||
}
|
|
||||||
|
|
||||||
selectAll(select: boolean) {
|
|
||||||
if (select) {
|
|
||||||
this.selectAll(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
const filteredUsers = this.searchPipe.transform(this.users, this.searchText, 'name', 'email', 'id');
|
|
||||||
|
|
||||||
const selectCount = select && filteredUsers.length > MaxCheckedCount
|
|
||||||
? MaxCheckedCount
|
|
||||||
: filteredUsers.length;
|
|
||||||
for (let i = 0; i < selectCount; i++) {
|
|
||||||
this.checkUser(filteredUsers[i], select);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async showBulkStatus(users: OrganizationUserUserDetailsResponse[], filteredUsers: OrganizationUserUserDetailsResponse[],
|
private async showBulkStatus(users: OrganizationUserUserDetailsResponse[], filteredUsers: OrganizationUserUserDetailsResponse[],
|
||||||
request: Promise<ListResponse<OrganizationUserBulkResponse>>, successfullMessage: string) {
|
request: Promise<ListResponse<OrganizationUserBulkResponse>>, successfullMessage: string) {
|
||||||
|
|
||||||
@@ -609,42 +403,4 @@ export class PeopleComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async doConfirmation(user: OrganizationUserUserDetailsResponse, publicKey: Uint8Array) {
|
|
||||||
const orgKey = await this.cryptoService.getOrgKey(this.organizationId);
|
|
||||||
const key = await this.cryptoService.rsaEncrypt(orgKey.key, publicKey.buffer);
|
|
||||||
const request = new OrganizationUserConfirmRequest();
|
|
||||||
request.key = key.encryptedString;
|
|
||||||
await this.apiService.postOrganizationUserConfirm(this.organizationId, user.id, request);
|
|
||||||
}
|
|
||||||
|
|
||||||
private removeUser(user: OrganizationUserUserDetailsResponse) {
|
|
||||||
let index = this.users.indexOf(user);
|
|
||||||
if (index > -1) {
|
|
||||||
this.users.splice(index, 1);
|
|
||||||
this.resetPaging();
|
|
||||||
}
|
|
||||||
if (this.statusMap.has(OrganizationUserStatusType.Accepted)) {
|
|
||||||
index = this.statusMap.get(OrganizationUserStatusType.Accepted).indexOf(user);
|
|
||||||
if (index > -1) {
|
|
||||||
this.statusMap.get(OrganizationUserStatusType.Accepted).splice(index, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (this.statusMap.has(OrganizationUserStatusType.Invited)) {
|
|
||||||
index = this.statusMap.get(OrganizationUserStatusType.Invited).indexOf(user);
|
|
||||||
if (index > -1) {
|
|
||||||
this.statusMap.get(OrganizationUserStatusType.Invited).splice(index, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (this.statusMap.has(OrganizationUserStatusType.Confirmed)) {
|
|
||||||
index = this.statusMap.get(OrganizationUserStatusType.Confirmed).indexOf(user);
|
|
||||||
if (index > -1) {
|
|
||||||
this.statusMap.get(OrganizationUserStatusType.Confirmed).splice(index, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private getCheckedUsers() {
|
|
||||||
return this.users.filter(u => (u as any).checked);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -149,12 +149,7 @@ export class PoliciesComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Remove when removing deprecation warning
|
// Remove when removing deprecation warning
|
||||||
this.enterpriseUrl = 'https://portal.bitwarden.com';
|
this.enterpriseUrl = this.environmentService.getEnterpriseUrl();
|
||||||
if (this.environmentService.enterpriseUrl != null) {
|
|
||||||
this.enterpriseUrl = this.environmentService.enterpriseUrl;
|
|
||||||
} else if (this.environmentService.baseUrl != null) {
|
|
||||||
this.enterpriseUrl = this.environmentService.baseUrl + '/portal';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async load() {
|
async load() {
|
||||||
|
|||||||
@@ -8,12 +8,9 @@ import {
|
|||||||
|
|
||||||
import { ConstantsService } from 'jslib-common/services/constants.service';
|
import { ConstantsService } from 'jslib-common/services/constants.service';
|
||||||
|
|
||||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
|
||||||
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
||||||
import { StorageService } from 'jslib-common/abstractions/storage.service';
|
import { StorageService } from 'jslib-common/abstractions/storage.service';
|
||||||
|
|
||||||
import { Utils } from 'jslib-common/misc/utils';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-user-confirm',
|
selector: 'app-user-confirm',
|
||||||
templateUrl: 'user-confirm.component.html',
|
templateUrl: 'user-confirm.component.html',
|
||||||
@@ -21,24 +18,18 @@ import { Utils } from 'jslib-common/misc/utils';
|
|||||||
export class UserConfirmComponent implements OnInit {
|
export class UserConfirmComponent implements OnInit {
|
||||||
@Input() name: string;
|
@Input() name: string;
|
||||||
@Input() userId: string;
|
@Input() userId: string;
|
||||||
@Input() organizationUserId: string;
|
@Input() publicKey: Uint8Array;
|
||||||
@Input() organizationId: string;
|
|
||||||
@Output() onConfirmedUser = new EventEmitter();
|
@Output() onConfirmedUser = new EventEmitter();
|
||||||
|
|
||||||
dontAskAgain = false;
|
dontAskAgain = false;
|
||||||
loading = true;
|
loading = true;
|
||||||
fingerprint: string;
|
fingerprint: string;
|
||||||
|
|
||||||
private publicKey: Uint8Array = null;
|
constructor(private cryptoService: CryptoService, private storageService: StorageService) { }
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private cryptoService: CryptoService,
|
|
||||||
private storageService: StorageService) { }
|
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
try {
|
try {
|
||||||
const publicKeyResponse = await this.apiService.getUserPublicKey(this.userId);
|
if (this.publicKey != null) {
|
||||||
if (publicKeyResponse != null) {
|
|
||||||
this.publicKey = Utils.fromB64ToArray(publicKeyResponse.publicKey);
|
|
||||||
const fingerprint = await this.cryptoService.getFingerprint(this.userId, this.publicKey.buffer);
|
const fingerprint = await this.cryptoService.getFingerprint(this.userId, this.publicKey.buffer);
|
||||||
if (fingerprint != null) {
|
if (fingerprint != null) {
|
||||||
this.fingerprint = fingerprint.join('-');
|
this.fingerprint = fingerprint.join('-');
|
||||||
@@ -57,6 +48,6 @@ export class UserConfirmComponent implements OnInit {
|
|||||||
await this.storageService.save(ConstantsService.autoConfirmFingerprints, true);
|
await this.storageService.save(ConstantsService.autoConfirmFingerprints, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.onConfirmedUser.emit(this.publicKey);
|
this.onConfirmedUser.emit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
<i class="fa fa-spinner fa-spin text-muted" title="{{'loading' | i18n}}"></i>
|
<i class="fa fa-spinner fa-spin text-muted" title="{{'loading' | i18n}}"></i>
|
||||||
<span class="sr-only">{{'loading' | i18n}}</span>
|
<span class="sr-only">{{'loading' | i18n}}</span>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container *ngIf="sub">
|
<ng-container *ngIf="sub">
|
||||||
<app-callout type="warning" title="{{'canceled' | i18n}}" *ngIf="subscription && subscription.cancelled">
|
<app-callout type="warning" title="{{'canceled' | i18n}}" *ngIf="subscription && subscription.cancelled">
|
||||||
{{'subscriptionCanceled' | i18n}}</app-callout>
|
{{'subscriptionCanceled' | i18n}}</app-callout>
|
||||||
@@ -150,5 +151,12 @@
|
|||||||
(onCanceled)="closeStorage(false)" *ngIf="showAdjustStorage"></app-adjust-storage>
|
(onCanceled)="closeStorage(false)" *ngIf="showAdjustStorage"></app-adjust-storage>
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
|
<ng-container *ngIf="userOrg?.providerId != null">
|
||||||
|
<div class="secondary-header border-0 mb-0">
|
||||||
|
<h1>{{'provider' | i18n}}</h1>
|
||||||
|
</div>
|
||||||
|
{{'yourProviderIs' | i18n : userOrg.providerName}}
|
||||||
|
</ng-container>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ import {
|
|||||||
OnInit,
|
OnInit,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
import { ToasterService } from 'angular2-toaster';
|
||||||
|
|
||||||
|
import { Organization } from 'jslib-common/models/domain/organization';
|
||||||
import { OrganizationSubscriptionResponse } from 'jslib-common/models/response/organizationSubscriptionResponse';
|
import { OrganizationSubscriptionResponse } from 'jslib-common/models/response/organizationSubscriptionResponse';
|
||||||
|
|
||||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||||
@@ -13,6 +13,7 @@ import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
|||||||
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
|
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
|
||||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||||
|
|
||||||
|
import { UserService } from 'jslib-common/abstractions';
|
||||||
import { PlanType } from 'jslib-common/enums/planType';
|
import { PlanType } from 'jslib-common/enums/planType';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -33,12 +34,15 @@ export class OrganizationSubscriptionComponent implements OnInit {
|
|||||||
sub: OrganizationSubscriptionResponse;
|
sub: OrganizationSubscriptionResponse;
|
||||||
selfHosted = false;
|
selfHosted = false;
|
||||||
|
|
||||||
|
userOrg: Organization;
|
||||||
|
|
||||||
cancelPromise: Promise<any>;
|
cancelPromise: Promise<any>;
|
||||||
reinstatePromise: Promise<any>;
|
reinstatePromise: Promise<any>;
|
||||||
|
|
||||||
constructor(private apiService: ApiService, private platformUtilsService: PlatformUtilsService,
|
constructor(private apiService: ApiService, private platformUtilsService: PlatformUtilsService,
|
||||||
private i18nService: I18nService, private toasterService: ToasterService,
|
private i18nService: I18nService, private toasterService: ToasterService,
|
||||||
private messagingService: MessagingService, private route: ActivatedRoute) {
|
private messagingService: MessagingService, private route: ActivatedRoute,
|
||||||
|
private userService: UserService) {
|
||||||
this.selfHosted = platformUtilsService.isSelfHost();
|
this.selfHosted = platformUtilsService.isSelfHost();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,7 +58,9 @@ export class OrganizationSubscriptionComponent implements OnInit {
|
|||||||
if (this.loading) {
|
if (this.loading) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
this.userOrg = await this.userService.getOrganization(this.organizationId);
|
||||||
this.sub = await this.apiService.getOrganizationSubscription(this.organizationId);
|
this.sub = await this.apiService.getOrganizationSubscription(this.organizationId);
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import { RegisterComponent } from './accounts/register.component';
|
|||||||
import { SetPasswordComponent } from './accounts/set-password.component';
|
import { SetPasswordComponent } from './accounts/set-password.component';
|
||||||
import { SsoComponent } from './accounts/sso.component';
|
import { SsoComponent } from './accounts/sso.component';
|
||||||
import { TwoFactorComponent } from './accounts/two-factor.component';
|
import { TwoFactorComponent } from './accounts/two-factor.component';
|
||||||
|
import { UpdateTempPasswordComponent } from './accounts/update-temp-password.component';
|
||||||
import { VerifyEmailTokenComponent } from './accounts/verify-email-token.component';
|
import { VerifyEmailTokenComponent } from './accounts/verify-email-token.component';
|
||||||
import { VerifyRecoverDeleteComponent } from './accounts/verify-recover-delete.component';
|
import { VerifyRecoverDeleteComponent } from './accounts/verify-recover-delete.component';
|
||||||
|
|
||||||
@@ -163,6 +164,12 @@ const routes: Routes = [
|
|||||||
component: AccessComponent,
|
component: AccessComponent,
|
||||||
data: { title: 'Bitwarden Send' },
|
data: { title: 'Bitwarden Send' },
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'update-temp-password',
|
||||||
|
component: UpdateTempPasswordComponent,
|
||||||
|
canActivate: [AuthGuardService],
|
||||||
|
data: { titleId: 'updateTempPassword' },
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -438,4 +445,4 @@ const routes: Routes = [
|
|||||||
})],
|
})],
|
||||||
exports: [RouterModule],
|
exports: [RouterModule],
|
||||||
})
|
})
|
||||||
export class AppRoutingModule { }
|
export class OssRoutingModule { }
|
||||||
460
src/app/oss.module.ts
Normal file
460
src/app/oss.module.ts
Normal file
@@ -0,0 +1,460 @@
|
|||||||
|
import { DragDropModule } from '@angular/cdk/drag-drop';
|
||||||
|
import {
|
||||||
|
DatePipe,
|
||||||
|
registerLocaleData,
|
||||||
|
} from '@angular/common';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||||
|
import { RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import { ToasterModule } from 'angular2-toaster';
|
||||||
|
import { InfiniteScrollModule } from 'ngx-infinite-scroll';
|
||||||
|
|
||||||
|
import { AppComponent } from './app.component';
|
||||||
|
import { ModalComponent } from './modal.component';
|
||||||
|
|
||||||
|
import { AvatarComponent } from './components/avatar.component';
|
||||||
|
import { PasswordStrengthComponent } from './components/password-strength.component';
|
||||||
|
|
||||||
|
import { FooterComponent } from './layouts/footer.component';
|
||||||
|
import { FrontendLayoutComponent } from './layouts/frontend-layout.component';
|
||||||
|
import { NavbarComponent } from './layouts/navbar.component';
|
||||||
|
import { OrganizationLayoutComponent } from './layouts/organization-layout.component';
|
||||||
|
import { UserLayoutComponent } from './layouts/user-layout.component';
|
||||||
|
|
||||||
|
import { AcceptEmergencyComponent } from './accounts/accept-emergency.component';
|
||||||
|
import { AcceptOrganizationComponent } from './accounts/accept-organization.component';
|
||||||
|
import { HintComponent } from './accounts/hint.component';
|
||||||
|
import { LockComponent } from './accounts/lock.component';
|
||||||
|
import { LoginComponent } from './accounts/login.component';
|
||||||
|
import { RecoverDeleteComponent } from './accounts/recover-delete.component';
|
||||||
|
import { RecoverTwoFactorComponent } from './accounts/recover-two-factor.component';
|
||||||
|
import { RegisterComponent } from './accounts/register.component';
|
||||||
|
import { SetPasswordComponent } from './accounts/set-password.component';
|
||||||
|
import { SsoComponent } from './accounts/sso.component';
|
||||||
|
import { TwoFactorOptionsComponent } from './accounts/two-factor-options.component';
|
||||||
|
import { TwoFactorComponent } from './accounts/two-factor.component';
|
||||||
|
import { UpdateTempPasswordComponent } from './accounts/update-temp-password.component';
|
||||||
|
import { VerifyEmailTokenComponent } from './accounts/verify-email-token.component';
|
||||||
|
import { VerifyRecoverDeleteComponent } from './accounts/verify-recover-delete.component';
|
||||||
|
|
||||||
|
import { BulkConfirmComponent as OrgBulkConfirmComponent } from './organizations/manage/bulk/bulk-confirm.component';
|
||||||
|
import { BulkRemoveComponent as OrgBulkRemoveComponent } from './organizations/manage/bulk/bulk-remove.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';
|
||||||
|
import { EntityEventsComponent as OrgEntityEventsComponent } from './organizations/manage/entity-events.component';
|
||||||
|
import { EntityUsersComponent as OrgEntityUsersComponent } from './organizations/manage/entity-users.component';
|
||||||
|
import { EventsComponent as OrgEventsComponent } from './organizations/manage/events.component';
|
||||||
|
import { GroupAddEditComponent as OrgGroupAddEditComponent } from './organizations/manage/group-add-edit.component';
|
||||||
|
import { GroupsComponent as OrgGroupsComponent } from './organizations/manage/groups.component';
|
||||||
|
import { ManageComponent as OrgManageComponent } from './organizations/manage/manage.component';
|
||||||
|
import { PeopleComponent as OrgPeopleComponent } from './organizations/manage/people.component';
|
||||||
|
import { PoliciesComponent as OrgPoliciesComponent } from './organizations/manage/policies.component';
|
||||||
|
import { PolicyEditComponent as OrgPolicyEditComponent } from './organizations/manage/policy-edit.component';
|
||||||
|
import { ResetPasswordComponent as OrgResetPasswordComponent } from './organizations/manage/reset-password.component';
|
||||||
|
import { UserAddEditComponent as OrgUserAddEditComponent } from './organizations/manage/user-add-edit.component';
|
||||||
|
import { UserConfirmComponent as OrgUserConfirmComponent } from './organizations/manage/user-confirm.component';
|
||||||
|
import { UserGroupsComponent as OrgUserGroupsComponent } from './organizations/manage/user-groups.component';
|
||||||
|
|
||||||
|
import { AccountComponent as OrgAccountComponent } from './organizations/settings/account.component';
|
||||||
|
import { AdjustSeatsComponent } from './organizations/settings/adjust-seats.component';
|
||||||
|
import { ChangePlanComponent } from './organizations/settings/change-plan.component';
|
||||||
|
import { DeleteOrganizationComponent } from './organizations/settings/delete-organization.component';
|
||||||
|
import { DownloadLicenseComponent } from './organizations/settings/download-license.component';
|
||||||
|
import { OrganizationBillingComponent } from './organizations/settings/organization-billing.component';
|
||||||
|
import { OrganizationSubscriptionComponent } from './organizations/settings/organization-subscription.component';
|
||||||
|
import { SettingsComponent as OrgSettingComponent } from './organizations/settings/settings.component';
|
||||||
|
import {
|
||||||
|
TwoFactorSetupComponent as OrgTwoFactorSetupComponent,
|
||||||
|
} from './organizations/settings/two-factor-setup.component';
|
||||||
|
|
||||||
|
import { ExportComponent as OrgExportComponent } from './organizations/tools/export.component';
|
||||||
|
import {
|
||||||
|
ExposedPasswordsReportComponent as OrgExposedPasswordsReportComponent,
|
||||||
|
} from './organizations/tools/exposed-passwords-report.component';
|
||||||
|
import { ImportComponent as OrgImportComponent } from './organizations/tools/import.component';
|
||||||
|
import {
|
||||||
|
InactiveTwoFactorReportComponent as OrgInactiveTwoFactorReportComponent,
|
||||||
|
} from './organizations/tools/inactive-two-factor-report.component';
|
||||||
|
import {
|
||||||
|
ReusedPasswordsReportComponent as OrgReusedPasswordsReportComponent,
|
||||||
|
} from './organizations/tools/reused-passwords-report.component';
|
||||||
|
import { ToolsComponent as OrgToolsComponent } from './organizations/tools/tools.component';
|
||||||
|
import {
|
||||||
|
UnsecuredWebsitesReportComponent as OrgUnsecuredWebsitesReportComponent,
|
||||||
|
} from './organizations/tools/unsecured-websites-report.component';
|
||||||
|
import {
|
||||||
|
WeakPasswordsReportComponent as OrgWeakPasswordsReportComponent,
|
||||||
|
} from './organizations/tools/weak-passwords-report.component';
|
||||||
|
|
||||||
|
import { AddEditComponent as OrgAddEditComponent } from './organizations/vault/add-edit.component';
|
||||||
|
import { AttachmentsComponent as OrgAttachmentsComponent } from './organizations/vault/attachments.component';
|
||||||
|
import { CiphersComponent as OrgCiphersComponent } from './organizations/vault/ciphers.component';
|
||||||
|
import { CollectionsComponent as OrgCollectionsComponent } from './organizations/vault/collections.component';
|
||||||
|
import { GroupingsComponent as OrgGroupingsComponent } from './organizations/vault/groupings.component';
|
||||||
|
import { VaultComponent as OrgVaultComponent } from './organizations/vault/vault.component';
|
||||||
|
|
||||||
|
import { AccessComponent } from './send/access.component';
|
||||||
|
import { AddEditComponent as SendAddEditComponent } from './send/add-edit.component';
|
||||||
|
import { EffluxDatesComponent as SendEffluxDatesComponent } from './send/efflux-dates.component';
|
||||||
|
import { SendComponent } from './send/send.component';
|
||||||
|
|
||||||
|
import { AccountComponent } from './settings/account.component';
|
||||||
|
import { AddCreditComponent } from './settings/add-credit.component';
|
||||||
|
import { AdjustPaymentComponent } from './settings/adjust-payment.component';
|
||||||
|
import { AdjustStorageComponent } from './settings/adjust-storage.component';
|
||||||
|
import { ApiKeyComponent } from './settings/api-key.component';
|
||||||
|
import { ChangeEmailComponent } from './settings/change-email.component';
|
||||||
|
import { ChangeKdfComponent } from './settings/change-kdf.component';
|
||||||
|
import { ChangePasswordComponent } from './settings/change-password.component';
|
||||||
|
import { CreateOrganizationComponent } from './settings/create-organization.component';
|
||||||
|
import { DeauthorizeSessionsComponent } from './settings/deauthorize-sessions.component';
|
||||||
|
import { DeleteAccountComponent } from './settings/delete-account.component';
|
||||||
|
import { DomainRulesComponent } from './settings/domain-rules.component';
|
||||||
|
import { EmergencyAccessAddEditComponent } from './settings/emergency-access-add-edit.component';
|
||||||
|
import { EmergencyAccessAttachmentsComponent } from './settings/emergency-access-attachments.component';
|
||||||
|
import { EmergencyAccessConfirmComponent } from './settings/emergency-access-confirm.component';
|
||||||
|
import { EmergencyAccessTakeoverComponent } from './settings/emergency-access-takeover.component';
|
||||||
|
import { EmergencyAccessViewComponent } from './settings/emergency-access-view.component';
|
||||||
|
import { EmergencyAccessComponent } from './settings/emergency-access.component';
|
||||||
|
import { EmergencyAddEditComponent } from './settings/emergency-add-edit.component';
|
||||||
|
import { LinkSsoComponent } from './settings/link-sso.component';
|
||||||
|
import { OptionsComponent } from './settings/options.component';
|
||||||
|
import { OrganizationPlansComponent } from './settings/organization-plans.component';
|
||||||
|
import { OrganizationsComponent } from './settings/organizations.component';
|
||||||
|
import { PaymentComponent } from './settings/payment.component';
|
||||||
|
import { PremiumComponent } from './settings/premium.component';
|
||||||
|
import { ProfileComponent } from './settings/profile.component';
|
||||||
|
import { PurgeVaultComponent } from './settings/purge-vault.component';
|
||||||
|
import { SettingsComponent } from './settings/settings.component';
|
||||||
|
import { TaxInfoComponent } from './settings/tax-info.component';
|
||||||
|
import { TwoFactorAuthenticatorComponent } from './settings/two-factor-authenticator.component';
|
||||||
|
import { TwoFactorDuoComponent } from './settings/two-factor-duo.component';
|
||||||
|
import { TwoFactorEmailComponent } from './settings/two-factor-email.component';
|
||||||
|
import { TwoFactorRecoveryComponent } from './settings/two-factor-recovery.component';
|
||||||
|
import { TwoFactorSetupComponent } from './settings/two-factor-setup.component';
|
||||||
|
import { TwoFactorVerifyComponent } from './settings/two-factor-verify.component';
|
||||||
|
import { TwoFactorWebAuthnComponent } from './settings/two-factor-webauthn.component';
|
||||||
|
import { TwoFactorYubiKeyComponent } from './settings/two-factor-yubikey.component';
|
||||||
|
import { UpdateKeyComponent } from './settings/update-key.component';
|
||||||
|
import { UpdateLicenseComponent } from './settings/update-license.component';
|
||||||
|
import { UserBillingComponent } from './settings/user-billing.component';
|
||||||
|
import { UserSubscriptionComponent } from './settings/user-subscription.component';
|
||||||
|
import { VerifyEmailComponent } from './settings/verify-email.component';
|
||||||
|
|
||||||
|
import { BreachReportComponent } from './tools/breach-report.component';
|
||||||
|
import { ExportComponent } from './tools/export.component';
|
||||||
|
import { ExposedPasswordsReportComponent } from './tools/exposed-passwords-report.component';
|
||||||
|
import { ImportComponent } from './tools/import.component';
|
||||||
|
import { InactiveTwoFactorReportComponent } from './tools/inactive-two-factor-report.component';
|
||||||
|
import { PasswordGeneratorHistoryComponent } from './tools/password-generator-history.component';
|
||||||
|
import { PasswordGeneratorComponent } from './tools/password-generator.component';
|
||||||
|
import { ReusedPasswordsReportComponent } from './tools/reused-passwords-report.component';
|
||||||
|
import { ToolsComponent } from './tools/tools.component';
|
||||||
|
import { UnsecuredWebsitesReportComponent } from './tools/unsecured-websites-report.component';
|
||||||
|
import { WeakPasswordsReportComponent } from './tools/weak-passwords-report.component';
|
||||||
|
|
||||||
|
import { AddEditComponent } from './vault/add-edit.component';
|
||||||
|
import { AttachmentsComponent } from './vault/attachments.component';
|
||||||
|
import { BulkActionsComponent } from './vault/bulk-actions.component';
|
||||||
|
import { BulkDeleteComponent } from './vault/bulk-delete.component';
|
||||||
|
import { BulkMoveComponent } from './vault/bulk-move.component';
|
||||||
|
import { BulkRestoreComponent } from './vault/bulk-restore.component';
|
||||||
|
import { BulkShareComponent } from './vault/bulk-share.component';
|
||||||
|
import { CiphersComponent } from './vault/ciphers.component';
|
||||||
|
import { CollectionsComponent } from './vault/collections.component';
|
||||||
|
import { FolderAddEditComponent } from './vault/folder-add-edit.component';
|
||||||
|
import { GroupingsComponent } from './vault/groupings.component';
|
||||||
|
import { ShareComponent } from './vault/share.component';
|
||||||
|
import { VaultComponent } from './vault/vault.component';
|
||||||
|
|
||||||
|
import { ProvidersComponent } from './providers/providers.component';
|
||||||
|
|
||||||
|
import { CalloutComponent } from 'jslib-angular/components/callout.component';
|
||||||
|
import { IconComponent } from 'jslib-angular/components/icon.component';
|
||||||
|
|
||||||
|
import { A11yTitleDirective } from 'jslib-angular/directives/a11y-title.directive';
|
||||||
|
import { ApiActionDirective } from 'jslib-angular/directives/api-action.directive';
|
||||||
|
import { AutofocusDirective } from 'jslib-angular/directives/autofocus.directive';
|
||||||
|
import { BlurClickDirective } from 'jslib-angular/directives/blur-click.directive';
|
||||||
|
import { BoxRowDirective } from 'jslib-angular/directives/box-row.directive';
|
||||||
|
import { FallbackSrcDirective } from 'jslib-angular/directives/fallback-src.directive';
|
||||||
|
import { InputVerbatimDirective } from 'jslib-angular/directives/input-verbatim.directive';
|
||||||
|
import { SelectCopyDirective } from 'jslib-angular/directives/select-copy.directive';
|
||||||
|
import { StopClickDirective } from 'jslib-angular/directives/stop-click.directive';
|
||||||
|
import { StopPropDirective } from 'jslib-angular/directives/stop-prop.directive';
|
||||||
|
import { TrueFalseValueDirective } from 'jslib-angular/directives/true-false-value.directive';
|
||||||
|
|
||||||
|
import { ColorPasswordPipe } from 'jslib-angular/pipes/color-password.pipe';
|
||||||
|
import { I18nPipe } from 'jslib-angular/pipes/i18n.pipe';
|
||||||
|
import { SearchCiphersPipe } from 'jslib-angular/pipes/search-ciphers.pipe';
|
||||||
|
import { SearchPipe } from 'jslib-angular/pipes/search.pipe';
|
||||||
|
import { UserNamePipe } from 'jslib-angular/pipes/user-name.pipe';
|
||||||
|
|
||||||
|
import localeAz from '@angular/common/locales/az';
|
||||||
|
import localeBg from '@angular/common/locales/bg';
|
||||||
|
import localeCa from '@angular/common/locales/ca';
|
||||||
|
import localeCs from '@angular/common/locales/cs';
|
||||||
|
import localeDa from '@angular/common/locales/da';
|
||||||
|
import localeDe from '@angular/common/locales/de';
|
||||||
|
import localeEl from '@angular/common/locales/el';
|
||||||
|
import localeEnGb from '@angular/common/locales/en-GB';
|
||||||
|
import localeEnIn from '@angular/common/locales/en-IN';
|
||||||
|
import localeEo from '@angular/common/locales/eo';
|
||||||
|
import localeEs from '@angular/common/locales/es';
|
||||||
|
import localeEt from '@angular/common/locales/et';
|
||||||
|
import localeFi from '@angular/common/locales/fi';
|
||||||
|
import localeFr from '@angular/common/locales/fr';
|
||||||
|
import localeHe from '@angular/common/locales/he';
|
||||||
|
import localeHr from '@angular/common/locales/hr';
|
||||||
|
import localeHu from '@angular/common/locales/hu';
|
||||||
|
import localeId from '@angular/common/locales/id';
|
||||||
|
import localeIt from '@angular/common/locales/it';
|
||||||
|
import localeJa from '@angular/common/locales/ja';
|
||||||
|
import localeKn from '@angular/common/locales/kn';
|
||||||
|
import localeKo from '@angular/common/locales/ko';
|
||||||
|
import localeLv from '@angular/common/locales/lv';
|
||||||
|
import localeMl from '@angular/common/locales/ml';
|
||||||
|
import localeNb from '@angular/common/locales/nb';
|
||||||
|
import localeNl from '@angular/common/locales/nl';
|
||||||
|
import localePl from '@angular/common/locales/pl';
|
||||||
|
import localePtBr from '@angular/common/locales/pt';
|
||||||
|
import localePtPt from '@angular/common/locales/pt-PT';
|
||||||
|
import localeRo from '@angular/common/locales/ro';
|
||||||
|
import localeRu from '@angular/common/locales/ru';
|
||||||
|
import localeSk from '@angular/common/locales/sk';
|
||||||
|
import localeSr from '@angular/common/locales/sr';
|
||||||
|
import localeSv from '@angular/common/locales/sv';
|
||||||
|
import localeTr from '@angular/common/locales/tr';
|
||||||
|
import localeUk from '@angular/common/locales/uk';
|
||||||
|
import localeZhCn from '@angular/common/locales/zh-Hans';
|
||||||
|
import localeZhTw from '@angular/common/locales/zh-Hant';
|
||||||
|
|
||||||
|
registerLocaleData(localeAz, 'az');
|
||||||
|
registerLocaleData(localeBg, 'bg');
|
||||||
|
registerLocaleData(localeCa, 'ca');
|
||||||
|
registerLocaleData(localeCs, 'cs');
|
||||||
|
registerLocaleData(localeDa, 'da');
|
||||||
|
registerLocaleData(localeDe, 'de');
|
||||||
|
registerLocaleData(localeEl, 'el');
|
||||||
|
registerLocaleData(localeEnGb, 'en-GB');
|
||||||
|
registerLocaleData(localeEnIn, 'en-IN');
|
||||||
|
registerLocaleData(localeEs, 'es');
|
||||||
|
registerLocaleData(localeEt, 'et');
|
||||||
|
registerLocaleData(localeEo, 'eo');
|
||||||
|
registerLocaleData(localeFi, 'fi');
|
||||||
|
registerLocaleData(localeFr, 'fr');
|
||||||
|
registerLocaleData(localeHe, 'he');
|
||||||
|
registerLocaleData(localeHr, 'hr');
|
||||||
|
registerLocaleData(localeHu, 'hu');
|
||||||
|
registerLocaleData(localeId, 'id');
|
||||||
|
registerLocaleData(localeIt, 'it');
|
||||||
|
registerLocaleData(localeJa, 'ja');
|
||||||
|
registerLocaleData(localeKn, 'kn');
|
||||||
|
registerLocaleData(localeKo, 'ko');
|
||||||
|
registerLocaleData(localeLv, 'lv');
|
||||||
|
registerLocaleData(localeMl, 'ml');
|
||||||
|
registerLocaleData(localeNb, 'nb');
|
||||||
|
registerLocaleData(localeNl, 'nl');
|
||||||
|
registerLocaleData(localePl, 'pl');
|
||||||
|
registerLocaleData(localePtBr, 'pt-BR');
|
||||||
|
registerLocaleData(localePtPt, 'pt-PT');
|
||||||
|
registerLocaleData(localeRo, 'ro');
|
||||||
|
registerLocaleData(localeRu, 'ru');
|
||||||
|
registerLocaleData(localeSk, 'sk');
|
||||||
|
registerLocaleData(localeSr, 'sr');
|
||||||
|
registerLocaleData(localeSv, 'sv');
|
||||||
|
registerLocaleData(localeTr, 'tr');
|
||||||
|
registerLocaleData(localeUk, 'uk');
|
||||||
|
registerLocaleData(localeZhCn, 'zh-CN');
|
||||||
|
registerLocaleData(localeZhTw, 'zh-TW');
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
FormsModule,
|
||||||
|
InfiniteScrollModule,
|
||||||
|
DragDropModule,
|
||||||
|
ToasterModule.forChild(),
|
||||||
|
ReactiveFormsModule,
|
||||||
|
RouterModule,
|
||||||
|
],
|
||||||
|
declarations: [
|
||||||
|
A11yTitleDirective,
|
||||||
|
AcceptEmergencyComponent,
|
||||||
|
AccessComponent,
|
||||||
|
AcceptOrganizationComponent,
|
||||||
|
AccountComponent,
|
||||||
|
SetPasswordComponent,
|
||||||
|
AddCreditComponent,
|
||||||
|
AddEditComponent,
|
||||||
|
AdjustPaymentComponent,
|
||||||
|
AdjustSeatsComponent,
|
||||||
|
AdjustStorageComponent,
|
||||||
|
ApiActionDirective,
|
||||||
|
ApiKeyComponent,
|
||||||
|
AppComponent,
|
||||||
|
AttachmentsComponent,
|
||||||
|
AutofocusDirective,
|
||||||
|
AvatarComponent,
|
||||||
|
BlurClickDirective,
|
||||||
|
BoxRowDirective,
|
||||||
|
BreachReportComponent,
|
||||||
|
BulkActionsComponent,
|
||||||
|
BulkDeleteComponent,
|
||||||
|
BulkMoveComponent,
|
||||||
|
BulkRestoreComponent,
|
||||||
|
BulkShareComponent,
|
||||||
|
CalloutComponent,
|
||||||
|
ChangeEmailComponent,
|
||||||
|
ChangeKdfComponent,
|
||||||
|
ChangePasswordComponent,
|
||||||
|
ChangePlanComponent,
|
||||||
|
CiphersComponent,
|
||||||
|
CollectionsComponent,
|
||||||
|
ColorPasswordPipe,
|
||||||
|
CreateOrganizationComponent,
|
||||||
|
DeauthorizeSessionsComponent,
|
||||||
|
DeleteAccountComponent,
|
||||||
|
DeleteOrganizationComponent,
|
||||||
|
DomainRulesComponent,
|
||||||
|
DownloadLicenseComponent,
|
||||||
|
EmergencyAccessAddEditComponent,
|
||||||
|
EmergencyAccessAttachmentsComponent,
|
||||||
|
EmergencyAccessComponent,
|
||||||
|
EmergencyAccessConfirmComponent,
|
||||||
|
EmergencyAccessTakeoverComponent,
|
||||||
|
EmergencyAccessViewComponent,
|
||||||
|
EmergencyAddEditComponent,
|
||||||
|
ExportComponent,
|
||||||
|
ExposedPasswordsReportComponent,
|
||||||
|
FallbackSrcDirective,
|
||||||
|
FolderAddEditComponent,
|
||||||
|
FooterComponent,
|
||||||
|
FrontendLayoutComponent,
|
||||||
|
GroupingsComponent,
|
||||||
|
HintComponent,
|
||||||
|
I18nPipe,
|
||||||
|
IconComponent,
|
||||||
|
ImportComponent,
|
||||||
|
InactiveTwoFactorReportComponent,
|
||||||
|
InputVerbatimDirective,
|
||||||
|
LinkSsoComponent,
|
||||||
|
LockComponent,
|
||||||
|
LoginComponent,
|
||||||
|
ModalComponent,
|
||||||
|
NavbarComponent,
|
||||||
|
OptionsComponent,
|
||||||
|
OrgAccountComponent,
|
||||||
|
OrgAddEditComponent,
|
||||||
|
OrganizationBillingComponent,
|
||||||
|
OrganizationPlansComponent,
|
||||||
|
OrganizationSubscriptionComponent,
|
||||||
|
OrgAttachmentsComponent,
|
||||||
|
OrgBulkStatusComponent,
|
||||||
|
OrgBulkConfirmComponent,
|
||||||
|
OrgBulkRemoveComponent,
|
||||||
|
OrgCiphersComponent,
|
||||||
|
OrgCollectionAddEditComponent,
|
||||||
|
OrgCollectionsComponent,
|
||||||
|
OrgEntityEventsComponent,
|
||||||
|
OrgEntityUsersComponent,
|
||||||
|
OrgEventsComponent,
|
||||||
|
OrgExportComponent,
|
||||||
|
OrgExposedPasswordsReportComponent,
|
||||||
|
OrgImportComponent,
|
||||||
|
OrgInactiveTwoFactorReportComponent,
|
||||||
|
OrgGroupAddEditComponent,
|
||||||
|
OrgGroupingsComponent,
|
||||||
|
OrgGroupsComponent,
|
||||||
|
OrgManageCollectionsComponent,
|
||||||
|
OrgManageComponent,
|
||||||
|
OrgPeopleComponent,
|
||||||
|
OrgPolicyEditComponent,
|
||||||
|
OrgPoliciesComponent,
|
||||||
|
OrgResetPasswordComponent,
|
||||||
|
OrgReusedPasswordsReportComponent,
|
||||||
|
OrgSettingComponent,
|
||||||
|
OrgToolsComponent,
|
||||||
|
OrgTwoFactorSetupComponent,
|
||||||
|
OrgUserAddEditComponent,
|
||||||
|
OrgUserConfirmComponent,
|
||||||
|
OrgUserGroupsComponent,
|
||||||
|
OrganizationsComponent,
|
||||||
|
OrganizationLayoutComponent,
|
||||||
|
OrgUnsecuredWebsitesReportComponent,
|
||||||
|
OrgVaultComponent,
|
||||||
|
OrgWeakPasswordsReportComponent,
|
||||||
|
PasswordGeneratorComponent,
|
||||||
|
PasswordGeneratorHistoryComponent,
|
||||||
|
PasswordStrengthComponent,
|
||||||
|
PaymentComponent,
|
||||||
|
PremiumComponent,
|
||||||
|
ProfileComponent,
|
||||||
|
PurgeVaultComponent,
|
||||||
|
RecoverDeleteComponent,
|
||||||
|
RecoverTwoFactorComponent,
|
||||||
|
RegisterComponent,
|
||||||
|
ReusedPasswordsReportComponent,
|
||||||
|
SearchCiphersPipe,
|
||||||
|
SearchPipe,
|
||||||
|
SelectCopyDirective,
|
||||||
|
SendAddEditComponent,
|
||||||
|
SendEffluxDatesComponent,
|
||||||
|
SendComponent,
|
||||||
|
SettingsComponent,
|
||||||
|
ShareComponent,
|
||||||
|
SsoComponent,
|
||||||
|
StopClickDirective,
|
||||||
|
StopPropDirective,
|
||||||
|
TaxInfoComponent,
|
||||||
|
ToolsComponent,
|
||||||
|
TrueFalseValueDirective,
|
||||||
|
TwoFactorAuthenticatorComponent,
|
||||||
|
TwoFactorComponent,
|
||||||
|
TwoFactorDuoComponent,
|
||||||
|
TwoFactorEmailComponent,
|
||||||
|
TwoFactorOptionsComponent,
|
||||||
|
TwoFactorRecoveryComponent,
|
||||||
|
TwoFactorSetupComponent,
|
||||||
|
TwoFactorVerifyComponent,
|
||||||
|
TwoFactorWebAuthnComponent,
|
||||||
|
TwoFactorYubiKeyComponent,
|
||||||
|
UnsecuredWebsitesReportComponent,
|
||||||
|
UpdateKeyComponent,
|
||||||
|
UpdateLicenseComponent,
|
||||||
|
UpdateTempPasswordComponent,
|
||||||
|
UserBillingComponent,
|
||||||
|
UserLayoutComponent,
|
||||||
|
UserSubscriptionComponent,
|
||||||
|
UserNamePipe,
|
||||||
|
VaultComponent,
|
||||||
|
VerifyEmailComponent,
|
||||||
|
VerifyEmailTokenComponent,
|
||||||
|
VerifyRecoverDeleteComponent,
|
||||||
|
WeakPasswordsReportComponent,
|
||||||
|
ProvidersComponent,
|
||||||
|
],
|
||||||
|
exports: [
|
||||||
|
A11yTitleDirective,
|
||||||
|
AvatarComponent,
|
||||||
|
CalloutComponent,
|
||||||
|
ApiActionDirective,
|
||||||
|
StopClickDirective,
|
||||||
|
StopPropDirective,
|
||||||
|
I18nPipe,
|
||||||
|
SearchPipe,
|
||||||
|
UserNamePipe,
|
||||||
|
ModalComponent,
|
||||||
|
NavbarComponent,
|
||||||
|
FooterComponent,
|
||||||
|
OrganizationPlansComponent,
|
||||||
|
],
|
||||||
|
providers: [DatePipe, SearchPipe, UserNamePipe],
|
||||||
|
bootstrap: [],
|
||||||
|
})
|
||||||
|
export class OssModule { }
|
||||||
@@ -7,7 +7,7 @@ if (!Element.prototype.matches && (Element.prototype as any).msMatchesSelector)
|
|||||||
Element.prototype.matches = (Element.prototype as any).msMatchesSelector;
|
Element.prototype.matches = (Element.prototype as any).msMatchesSelector;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.env.ENV === 'production') {
|
if (process.env.NODE_ENV === 'production') {
|
||||||
// Production
|
// Production
|
||||||
} else {
|
} else {
|
||||||
// Development and test
|
// Development and test
|
||||||
|
|||||||
52
src/app/providers/providers.component.html
Normal file
52
src/app/providers/providers.component.html
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
<ng-container *ngIf="vault">
|
||||||
|
<p *ngIf="!loaded" class="text-muted">
|
||||||
|
<i class="fa fa-spinner fa-spin" title="{{'loading' | i18n}}" aria-hidden="true"></i>
|
||||||
|
<span class="sr-only">{{'loading' | i18n}}</span>
|
||||||
|
</p>
|
||||||
|
<ng-container *ngIf="loaded">
|
||||||
|
<ul class="fa-ul card-ul carets" *ngIf="providers && providers.length">
|
||||||
|
<li *ngFor="let p of providers">
|
||||||
|
<a [routerLink]="['/providers', p.id]" class="text-body">
|
||||||
|
<i class="fa-li fa fa-caret-right" aria-hidden="true"></i> {{p.name}}
|
||||||
|
<ng-container *ngIf="!p.enabled">
|
||||||
|
<i class="fa fa-exclamation-triangle text-danger" title="{{'providerIsDisabled' | i18n}}"
|
||||||
|
aria-hidden="true"></i>
|
||||||
|
<span class="sr-only">{{'providerIsDisabled' | i18n}}</span>
|
||||||
|
</ng-container>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</ng-container>
|
||||||
|
</ng-container>
|
||||||
|
<ng-container *ngIf="!vault">
|
||||||
|
<app-navbar></app-navbar>
|
||||||
|
<div class="container page-content">
|
||||||
|
<div class="page-header d-flex">
|
||||||
|
<h1>{{'providers' | i18n}}</h1>
|
||||||
|
</div>
|
||||||
|
<p *ngIf="!loaded" class="text-muted">
|
||||||
|
<i class="fa fa-spinner fa-spin" title="{{'loading' | i18n}}" aria-hidden="true"></i>
|
||||||
|
<span class="sr-only">{{'loading' | i18n}}</span>
|
||||||
|
</p>
|
||||||
|
<ng-container *ngIf="loaded">
|
||||||
|
<table class="table table-hover table-list" *ngIf="providers && providers.length">
|
||||||
|
<tbody>
|
||||||
|
<tr *ngFor="let p of providers">
|
||||||
|
<td width="30">
|
||||||
|
<app-avatar [data]="p.name" size="25" [circle]="true" [fontSize]="14"></app-avatar>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="#" [routerLink]="['/providers', p.id]">{{p.name}}</a>
|
||||||
|
<ng-container *ngIf="!p.enabled">
|
||||||
|
<i class="fa fa-exclamation-triangle text-danger"
|
||||||
|
title="{{'providerIsDisabled' | i18n}}" aria-hidden="true"></i>
|
||||||
|
<span class="sr-only">{{'providerIsDisabled' | i18n}}</span>
|
||||||
|
</ng-container>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
<app-footer></app-footer>
|
||||||
|
</ng-container>
|
||||||
38
src/app/providers/providers.component.ts
Normal file
38
src/app/providers/providers.component.ts
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
import {
|
||||||
|
Component,
|
||||||
|
Input,
|
||||||
|
OnInit,
|
||||||
|
} from '@angular/core';
|
||||||
|
|
||||||
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||||
|
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||||
|
|
||||||
|
import { Provider } from 'jslib-common/models/domain/provider';
|
||||||
|
|
||||||
|
import { Utils } from 'jslib-common/misc/utils';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-providers',
|
||||||
|
templateUrl: 'providers.component.html',
|
||||||
|
})
|
||||||
|
export class ProvidersComponent implements OnInit {
|
||||||
|
@Input() vault = false;
|
||||||
|
|
||||||
|
providers: Provider[];
|
||||||
|
loaded: boolean = false;
|
||||||
|
actionPromise: Promise<any>;
|
||||||
|
|
||||||
|
constructor(private userService: UserService, private i18nService: I18nService) { }
|
||||||
|
|
||||||
|
async ngOnInit() {
|
||||||
|
document.body.classList.remove('layout_frontend');
|
||||||
|
await this.load();
|
||||||
|
}
|
||||||
|
|
||||||
|
async load() {
|
||||||
|
const providers = await this.userService.getAllProviders();
|
||||||
|
providers.sort(Utils.getSortFunction(this.i18nService, 'name'));
|
||||||
|
this.providers = providers;
|
||||||
|
this.loaded = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -92,89 +92,10 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div id="options" [hidden]="!showOptions">
|
<div id="options" [hidden]="!showOptions">
|
||||||
<div class="row">
|
<app-send-efflux-dates
|
||||||
<div class="col-6 form-group">
|
[initialDeletionDate]="send.deletionDate" [initialExpirationDate]="send.expirationDate"
|
||||||
<label for="deletionDate">{{'deletionDate' | i18n}}</label>
|
[editMode]="editMode" [disabled]="disableSend" (datesChanged)="setDates($event)">
|
||||||
<ng-template #deletionDateCustom>
|
</app-send-efflux-dates>
|
||||||
<ng-container *ngIf="isDateTimeLocalSupported">
|
|
||||||
<input id="deletionDateCustom" class="form-control mt-1" type="datetime-local"
|
|
||||||
name="DeletionDate" [(ngModel)]="deletionDate" required
|
|
||||||
placeholder="MM/DD/YYYY HH:MM AM/PM" [readOnly]="disableSend">
|
|
||||||
</ng-container>
|
|
||||||
<div *ngIf="!isDateTimeLocalSupported" class="d-flex justify-content-around">
|
|
||||||
<input id="deletionDateCustomFallback" class="form-control mt-1" type="date"
|
|
||||||
name="DeletionDateFallback" [(ngModel)]="deletionDateFallback" required
|
|
||||||
placeholder="MM/DD/YYYY" [readOnly]="disableSend" data-date-format="mm/dd/yyyy">
|
|
||||||
<select *ngIf="isSafari" id="deletionTimeCustomFallback" class="form-control mt-1 ml-1" [required]="!editMode"
|
|
||||||
[(ngModel)]="safariDeletionTime" name="SafariDeletionTime">
|
|
||||||
<option *ngFor="let o of safariDeletionTimeOptions" [value]="o.military">{{o.standard}}</option>
|
|
||||||
</select>
|
|
||||||
<input *ngIf="!isSafari" id="deletionTimeCustomFallback" class="form-control mt-1 ml-1" type="time"
|
|
||||||
name="DeletionTimeDate" [(ngModel)]="deletionTimeFallback" required
|
|
||||||
placeholder="HH:MM AM/PM" [readOnly]="disableSend">
|
|
||||||
</div>
|
|
||||||
</ng-template>
|
|
||||||
<div *ngIf="!editMode">
|
|
||||||
<select id="deletionDate" name="DeletionDateSelect" [(ngModel)]="deletionDateSelect"
|
|
||||||
class="form-control" required>
|
|
||||||
<option *ngFor="let o of deletionDateOptions" [ngValue]="o.value">{{o.name}}
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
<ng-container *ngIf="deletionDateSelect === 0">
|
|
||||||
<ng-container *ngTemplateOutlet="deletionDateCustom">
|
|
||||||
</ng-container>
|
|
||||||
</ng-container>
|
|
||||||
</div>
|
|
||||||
<div *ngIf="editMode">
|
|
||||||
<ng-container *ngTemplateOutlet="deletionDateCustom">
|
|
||||||
</ng-container>
|
|
||||||
</div>
|
|
||||||
<div class="form-text text-muted small">{{'deletionDateDesc' | i18n}}</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-6 form-group">
|
|
||||||
<div class="d-flex">
|
|
||||||
<label for="expirationDate">{{'expirationDate' | i18n}}</label>
|
|
||||||
<a href="#" appStopClick (click)="clearExpiration()" class="ml-auto"
|
|
||||||
*ngIf="editMode && !disableSend">
|
|
||||||
{{'clear' | i18n}}
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<ng-template #expirationDateCustom>
|
|
||||||
<ng-container *ngIf="isDateTimeLocalSupported">
|
|
||||||
<input id="expirationDateCustom" class="form-control mt-1" type="datetime-local"
|
|
||||||
name="ExpirationDate" [(ngModel)]="expirationDate" placeholder="MM/DD/YYYY HH:MM AM/PM" [readOnly]="disableSend">
|
|
||||||
</ng-container>
|
|
||||||
<div class="d-flex justify-content-around" *ngIf="!isDateTimeLocalSupported">
|
|
||||||
<input id="expirationDateCustomFallback" class="form-control mt-1" type="date"
|
|
||||||
name="ExpirationDateFallback" [(ngModel)]="expirationDateFallback" [required]="!editMode"
|
|
||||||
placeholder="MM/DD/YYYY" [readOnly]="disableSend" data-date-format="mm/dd/yyyy" (change)="expirationDateFallbackChanged()">
|
|
||||||
<select *ngIf="isSafari" id="expirationTimeCustomFallback" class="form-control mt-1 ml-1" [required]="!editMode"
|
|
||||||
[(ngModel)]="safariExpirationTime" name="SafariExpirationTime">
|
|
||||||
<option *ngFor="let o of safariExpirationTimeOptions" [ngValue]="o.military">{{o.standard}}</option>
|
|
||||||
</select>
|
|
||||||
<input *ngIf="!isSafari" id="expirationTimeCustomFallback" class="form-control mt-1 ml-1" type="time"
|
|
||||||
name="ExpirationTimeFallback" [(ngModel)]="expirationTimeFallback" [required]="!editMode"
|
|
||||||
placeholder="HH:MM AM/PM" [readOnly]="disableSend">
|
|
||||||
</div>
|
|
||||||
</ng-template>
|
|
||||||
<div *ngIf="!editMode">
|
|
||||||
<select id="expirationDate" name="ExpirationDateSelect"
|
|
||||||
[(ngModel)]="expirationDateSelect" class="form-control" required>
|
|
||||||
<option *ngFor="let o of expirationDateOptions" [ngValue]="o.value">{{o.name}}
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
<ng-container *ngIf="expirationDateSelect === 0">
|
|
||||||
<ng-container *ngTemplateOutlet="expirationDateCustom">
|
|
||||||
</ng-container>
|
|
||||||
</ng-container>
|
|
||||||
</div>
|
|
||||||
<div *ngIf="editMode">
|
|
||||||
<ng-container *ngTemplateOutlet="expirationDateCustom">
|
|
||||||
</ng-container>
|
|
||||||
</div>
|
|
||||||
<div class="form-text text-muted small">{{'expirationDateDesc' | i18n}}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-6 form-group">
|
<div class="col-6 form-group">
|
||||||
<label for="maxAccessCount">{{'maxAccessCount' | i18n}}</label>
|
<label for="maxAccessCount">{{'maxAccessCount' | i18n}}</label>
|
||||||
|
|||||||
103
src/app/send/efflux-dates.component.html
Normal file
103
src/app/send/efflux-dates.component.html
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
<div class="row" [formGroup]="datesForm">
|
||||||
|
<div class="col-6 form-group">
|
||||||
|
<label for="deletionDate">{{'deletionDate' | i18n}}</label>
|
||||||
|
<ng-template #deletionDateCustom>
|
||||||
|
<ng-container [ngSwitch]="browserPath">
|
||||||
|
<ng-container *ngSwitchCase="'firefox'">
|
||||||
|
<div class="d-flex justify-content-around">
|
||||||
|
<input id="deletionDateCustomFallback" class="form-control mt-1" type="date"
|
||||||
|
name="DeletionDateFallback" formControlName="fallbackDeletionDate" required
|
||||||
|
placeholder="MM/DD/YYYY" [readOnly]="disableSend" data-date-format="mm/dd/yyyy">
|
||||||
|
<input id="deletionTimeCustomFallback" class="form-control mt-1 ml-1" type="time"
|
||||||
|
name="DeletionTimeDate" formControlName="fallbackDeletionTime" required
|
||||||
|
placeholder="HH:MM AM/PM" [readOnly]="disableSend">
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
<ng-container *ngSwitchCase="'safari'">
|
||||||
|
<div class="d-flex justify-content-around">
|
||||||
|
<input id="deletionDateCustomFallback" class="form-control mt-1" type="date"
|
||||||
|
name="DeletionDateFallback" formControlName="fallbackDeletionDate" required
|
||||||
|
placeholder="MM/DD/YYYY" [readOnly]="disableSend" data-date-format="mm/dd/yyyy">
|
||||||
|
<select id="deletionTimeCustomFallback" class="form-control mt-1 ml-1" [required]="!editMode"
|
||||||
|
formControlName="fallbackDeletionTime" name="SafariDeletionTime">
|
||||||
|
<option *ngFor="let o of safariDeletionTimePresetOptions" [ngValue]="o.twentyFourHour">{{o.twelveHour}}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
<ng-container *ngSwitchDefault>
|
||||||
|
<input id="deletionDateCustom" class="form-control mt-1" type="datetime-local"
|
||||||
|
name="DeletionDate" formControlName="defaultDeletionDateTime" required
|
||||||
|
placeholder="MM/DD/YYYY HH:MM AM/PM" [readOnly]="disabled">
|
||||||
|
</ng-container>
|
||||||
|
</ng-container>
|
||||||
|
</ng-template>
|
||||||
|
<div *ngIf="!editMode">
|
||||||
|
<select id="deletionDate" name="SelectedDeletionDatePreset"
|
||||||
|
formControlName="selectedDeletionDatePreset" class="form-control" required>
|
||||||
|
<option *ngFor="let o of deletionDatePresets" [ngValue]="o.value">{{o.name}}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
<ng-container *ngIf="selectedDeletionDatePreset.value === 0">
|
||||||
|
<ng-container *ngTemplateOutlet="deletionDateCustom">
|
||||||
|
</ng-container>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="editMode">
|
||||||
|
<ng-container *ngTemplateOutlet="deletionDateCustom">
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
<div class="form-text text-muted small">{{'deletionDateDesc' | i18n}}</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-6 form-group">
|
||||||
|
<div class="d-flex">
|
||||||
|
<label for="expirationDate">{{'expirationDate' | i18n}}</label>
|
||||||
|
<a href="#" appStopClick (click)="clearExpiration()" class="ml-auto"
|
||||||
|
*ngIf="editMode && !disabled">
|
||||||
|
{{'clear' | i18n}}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<ng-template #expirationDateCustom>
|
||||||
|
<ng-container [ngSwitch]="browserPath">
|
||||||
|
<div *ngSwitchCase="'firefox'" class="d-flex justify-content-around">
|
||||||
|
<input id="expirationDateCustomFallback" class="form-control mt-1" type="date"
|
||||||
|
name="ExpirationDateFallback" formControlName="fallbackExpirationDate" [required]="!editMode"
|
||||||
|
placeholder="MM/DD/YYYY" [readOnly]="disabled" data-date-format="mm/dd/yyyy">
|
||||||
|
<input id="expirationTimeCustomFallback" class="form-control mt-1 ml-1" type="time"
|
||||||
|
name="ExpirationTimeFallback" formControlName="fallbackExpirationTime" [required]="!editMode"
|
||||||
|
placeholder="HH:MM AM/PM" [readOnly]="disabled">
|
||||||
|
</div>
|
||||||
|
<!-- non-default cases are not showing up -->
|
||||||
|
<div *ngSwitchCase="'safari'" class="d-flex justify-content-around">
|
||||||
|
<input id="expirationDateCustomFallback" class="form-control mt-1" type="date"
|
||||||
|
name="ExpirationDateFallback" formControlName="fallbackExpirationDate" [required]="!editMode"
|
||||||
|
placeholder="MM/DD/YYYY" [readOnly]="disabled" data-date-format="mm/dd/yyyy">
|
||||||
|
<select id="expirationTimeCustomFallback" class="form-control mt-1 ml-1" [required]="!editMode"
|
||||||
|
formControlName="fallbackExpirationTime" name="SafariExpirationTime">
|
||||||
|
<option *ngFor="let o of safariExpirationTimePresetOptions" [ngValue]="o.twentyFourHour">{{o.twelveHour}}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<ng-container *ngSwitchDefault>
|
||||||
|
<input id="expirationDateCustom" class="form-control mt-1" type="datetime-local"
|
||||||
|
name="ExpirationDate" formControlName="defaultExpirationDateTime" placeholder="MM/DD/YYYY HH:MM AM/PM"
|
||||||
|
[readOnly]="disabled">
|
||||||
|
</ng-container>
|
||||||
|
</ng-container>
|
||||||
|
</ng-template>
|
||||||
|
<div *ngIf="!editMode">
|
||||||
|
<select id="expirationDate" name="SelectedExpirationDatePreset"
|
||||||
|
formControlName="selectedExpirationDatePreset" class="form-control" required>
|
||||||
|
<option *ngFor="let o of expirationDatePresets" [ngValue]="o.value">{{o.name}}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
<ng-container *ngIf="selectedExpirationDatePreset.value === 0">
|
||||||
|
<ng-container *ngTemplateOutlet="expirationDateCustom">
|
||||||
|
</ng-container>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="editMode">
|
||||||
|
<ng-container *ngTemplateOutlet="expirationDateCustom">
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
<div class="form-text text-muted small">{{'expirationDateDesc' | i18n}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
22
src/app/send/efflux-dates.component.ts
Normal file
22
src/app/send/efflux-dates.component.ts
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import { DatePipe } from '@angular/common';
|
||||||
|
|
||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
import { ControlContainer, NgForm } from '@angular/forms';
|
||||||
|
|
||||||
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||||
|
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||||
|
|
||||||
|
import { EffluxDatesComponent as BaseEffluxDatesComponent } from 'jslib-angular/components/send/efflux-dates.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-send-efflux-dates',
|
||||||
|
templateUrl: 'efflux-dates.component.html',
|
||||||
|
viewProviders: [{ provide: ControlContainer, useExisting: NgForm }],
|
||||||
|
})
|
||||||
|
export class EffluxDatesComponent extends BaseEffluxDatesComponent {
|
||||||
|
constructor(protected i18nService: I18nService, protected platformUtilsService: PlatformUtilsService,
|
||||||
|
protected datePipe: DatePipe) {
|
||||||
|
super(i18nService, platformUtilsService, datePipe);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -71,6 +71,9 @@ export class EventService {
|
|||||||
case EventType.User_ClientExportedVault:
|
case EventType.User_ClientExportedVault:
|
||||||
msg = humanReadableMsg = this.i18nService.t('exportedVault');
|
msg = humanReadableMsg = this.i18nService.t('exportedVault');
|
||||||
break;
|
break;
|
||||||
|
case EventType.User_UpdatedTempPassword:
|
||||||
|
msg = humanReadableMsg = this.i18nService.t('updatedMasterPassword');
|
||||||
|
break;
|
||||||
// Cipher
|
// Cipher
|
||||||
case EventType.Cipher_Created:
|
case EventType.Cipher_Created:
|
||||||
msg = this.i18nService.t('createdItemId', this.formatCipherId(ev, options));
|
msg = this.i18nService.t('createdItemId', this.formatCipherId(ev, options));
|
||||||
@@ -101,8 +104,8 @@ export class EventService {
|
|||||||
humanReadableMsg = this.i18nService.t('deletedAttachmentForItem', this.getShortId(ev.cipherId));
|
humanReadableMsg = this.i18nService.t('deletedAttachmentForItem', this.getShortId(ev.cipherId));
|
||||||
break;
|
break;
|
||||||
case EventType.Cipher_Shared:
|
case EventType.Cipher_Shared:
|
||||||
msg = this.i18nService.t('sharedItemId', this.formatCipherId(ev, options));
|
msg = this.i18nService.t('movedItemIdToOrg', this.formatCipherId(ev, options));
|
||||||
humanReadableMsg = this.i18nService.t('sharedItemId', this.getShortId(ev.cipherId));
|
humanReadableMsg = this.i18nService.t('movedItemIdToOrg', this.getShortId(ev.cipherId));
|
||||||
break;
|
break;
|
||||||
case EventType.Cipher_ClientViewed:
|
case EventType.Cipher_ClientViewed:
|
||||||
msg = this.i18nService.t('viewedItemId', this.formatCipherId(ev, options));
|
msg = this.i18nService.t('viewedItemId', this.formatCipherId(ev, options));
|
||||||
@@ -215,6 +218,9 @@ export class EventService {
|
|||||||
msg = this.i18nService.t('exportedOrganizationVault');
|
msg = this.i18nService.t('exportedOrganizationVault');
|
||||||
break;
|
break;
|
||||||
*/
|
*/
|
||||||
|
case EventType.Organization_VaultAccessed:
|
||||||
|
msg = humanReadableMsg = this.i18nService.t('vaultAccessedByProvider');
|
||||||
|
break;
|
||||||
// Policies
|
// Policies
|
||||||
case EventType.Policy_Updated:
|
case EventType.Policy_Updated:
|
||||||
msg = this.i18nService.t('modifiedPolicyId', this.formatPolicyId(ev));
|
msg = this.i18nService.t('modifiedPolicyId', this.formatPolicyId(ev));
|
||||||
@@ -222,13 +228,45 @@ export class EventService {
|
|||||||
const policies = await this.policyService.getAll();
|
const policies = await this.policyService.getAll();
|
||||||
const policy = policies.filter(p => p.id === ev.policyId)[0];
|
const policy = policies.filter(p => p.id === ev.policyId)[0];
|
||||||
let p1 = this.getShortId(ev.policyId);
|
let p1 = this.getShortId(ev.policyId);
|
||||||
if (policy !== null) {
|
if (policy != null) {
|
||||||
p1 = PolicyType[policy.type];
|
p1 = PolicyType[policy.type];
|
||||||
}
|
}
|
||||||
|
|
||||||
humanReadableMsg = this.i18nService.t('modifiedPolicyId', p1);
|
humanReadableMsg = this.i18nService.t('modifiedPolicyId', p1);
|
||||||
break;
|
break;
|
||||||
|
// Provider users:
|
||||||
|
case EventType.ProviderUser_Invited:
|
||||||
|
msg = this.i18nService.t('invitedUserId', this.formatProviderUserId(ev));
|
||||||
|
humanReadableMsg = this.i18nService.t('invitedUserId', this.getShortId(ev.providerUserId));
|
||||||
|
break;
|
||||||
|
case EventType.ProviderUser_Confirmed:
|
||||||
|
msg = this.i18nService.t('confirmedUserId', this.formatProviderUserId(ev));
|
||||||
|
humanReadableMsg = this.i18nService.t('confirmedUserId', this.getShortId(ev.providerUserId));
|
||||||
|
break;
|
||||||
|
case EventType.ProviderUser_Updated:
|
||||||
|
msg = this.i18nService.t('editedUserId', this.formatProviderUserId(ev));
|
||||||
|
humanReadableMsg = this.i18nService.t('editedUserId', this.getShortId(ev.providerUserId));
|
||||||
|
break;
|
||||||
|
case EventType.ProviderUser_Removed:
|
||||||
|
msg = this.i18nService.t('removedUserId', this.formatProviderUserId(ev));
|
||||||
|
humanReadableMsg = this.i18nService.t('removedUserId', this.getShortId(ev.providerUserId));
|
||||||
|
break;
|
||||||
|
case EventType.ProviderOrganization_Created:
|
||||||
|
msg = this.i18nService.t('createdOrganizationId', this.formatProviderOrganizationId(ev));
|
||||||
|
humanReadableMsg = this.i18nService.t('createdOrganizationId', this.getShortId(ev.providerOrganizationId));
|
||||||
|
break;
|
||||||
|
case EventType.ProviderOrganization_Added:
|
||||||
|
msg = this.i18nService.t('addedOrganizationId', this.formatProviderOrganizationId(ev));
|
||||||
|
humanReadableMsg = this.i18nService.t('addedOrganizationId', this.getShortId(ev.providerOrganizationId));
|
||||||
|
break;
|
||||||
|
case EventType.ProviderOrganization_Removed:
|
||||||
|
msg = this.i18nService.t('removedOrganizationId', this.formatProviderOrganizationId(ev));
|
||||||
|
humanReadableMsg = this.i18nService.t('removedOrganizationId', this.getShortId(ev.providerOrganizationId));
|
||||||
|
break;
|
||||||
|
case EventType.ProviderOrganization_VaultAccessed:
|
||||||
|
msg = this.i18nService.t('accessedClientVault', this.formatProviderOrganizationId(ev));
|
||||||
|
humanReadableMsg = this.i18nService.t('accessedClientVault', this.getShortId(ev.providerOrganizationId));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -318,6 +356,21 @@ export class EventService {
|
|||||||
return a.outerHTML;
|
return a.outerHTML;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private formatProviderUserId(ev: EventResponse) {
|
||||||
|
const shortId = this.getShortId(ev.providerUserId);
|
||||||
|
const a = this.makeAnchor(shortId);
|
||||||
|
a.setAttribute('href', '#/providers/' + ev.providerId + '/manage/people?search=' + shortId +
|
||||||
|
'&viewEvents=' + ev.providerUserId);
|
||||||
|
return a.outerHTML;
|
||||||
|
}
|
||||||
|
|
||||||
|
private formatProviderOrganizationId(ev: EventResponse) {
|
||||||
|
const shortId = this.getShortId(ev.providerOrganizationId);
|
||||||
|
const a = this.makeAnchor(shortId);
|
||||||
|
a.setAttribute('href', '#/providers/' + ev.providerId + '/clients?search=' + shortId);
|
||||||
|
return a.outerHTML;
|
||||||
|
}
|
||||||
|
|
||||||
private formatPolicyId(ev: EventResponse) {
|
private formatPolicyId(ev: EventResponse) {
|
||||||
const shortId = this.getShortId(ev.policyId);
|
const shortId = this.getShortId(ev.policyId);
|
||||||
const a = this.makeAnchor(shortId);
|
const a = this.makeAnchor(shortId);
|
||||||
@@ -333,7 +386,7 @@ export class EventService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private getShortId(id: string) {
|
private getShortId(id: string) {
|
||||||
return id.substring(0, 8);
|
return id?.substring(0, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
private toDateTimeLocalString(date: Date) {
|
private toDateTimeLocalString(date: Date) {
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ import { FileUploadService as FileUploadServiceAbstraction } from 'jslib-common
|
|||||||
import { FolderService as FolderServiceAbstraction } from 'jslib-common/abstractions/folder.service';
|
import { FolderService as FolderServiceAbstraction } from 'jslib-common/abstractions/folder.service';
|
||||||
import { I18nService as I18nServiceAbstraction } from 'jslib-common/abstractions/i18n.service';
|
import { I18nService as I18nServiceAbstraction } from 'jslib-common/abstractions/i18n.service';
|
||||||
import { ImportService as ImportServiceAbstraction } from 'jslib-common/abstractions/import.service';
|
import { ImportService as ImportServiceAbstraction } from 'jslib-common/abstractions/import.service';
|
||||||
|
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||||
import { MessagingService as MessagingServiceAbstraction } from 'jslib-common/abstractions/messaging.service';
|
import { MessagingService as MessagingServiceAbstraction } from 'jslib-common/abstractions/messaging.service';
|
||||||
import { NotificationsService as NotificationsServiceAbstraction } from 'jslib-common/abstractions/notifications.service';
|
import { NotificationsService as NotificationsServiceAbstraction } from 'jslib-common/abstractions/notifications.service';
|
||||||
import {
|
import {
|
||||||
@@ -102,7 +103,8 @@ const cryptoService = new CryptoService(storageService,
|
|||||||
consoleLogService);
|
consoleLogService);
|
||||||
const tokenService = new TokenService(storageService);
|
const tokenService = new TokenService(storageService);
|
||||||
const appIdService = new AppIdService(storageService);
|
const appIdService = new AppIdService(storageService);
|
||||||
const apiService = new ApiService(tokenService, platformUtilsService,
|
const environmentService = new EnvironmentService(storageService);
|
||||||
|
const apiService = new ApiService(tokenService, platformUtilsService, environmentService,
|
||||||
async (expired: boolean) => messagingService.send('logout', { expired: expired }));
|
async (expired: boolean) => messagingService.send('logout', { expired: expired }));
|
||||||
const userService = new UserService(tokenService, storageService);
|
const userService = new UserService(tokenService, storageService);
|
||||||
const settingsService = new SettingsService(userService, storageService);
|
const settingsService = new SettingsService(userService, storageService);
|
||||||
@@ -132,9 +134,8 @@ const authService = new AuthService(cryptoService, apiService,
|
|||||||
const exportService = new ExportService(folderService, cipherService, apiService, cryptoService);
|
const exportService = new ExportService(folderService, cipherService, apiService, cryptoService);
|
||||||
const importService = new ImportService(cipherService, folderService, apiService, i18nService, collectionService,
|
const importService = new ImportService(cipherService, folderService, apiService, i18nService, collectionService,
|
||||||
platformUtilsService, cryptoService);
|
platformUtilsService, cryptoService);
|
||||||
const notificationsService = new NotificationsService(userService, syncService, appIdService,
|
const notificationsService = new NotificationsService(userService, syncService, appIdService, apiService, vaultTimeoutService,
|
||||||
apiService, vaultTimeoutService, async () => messagingService.send('logout', { expired: true }), consoleLogService);
|
environmentService, async () => messagingService.send('logout', { expired: true }), consoleLogService);
|
||||||
const environmentService = new EnvironmentService(apiService, storageService, notificationsService);
|
|
||||||
const auditService = new AuditService(cryptoFunctionService, apiService);
|
const auditService = new AuditService(cryptoFunctionService, apiService);
|
||||||
const eventLoggingService = new EventLoggingService(storageService, apiService, userService, cipherService);
|
const eventLoggingService = new EventLoggingService(storageService, apiService, userService, cipherService);
|
||||||
const passwordRepromptService = new PasswordRepromptService(i18nService, cryptoService, platformUtilsService);
|
const passwordRepromptService = new PasswordRepromptService(i18nService, cryptoService, platformUtilsService);
|
||||||
@@ -146,19 +147,16 @@ export function initFactory(): Function {
|
|||||||
await (storageService as HtmlStorageService).init();
|
await (storageService as HtmlStorageService).init();
|
||||||
|
|
||||||
if (process.env.ENV !== 'production' || platformUtilsService.isSelfHost()) {
|
if (process.env.ENV !== 'production' || platformUtilsService.isSelfHost()) {
|
||||||
environmentService.baseUrl = window.location.origin;
|
environmentService.setUrls({ base: window.location.origin }, false);
|
||||||
} else {
|
} else {
|
||||||
environmentService.notificationsUrl = 'https://notifications.bitwarden.com';
|
environmentService.setUrls({
|
||||||
environmentService.enterpriseUrl = 'https://portal.bitwarden.com';
|
base: window.location.origin,
|
||||||
|
notifications: 'https://notifications.bitwarden.com',
|
||||||
|
enterprise: 'https://portal.bitwarden.com',
|
||||||
|
}, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
apiService.setUrls({
|
setTimeout(() => notificationsService.init(), 3000);
|
||||||
base: window.location.origin,
|
|
||||||
api: null,
|
|
||||||
identity: null,
|
|
||||||
events: null,
|
|
||||||
});
|
|
||||||
setTimeout(() => notificationsService.init(environmentService), 3000);
|
|
||||||
|
|
||||||
vaultTimeoutService.init(true);
|
vaultTimeoutService.init(true);
|
||||||
const locale = await storageService.get<string>(ConstantsService.localeKey);
|
const locale = await storageService.get<string>(ConstantsService.localeKey);
|
||||||
@@ -196,6 +194,7 @@ export function initFactory(): Function {
|
|||||||
{ provide: AuthServiceAbstraction, useValue: authService },
|
{ provide: AuthServiceAbstraction, useValue: authService },
|
||||||
{ provide: CipherServiceAbstraction, useValue: cipherService },
|
{ provide: CipherServiceAbstraction, useValue: cipherService },
|
||||||
{ provide: FolderServiceAbstraction, useValue: folderService },
|
{ provide: FolderServiceAbstraction, useValue: folderService },
|
||||||
|
{ provide: LogService, useValue: consoleLogService },
|
||||||
{ provide: CollectionServiceAbstraction, useValue: collectionService },
|
{ provide: CollectionServiceAbstraction, useValue: collectionService },
|
||||||
{ provide: EnvironmentServiceAbstraction, useValue: environmentService },
|
{ provide: EnvironmentServiceAbstraction, useValue: environmentService },
|
||||||
{ provide: TotpServiceAbstraction, useValue: totpService },
|
{ provide: TotpServiceAbstraction, useValue: totpService },
|
||||||
@@ -223,6 +222,7 @@ export function initFactory(): Function {
|
|||||||
{ provide: PolicyServiceAbstraction, useValue: policyService },
|
{ provide: PolicyServiceAbstraction, useValue: policyService },
|
||||||
{ provide: SendServiceAbstraction, useValue: sendService },
|
{ provide: SendServiceAbstraction, useValue: sendService },
|
||||||
{ provide: PasswordRepromptServiceAbstraction, useValue: passwordRepromptService },
|
{ provide: PasswordRepromptServiceAbstraction, useValue: passwordRepromptService },
|
||||||
|
{ provide: LogService, useValue: consoleLogService },
|
||||||
{
|
{
|
||||||
provide: APP_INITIALIZER,
|
provide: APP_INITIALIZER,
|
||||||
useFactory: initFactory,
|
useFactory: initFactory,
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ export class AddCreditComponent implements OnInit {
|
|||||||
|
|
||||||
constructor(private userService: UserService, private apiService: ApiService,
|
constructor(private userService: UserService, private apiService: ApiService,
|
||||||
private platformUtilsService: PlatformUtilsService) {
|
private platformUtilsService: PlatformUtilsService) {
|
||||||
if (platformUtilsService.isDev()) {
|
if (process.env.ENV !== 'production' || platformUtilsService.isDev()) {
|
||||||
this.ppButtonFormAction = WebConstants.paypal.buttonActionSandbox;
|
this.ppButtonFormAction = WebConstants.paypal.buttonActionSandbox;
|
||||||
this.ppButtonBusinessId = WebConstants.paypal.businessIdSandbox;
|
this.ppButtonBusinessId = WebConstants.paypal.businessIdSandbox;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { MessagingService } from 'jslib-common/abstractions/messaging.service';
|
|||||||
import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service';
|
import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service';
|
||||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||||
import { PolicyService } from 'jslib-common/abstractions/policy.service';
|
import { PolicyService } from 'jslib-common/abstractions/policy.service';
|
||||||
|
import { SendService } from 'jslib-common/abstractions/send.service';
|
||||||
import { SyncService } from 'jslib-common/abstractions/sync.service';
|
import { SyncService } from 'jslib-common/abstractions/sync.service';
|
||||||
import { UserService } from 'jslib-common/abstractions/user.service';
|
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||||
|
|
||||||
@@ -27,6 +28,7 @@ import { EmergencyAccessUpdateRequest } from 'jslib-common/models/request/emerge
|
|||||||
import { FolderWithIdRequest } from 'jslib-common/models/request/folderWithIdRequest';
|
import { FolderWithIdRequest } from 'jslib-common/models/request/folderWithIdRequest';
|
||||||
import { OrganizationUserResetPasswordEnrollmentRequest } from 'jslib-common/models/request/organizationUserResetPasswordEnrollmentRequest';
|
import { OrganizationUserResetPasswordEnrollmentRequest } from 'jslib-common/models/request/organizationUserResetPasswordEnrollmentRequest';
|
||||||
import { PasswordRequest } from 'jslib-common/models/request/passwordRequest';
|
import { PasswordRequest } from 'jslib-common/models/request/passwordRequest';
|
||||||
|
import { SendWithIdRequest } from 'jslib-common/models/request/sendWithIdRequest';
|
||||||
import { UpdateKeyRequest } from 'jslib-common/models/request/updateKeyRequest';
|
import { UpdateKeyRequest } from 'jslib-common/models/request/updateKeyRequest';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -42,7 +44,7 @@ export class ChangePasswordComponent extends BaseChangePasswordComponent {
|
|||||||
userService: UserService, passwordGenerationService: PasswordGenerationService,
|
userService: UserService, passwordGenerationService: PasswordGenerationService,
|
||||||
platformUtilsService: PlatformUtilsService, policyService: PolicyService,
|
platformUtilsService: PlatformUtilsService, policyService: PolicyService,
|
||||||
private folderService: FolderService, private cipherService: CipherService,
|
private folderService: FolderService, private cipherService: CipherService,
|
||||||
private syncService: SyncService, private apiService: ApiService) {
|
private syncService: SyncService, private apiService: ApiService, private sendService: SendService) {
|
||||||
super(i18nService, cryptoService, messagingService, userService, passwordGenerationService,
|
super(i18nService, cryptoService, messagingService, userService, passwordGenerationService,
|
||||||
platformUtilsService, policyService);
|
platformUtilsService, policyService);
|
||||||
}
|
}
|
||||||
@@ -164,6 +166,13 @@ export class ChangePasswordComponent extends BaseChangePasswordComponent {
|
|||||||
request.ciphers.push(new CipherWithIdRequest(cipher));
|
request.ciphers.push(new CipherWithIdRequest(cipher));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const sends = await this.sendService.getAll();
|
||||||
|
await Promise.all(sends.map(async send => {
|
||||||
|
const cryptoKey = await this.cryptoService.decryptToBytes(send.key, null);
|
||||||
|
send.key = await this.cryptoService.encrypt(cryptoKey, encKey[0]) ?? send.key;
|
||||||
|
request.sends.push(new SendWithIdRequest(send));
|
||||||
|
}));
|
||||||
|
|
||||||
await this.apiService.postAccountKey(request);
|
await this.apiService.postAccountKey(request);
|
||||||
|
|
||||||
await this.updateEmergencyAccesses(encKey[0]);
|
await this.updateEmergencyAccesses(encKey[0]);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user