mirror of
https://github.com/bitwarden/directory-connector
synced 2025-12-05 23:53:21 +00:00
Compare commits
118 Commits
husky-test
...
ac/pm-1180
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01e894b5bc | ||
|
|
aa5a9f3e2f | ||
|
|
f4181b13f7 | ||
|
|
4bb96f049c | ||
|
|
b991fea958 | ||
|
|
111b8bd646 | ||
|
|
42af888615 | ||
|
|
a28fad020b | ||
|
|
f190433348 | ||
|
|
1e211becc3 | ||
|
|
4652c6489f | ||
|
|
9dc497dd13 | ||
|
|
3d9465917d | ||
|
|
6b1b6bf1c4 | ||
|
|
f52af53dad | ||
|
|
6e6039d298 | ||
|
|
332d07eca6 | ||
|
|
c3ed541efd | ||
|
|
4ae4cba877 | ||
|
|
3ecca16f50 | ||
|
|
1f30ef165f | ||
|
|
dfd8fce231 | ||
|
|
0b7c0ec9c2 | ||
|
|
6d569e9319 | ||
|
|
3ed4e76f95 | ||
|
|
abf7e0400c | ||
|
|
5600f20760 | ||
|
|
bbc65d77e3 | ||
|
|
5d0cde9cfa | ||
|
|
eff7c848f8 | ||
|
|
46fb407c0c | ||
|
|
e2fe5ef9ad | ||
|
|
dd10538d0f | ||
|
|
6d355812e0 | ||
|
|
c973d5fea0 | ||
|
|
01a3f68480 | ||
|
|
d31f14cfe7 | ||
|
|
401daa0187 | ||
|
|
1951b9507d | ||
|
|
eae9cac931 | ||
|
|
21cecc3c0a | ||
|
|
21638f3fdc | ||
|
|
f47806ddd2 | ||
|
|
c304650a6a | ||
|
|
d01522bfc4 | ||
|
|
14314a3553 | ||
|
|
ffac82e865 | ||
|
|
decada8745 | ||
|
|
3a639bb8f2 | ||
|
|
a2b5dac108 | ||
|
|
6e76d8fcbd | ||
|
|
63b06f6950 | ||
|
|
f730aeba23 | ||
|
|
52a8a35f41 | ||
|
|
601a83ebfa | ||
|
|
0cdb12229e | ||
|
|
423a48ab2e | ||
|
|
9a2bf331bc | ||
|
|
0d211f351c | ||
|
|
d1d4f53866 | ||
|
|
dede587b78 | ||
|
|
d76a6e993d | ||
|
|
32d514ebcc | ||
|
|
1f08c7e5cc | ||
|
|
dd80dce657 | ||
|
|
ff6dff329a | ||
|
|
8c6f1aab90 | ||
|
|
9a3aae16a7 | ||
|
|
1480445d35 | ||
|
|
fc04964663 | ||
|
|
cc05bcb4a6 | ||
|
|
5ce3b01ff1 | ||
|
|
079c3ee840 | ||
|
|
f88ce25b59 | ||
|
|
599473f6e4 | ||
|
|
df389cbd08 | ||
|
|
051b6dc3cf | ||
|
|
5727dd75cc | ||
|
|
435f2d10b7 | ||
|
|
dab646675f | ||
|
|
8dc65ef371 | ||
|
|
9925fdea40 | ||
|
|
4c61498714 | ||
|
|
930f8c84d5 | ||
|
|
d20818ee49 | ||
|
|
6936c218d1 | ||
|
|
8ef5459801 | ||
|
|
cb615412aa | ||
|
|
2d69d2b791 | ||
|
|
0630b4f52e | ||
|
|
690c9cd5cb | ||
|
|
3f0454b1d8 | ||
|
|
1a84084b5d | ||
|
|
c5fb57576c | ||
|
|
165083a245 | ||
|
|
84f1f5b81f | ||
|
|
9599c66586 | ||
|
|
38b2a13df6 | ||
|
|
1fb4378046 | ||
|
|
8a661fbc5e | ||
|
|
cf56b5fb57 | ||
|
|
9c88e66a27 | ||
|
|
5b7b68f1cb | ||
|
|
a09473c632 | ||
|
|
71727dae7d | ||
|
|
3dbd34ebc3 | ||
|
|
6dd121acc6 | ||
|
|
d6ddb499f0 | ||
|
|
5b4e09be93 | ||
|
|
a48e0af042 | ||
|
|
a133718eb7 | ||
|
|
37bdd75c67 | ||
|
|
a9f1d32ce0 | ||
|
|
6e76f23653 | ||
|
|
39ed9359fe | ||
|
|
d1cb92b5e7 | ||
|
|
eacdb6b8a8 | ||
|
|
95f613d61a |
1
.depcheckrc
Normal file
1
.depcheckrc
Normal file
@@ -0,0 +1 @@
|
||||
ignores: ["*-loader", "webpack-cli", "@types/jest"]
|
||||
127
.eslintrc.json
127
.eslintrc.json
@@ -4,53 +4,92 @@
|
||||
"browser": true,
|
||||
"node": true
|
||||
},
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"plugins": ["@typescript-eslint"],
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:import/recommended",
|
||||
"plugin:import/typescript",
|
||||
"prettier"
|
||||
],
|
||||
"rules": {
|
||||
"@typescript-eslint/no-explicit-any": "off", // TODO: This should be re-enabled
|
||||
"@typescript-eslint/no-unused-vars": ["warn", { "args": "none" }],
|
||||
"@typescript-eslint/explicit-member-accessibility": [
|
||||
"error",
|
||||
{
|
||||
"accessibility": "no-public"
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/no-this-alias": [
|
||||
"error",
|
||||
{
|
||||
"allowedNames": ["self"]
|
||||
}
|
||||
],
|
||||
"no-console": "warn",
|
||||
"import/no-unresolved": "off", // TODO: Look into turning off once each package is an actual package.
|
||||
"import/order": [
|
||||
"error",
|
||||
{
|
||||
"alphabetize": {
|
||||
"order": "asc"
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts", "*.js"],
|
||||
"plugins": ["@typescript-eslint", "rxjs", "rxjs-angular", "import"],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"project": ["./tsconfig.eslint.json"],
|
||||
"sourceType": "module",
|
||||
"ecmaVersion": 2020
|
||||
},
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:import/recommended",
|
||||
"plugin:import/typescript",
|
||||
"prettier",
|
||||
"plugin:rxjs/recommended"
|
||||
],
|
||||
"settings": {
|
||||
"import/parsers": {
|
||||
"@typescript-eslint/parser": [".ts"]
|
||||
},
|
||||
"newlines-between": "always",
|
||||
"pathGroups": [
|
||||
"import/resolver": {
|
||||
"typescript": {
|
||||
"alwaysTryTypes": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"rules": {
|
||||
"@typescript-eslint/explicit-member-accessibility": [
|
||||
"error",
|
||||
{ "accessibility": "no-public" }
|
||||
],
|
||||
"@typescript-eslint/no-explicit-any": "off", // TODO: This should be re-enabled
|
||||
"@typescript-eslint/no-misused-promises": ["error", { "checksVoidReturn": false }],
|
||||
"@typescript-eslint/no-this-alias": ["error", { "allowedNames": ["self"] }],
|
||||
"@typescript-eslint/no-unused-vars": ["error", { "args": "none" }],
|
||||
"no-console": "error",
|
||||
"import/no-unresolved": "off", // TODO: Look into turning off once each package is an actual package.
|
||||
"import/order": [
|
||||
"error",
|
||||
{
|
||||
"pattern": "jslib-*/**",
|
||||
"group": "external",
|
||||
"position": "after"
|
||||
},
|
||||
{
|
||||
"pattern": "src/**/*",
|
||||
"group": "parent",
|
||||
"position": "before"
|
||||
"alphabetize": {
|
||||
"order": "asc"
|
||||
},
|
||||
"newlines-between": "always",
|
||||
"pathGroups": [
|
||||
{
|
||||
"pattern": "@/jslib/**/*",
|
||||
"group": "external",
|
||||
"position": "after"
|
||||
},
|
||||
{
|
||||
"pattern": "@/src/**/*",
|
||||
"group": "parent",
|
||||
"position": "before"
|
||||
}
|
||||
],
|
||||
"pathGroupsExcludedImportTypes": ["builtin"]
|
||||
}
|
||||
],
|
||||
"pathGroupsExcludedImportTypes": ["builtin"]
|
||||
"rxjs-angular/prefer-takeuntil": "error",
|
||||
"rxjs/no-exposed-subjects": ["error", { "allowProtected": true }],
|
||||
"no-restricted-syntax": [
|
||||
"error",
|
||||
{
|
||||
"message": "Calling `svgIcon` directly is not allowed",
|
||||
"selector": "CallExpression[callee.name='svgIcon']"
|
||||
},
|
||||
{
|
||||
"message": "Accessing FormGroup using `get` is not allowed, use `.value` instead",
|
||||
"selector": "ChainExpression[expression.object.callee.property.name='get'][expression.property.name='value']"
|
||||
}
|
||||
],
|
||||
"curly": ["error", "all"],
|
||||
"import/namespace": ["off"], // This doesn't resolve namespace imports correctly, but TS will throw for this anyway
|
||||
"no-restricted-imports": ["error", { "patterns": ["src/**/*"] }]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["*.html"],
|
||||
"parser": "@angular-eslint/template-parser",
|
||||
"plugins": ["@angular-eslint/template"],
|
||||
"rules": {
|
||||
"@angular-eslint/template/button-has-type": "error"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
7
.github/CODEOWNERS
vendored
7
.github/CODEOWNERS
vendored
@@ -6,10 +6,3 @@
|
||||
|
||||
# Default file owners.
|
||||
* @bitwarden/team-admin-console-dev
|
||||
|
||||
# DevOps for Actions and other workflow changes.
|
||||
.github/workflows @bitwarden/dept-devops
|
||||
.github/secrets @bitwarden/dept-devops
|
||||
|
||||
# Multiple Owners
|
||||
**/package.json
|
||||
47
.github/PULL_REQUEST_TEMPLATE.md
vendored
47
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,33 +1,34 @@
|
||||
## Type of change
|
||||
## 🎟️ Tracking
|
||||
|
||||
- [ ] Bug fix
|
||||
- [ ] New feature development
|
||||
- [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
|
||||
- [ ] Build/deploy pipeline (DevOps)
|
||||
- [ ] Other
|
||||
<!-- Paste the link to the Jira or GitHub issue or otherwise describe / point to where this change is coming from. -->
|
||||
|
||||
## Objective
|
||||
## 📔 Objective
|
||||
|
||||
<!--Describe what the purpose of this PR is. For example: what bug you're fixing or what new feature you're adding-->
|
||||
<!-- Describe what the purpose of this PR is, for example what bug you're fixing or new feature you're adding. -->
|
||||
|
||||
## Code changes
|
||||
## 📸 Screenshots
|
||||
|
||||
<!--Explain the changes you've made to each file or major component. This should help the reviewer understand your changes-->
|
||||
<!--Also refer to any related changes or PRs in other repositories-->
|
||||
<!-- Required for any UI changes; delete if not applicable. Use fixed width images for better display. -->
|
||||
|
||||
- **file.ext:** Description of what was changed and why
|
||||
## ⏰ Reminders before review
|
||||
|
||||
## Screenshots
|
||||
- Contributor guidelines followed
|
||||
- All formatters and local linters executed and passed
|
||||
- Written new unit and / or integration tests where applicable
|
||||
- Used internationalization (i18n) for all UI strings
|
||||
- CI builds passed
|
||||
- Communicated to DevOps any deployment requirements
|
||||
- Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team
|
||||
|
||||
<!--Required for any UI changes. Delete if not applicable-->
|
||||
## 🦮 Reviewer guidelines
|
||||
|
||||
## Testing requirements
|
||||
<!-- Suggested interactions but feel free to use (or not) as you desire! -->
|
||||
|
||||
<!--What functionality requires testing by QA? This includes testing new behavior and regression testing-->
|
||||
|
||||
## Before you submit
|
||||
|
||||
- [ ] I have checked for **linting** errors (`npm run lint`) (required)
|
||||
- [ ] I have added **unit tests** where it makes sense to do so (encouraged but not required)
|
||||
- [ ] This change requires a **documentation update** (notify the documentation team)
|
||||
- [ ] This change has particular **deployment requirements** (notify the DevOps team)
|
||||
- 👍 (`:+1:`) or similar for great changes
|
||||
- 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info
|
||||
- ❓ (`:question:`) for questions
|
||||
- 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
|
||||
- 🎨 (`:art:`) for suggestions / improvements
|
||||
- ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention
|
||||
- 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt
|
||||
- ⛏ (`:pick:`) for minor or nitpick changes
|
||||
|
||||
24
.github/renovate.json
vendored
24
.github/renovate.json
vendored
@@ -1,30 +1,12 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"config:base",
|
||||
":combinePatchMinorReleases",
|
||||
":dependencyDashboard",
|
||||
":maintainLockFilesWeekly",
|
||||
":pinAllExceptPeerDependencies",
|
||||
":prConcurrentLimit10",
|
||||
":rebaseStalePrs",
|
||||
":separateMajorReleases",
|
||||
"group:monorepos",
|
||||
"schedule:weekends"
|
||||
],
|
||||
"extends": ["github>bitwarden/renovate-config"],
|
||||
"enabledManagers": ["github-actions", "npm"],
|
||||
"commitMessagePrefix": "[deps]:",
|
||||
"commitMessageTopic": "{{depName}}",
|
||||
"packageRules": [
|
||||
{
|
||||
"groupName": "npm minor",
|
||||
"matchManagers": ["npm"],
|
||||
"groupName": "gh minor",
|
||||
"matchManagers": ["github-actions"],
|
||||
"matchUpdateTypes": ["minor", "patch"]
|
||||
},
|
||||
{
|
||||
"matchFileNames": ["package.json"],
|
||||
"description": "Admin Console owns general dependencies",
|
||||
"reviewers": ["team:team-admin-console-dev"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
BIN
.github/secrets/devid-app-cert.p12.gpg
vendored
BIN
.github/secrets/devid-app-cert.p12.gpg
vendored
Binary file not shown.
BIN
.github/secrets/devid-installer-cert.p12.gpg
vendored
BIN
.github/secrets/devid-installer-cert.p12.gpg
vendored
Binary file not shown.
BIN
.github/secrets/macdev-cert.p12.gpg
vendored
BIN
.github/secrets/macdev-cert.p12.gpg
vendored
Binary file not shown.
157
.github/workflows/build.yml
vendored
157
.github/workflows/build.yml
vendored
@@ -3,6 +3,9 @@ name: Build
|
||||
|
||||
on:
|
||||
pull_request: {}
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
workflow_dispatch: {}
|
||||
|
||||
jobs:
|
||||
@@ -11,7 +14,7 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
||||
- name: Set up CLOC
|
||||
run: |
|
||||
@@ -29,7 +32,7 @@ jobs:
|
||||
package_version: ${{ steps.retrieve-version.outputs.package_version }}
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
||||
- name: Get Package Version
|
||||
id: retrieve-version
|
||||
@@ -48,10 +51,10 @@ jobs:
|
||||
_PKG_FETCH_VERSION: 3.4
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
|
||||
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
|
||||
with:
|
||||
cache: 'npm'
|
||||
cache-dependency-path: '**/package-lock.json'
|
||||
@@ -119,14 +122,14 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Upload Linux Zip to GitHub
|
||||
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
|
||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
with:
|
||||
name: bwdc-linux-${{ env._PACKAGE_VERSION }}.zip
|
||||
path: ./dist-cli/bwdc-linux-${{ env._PACKAGE_VERSION }}.zip
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload Linux checksum to GitHub
|
||||
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
|
||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
with:
|
||||
name: bwdc-linux-sha256-${{ env._PACKAGE_VERSION }}.txt
|
||||
path: ./dist-cli/bwdc-linux-sha256-${{ env._PACKAGE_VERSION }}.txt
|
||||
@@ -135,7 +138,7 @@ jobs:
|
||||
|
||||
macos-cli:
|
||||
name: Build Mac CLI
|
||||
runs-on: macos-12
|
||||
runs-on: macos-13
|
||||
needs: setup
|
||||
env:
|
||||
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
||||
@@ -143,10 +146,10 @@ jobs:
|
||||
_PKG_FETCH_VERSION: 3.4
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
|
||||
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
|
||||
with:
|
||||
cache: 'npm'
|
||||
cache-dependency-path: '**/package-lock.json'
|
||||
@@ -207,14 +210,14 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Upload Mac Zip to GitHub
|
||||
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
|
||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
with:
|
||||
name: bwdc-macos-${{ env._PACKAGE_VERSION }}.zip
|
||||
path: ./dist-cli/bwdc-macos-${{ env._PACKAGE_VERSION }}.zip
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload Mac checksum to GitHub
|
||||
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
|
||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
with:
|
||||
name: bwdc-macos-sha256-${{ env._PACKAGE_VERSION }}.txt
|
||||
path: ./dist-cli/bwdc-macos-sha256-${{ env._PACKAGE_VERSION }}.txt
|
||||
@@ -230,7 +233,7 @@ jobs:
|
||||
_WIN_PKG_VERSION: 3.4
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
||||
- name: Setup Windows builder
|
||||
run: |
|
||||
@@ -238,7 +241,7 @@ jobs:
|
||||
choco install reshack --no-progress
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
|
||||
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
|
||||
with:
|
||||
cache: 'npm'
|
||||
cache-dependency-path: '**/package-lock.json'
|
||||
@@ -351,14 +354,14 @@ jobs:
|
||||
-t sha256 | Out-File ./dist-cli/bwdc-windows-sha256-${env:_PACKAGE_VERSION}.txt
|
||||
|
||||
- name: Upload Windows Zip to GitHub
|
||||
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
|
||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
with:
|
||||
name: bwdc-windows-${{ env._PACKAGE_VERSION }}.zip
|
||||
path: ./dist-cli/bwdc-windows-${{ env._PACKAGE_VERSION }}.zip
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload Windows checksum to GitHub
|
||||
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
|
||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
with:
|
||||
name: bwdc-windows-sha256-${{ env._PACKAGE_VERSION }}.txt
|
||||
path: ./dist-cli/bwdc-windows-sha256-${{ env._PACKAGE_VERSION }}.txt
|
||||
@@ -372,12 +375,13 @@ jobs:
|
||||
env:
|
||||
NODE_OPTIONS: --max_old_space_size=4096
|
||||
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
||||
HUSKY: 0
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
|
||||
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
|
||||
with:
|
||||
cache: 'npm'
|
||||
cache-dependency-path: '**/package-lock.json'
|
||||
@@ -410,28 +414,28 @@ jobs:
|
||||
SIGNING_CERT_NAME: ${{ secrets.SIGNING_CERT_NAME }}
|
||||
|
||||
- name: Upload Portable Executable to GitHub
|
||||
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
|
||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
with:
|
||||
name: Bitwarden-Connector-Portable-${{ env._PACKAGE_VERSION }}.exe
|
||||
path: ./dist/Bitwarden-Connector-Portable-${{ env._PACKAGE_VERSION }}.exe
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload Installer Executable to GitHub
|
||||
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
|
||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
with:
|
||||
name: Bitwarden-Connector-Installer-${{ env._PACKAGE_VERSION }}.exe
|
||||
path: ./dist/Bitwarden-Connector-Installer-${{ env._PACKAGE_VERSION }}.exe
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload Installer Executable Blockmap to GitHub
|
||||
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
|
||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
with:
|
||||
name: Bitwarden-Connector-Installer-${{ env._PACKAGE_VERSION }}.exe.blockmap
|
||||
path: ./dist/Bitwarden-Connector-Installer-${{ env._PACKAGE_VERSION }}.exe.blockmap
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload latest auto-update artifact
|
||||
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
|
||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
with:
|
||||
name: latest.yml
|
||||
path: ./dist/latest.yml
|
||||
@@ -445,12 +449,13 @@ jobs:
|
||||
env:
|
||||
NODE_OPTIONS: --max_old_space_size=4096
|
||||
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
||||
HUSKY: 0
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
|
||||
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
|
||||
with:
|
||||
cache: 'npm'
|
||||
cache-dependency-path: '**/package-lock.json'
|
||||
@@ -477,14 +482,14 @@ jobs:
|
||||
run: npm run dist:lin
|
||||
|
||||
- name: Upload AppImage
|
||||
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
|
||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
with:
|
||||
name: Bitwarden-Connector-${{ env._PACKAGE_VERSION }}-x86_64.AppImage
|
||||
path: ./dist/Bitwarden-Connector-${{ env._PACKAGE_VERSION }}-x86_64.AppImage
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload latest auto-update artifact
|
||||
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
|
||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
with:
|
||||
name: latest-linux.yml
|
||||
path: ./dist/latest-linux.yml
|
||||
@@ -493,17 +498,18 @@ jobs:
|
||||
|
||||
macos-gui:
|
||||
name: Build MacOS GUI
|
||||
runs-on: macos-12
|
||||
runs-on: macos-13
|
||||
needs: setup
|
||||
env:
|
||||
NODE_OPTIONS: --max_old_space_size=4096
|
||||
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
||||
HUSKY: 0
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
|
||||
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
|
||||
with:
|
||||
cache: 'npm'
|
||||
cache-dependency-path: '**/package-lock.json'
|
||||
@@ -520,44 +526,43 @@ jobs:
|
||||
npm --version
|
||||
echo "GitHub ref: $GITHUB_REF"
|
||||
echo "GitHub event: $GITHUB_EVENT"
|
||||
shell: bash
|
||||
|
||||
- name: Decrypt secrets
|
||||
env:
|
||||
DECRYPT_FILE_PASSWORD: ${{ secrets.DECRYPT_FILE_PASSWORD }}
|
||||
shell: bash
|
||||
- name: Login to Azure
|
||||
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
|
||||
with:
|
||||
creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
|
||||
|
||||
- name: Get certificates
|
||||
run: |
|
||||
mkdir -p $HOME/secrets
|
||||
mkdir -p $HOME/certificates
|
||||
|
||||
gpg --quiet --batch --yes --decrypt --passphrase="$DECRYPT_FILE_PASSWORD" \
|
||||
--output "$HOME/secrets/devid-app-cert.p12" \
|
||||
"$GITHUB_WORKSPACE/.github/secrets/devid-app-cert.p12.gpg"
|
||||
az keyvault secret show --id https://bitwarden-ci.vault.azure.net/certificates/devid-app-cert |
|
||||
jq -r .value | base64 -d > $HOME/certificates/devid-app-cert.p12
|
||||
|
||||
gpg --quiet --batch --yes --decrypt --passphrase="$DECRYPT_FILE_PASSWORD" \
|
||||
--output "$HOME/secrets/devid-installer-cert.p12" \
|
||||
"$GITHUB_WORKSPACE/.github/secrets/devid-installer-cert.p12.gpg"
|
||||
az keyvault secret show --id https://bitwarden-ci.vault.azure.net/certificates/devid-installer-cert |
|
||||
jq -r .value | base64 -d > $HOME/certificates/devid-installer-cert.p12
|
||||
|
||||
gpg --quiet --batch --yes --decrypt --passphrase="$DECRYPT_FILE_PASSWORD" \
|
||||
--output "$HOME/secrets/macdev-cert.p12" \
|
||||
"$GITHUB_WORKSPACE/.github/secrets/macdev-cert.p12.gpg"
|
||||
az keyvault secret show --id https://bitwarden-ci.vault.azure.net/certificates/macdev-cert |
|
||||
jq -r .value | base64 -d > $HOME/certificates/macdev-cert.p12
|
||||
|
||||
- name: Set up keychain
|
||||
env:
|
||||
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
||||
DEVID_CERT_PASSWORD: ${{ secrets.DEVID_CERT_PASSWORD }}
|
||||
MACDEV_CERT_PASSWORD: ${{ secrets.MACDEV_CERT_PASSWORD }}
|
||||
shell: bash
|
||||
run: |
|
||||
security create-keychain -p $KEYCHAIN_PASSWORD build.keychain
|
||||
security default-keychain -s build.keychain
|
||||
security unlock-keychain -p $KEYCHAIN_PASSWORD build.keychain
|
||||
security set-keychain-settings -lut 1200 build.keychain
|
||||
security import "$HOME/secrets/devid-app-cert.p12" -k build.keychain -P $DEVID_CERT_PASSWORD \
|
||||
|
||||
security import "$HOME/certificates/devid-app-cert.p12" -k build.keychain -P "" \
|
||||
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
||||
security import "$HOME/secrets/devid-installer-cert.p12" -k build.keychain -P $DEVID_CERT_PASSWORD \
|
||||
|
||||
security import "$HOME/certificates/devid-installer-cert.p12" -k build.keychain -P "" \
|
||||
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
||||
security import "$HOME/secrets/macdev-cert.p12" -k build.keychain -P $MACDEV_CERT_PASSWORD \
|
||||
|
||||
security import "$HOME/certificates/macdev-cert.p12" -k build.keychain -P "" \
|
||||
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
||||
|
||||
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $KEYCHAIN_PASSWORD build.keychain
|
||||
|
||||
- name: Load package version
|
||||
@@ -571,37 +576,45 @@ jobs:
|
||||
|
||||
- name: Install Node dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Set up private auth key
|
||||
run: |
|
||||
mkdir ~/private_keys
|
||||
cat << EOF > ~/private_keys/AuthKey_UFD296548T.p8
|
||||
${{ secrets.APP_STORE_CONNECT_AUTH_KEY }}
|
||||
EOF
|
||||
|
||||
- name: Build application
|
||||
run: npm run dist:mac
|
||||
env:
|
||||
APPLE_ID_USERNAME: ${{ secrets.APPLE_ID_USERNAME }}
|
||||
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
|
||||
APP_STORE_CONNECT_TEAM_ISSUER: ${{ secrets.APP_STORE_CONNECT_TEAM_ISSUER }}
|
||||
APP_STORE_CONNECT_AUTH_KEY: UFD296548T
|
||||
APP_STORE_CONNECT_AUTH_KEY_PATH: ~/private_keys/AuthKey_UFD296548T.p8
|
||||
CSC_FOR_PULL_REQUEST: true
|
||||
|
||||
- name: Upload .zip artifact
|
||||
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
|
||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
with:
|
||||
name: Bitwarden-Connector-${{ env._PACKAGE_VERSION }}-mac.zip
|
||||
path: ./dist/Bitwarden-Connector-${{ env._PACKAGE_VERSION }}-mac.zip
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload .dmg artifact
|
||||
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
|
||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
with:
|
||||
name: Bitwarden-Connector-${{ env._PACKAGE_VERSION }}.dmg
|
||||
path: ./dist/Bitwarden-Connector-${{ env._PACKAGE_VERSION }}.dmg
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload .dmg Blockmap artifact
|
||||
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
|
||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
with:
|
||||
name: Bitwarden-Connector-${{ env._PACKAGE_VERSION }}.dmg.blockmap
|
||||
path: ./dist/Bitwarden-Connector-${{ env._PACKAGE_VERSION }}.dmg.blockmap
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload latest auto-update artifact
|
||||
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
|
||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
with:
|
||||
name: latest-mac.yml
|
||||
path: ./dist/latest-mac.yml
|
||||
@@ -622,37 +635,11 @@ jobs:
|
||||
- macos-gui
|
||||
steps:
|
||||
- name: Check if any job failed
|
||||
if: ${{ (github.ref == 'refs/heads/main') || (github.ref == 'refs/heads/rc') }}
|
||||
env:
|
||||
CLOC_STATUS: ${{ needs.cloc.result }}
|
||||
SETUP_STATUS: ${{ needs.setup.result }}
|
||||
LINUX_CLI_STATUS: ${{ needs.linux-cli.result }}
|
||||
MACOS_CLI_STATUS: ${{ needs.macos-cli.result }}
|
||||
WINDOWS_CLI_STATUS: ${{ needs.windows-cli.result }}
|
||||
WINDOWS_GUI_STATUS: ${{ needs.windows-gui.result }}
|
||||
LINUX_GUI_STATUS: ${{ needs.linux-gui.result }}
|
||||
MACOS_GUI_STATUS: ${{ needs.macos-gui.result }}
|
||||
run: |
|
||||
if [ "$CLOC_STATUS" = "failure" ]; then
|
||||
exit 1
|
||||
elif [ "$SETUP_STATUS" = "failure" ]; then
|
||||
exit 1
|
||||
elif [ "$LINUX_CLI_STATUS" = "failure" ]; then
|
||||
exit 1
|
||||
elif [ "$MACOS_CLI_STATUS" = "failure" ]; then
|
||||
exit 1
|
||||
elif [ "$WINDOWS_CLI_STATUS" = "failure" ]; then
|
||||
exit 1
|
||||
elif [ "$WINDOWS_GUI_STATUS" = "failure" ]; then
|
||||
exit 1
|
||||
elif [ "$LINUX_GUI_STATUS" = "failure" ]; then
|
||||
exit 1
|
||||
elif [ "$MACOS_GUI_STATUS" = "failure" ]; then
|
||||
exit 1
|
||||
fi
|
||||
if: github.ref == 'refs/heads/main' && contains(needs.*.result, 'failure')
|
||||
run: exit 1
|
||||
|
||||
- name: Login to Azure - CI subscription
|
||||
uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7
|
||||
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
|
||||
if: failure()
|
||||
with:
|
||||
creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
|
||||
@@ -666,7 +653,7 @@ jobs:
|
||||
secrets: "devops-alerts-slack-webhook-url"
|
||||
|
||||
- name: Notify Slack on failure
|
||||
uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f # v2.0.0
|
||||
uses: act10ns/slack@44541246747a30eb3102d87f7a4cc5471b0ffb7d # v2.1.0
|
||||
if: failure()
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ steps.retrieve-secrets.outputs.devops-alerts-slack-webhook-url }}
|
||||
|
||||
36
.github/workflows/release.yml
vendored
36
.github/workflows/release.yml
vendored
@@ -22,14 +22,14 @@ jobs:
|
||||
release-version: ${{ steps.version.outputs.version }}
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
||||
- name: Branch check
|
||||
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
|
||||
run: |
|
||||
if [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ "$GITHUB_REF" != "refs/heads/hotfix-rc" ]]; then
|
||||
if [[ "$GITHUB_REF" != "refs/heads/main" ]]; then
|
||||
echo "==================================="
|
||||
echo "[!] Can only release from the 'rc' or 'hotfix-rc' branches"
|
||||
echo "[!] Can only release from the 'main' branch"
|
||||
echo "==================================="
|
||||
exit 1
|
||||
fi
|
||||
@@ -47,16 +47,6 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
needs: setup
|
||||
steps:
|
||||
- name: Create GitHub deployment
|
||||
uses: chrnorm/deployment-action@d42cde7132fcec920de534fffc3be83794335c00 # v2.0.5
|
||||
id: deployment
|
||||
with:
|
||||
token: '${{ secrets.GITHUB_TOKEN }}'
|
||||
initial-status: 'in_progress'
|
||||
environment: 'production'
|
||||
description: 'Deployment ${{ needs.setup.outputs.release-version }} from branch ${{ github.ref_name }}'
|
||||
task: release
|
||||
|
||||
- name: Download all artifacts
|
||||
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
|
||||
uses: bitwarden/gh-actions/download-artifacts@main
|
||||
@@ -65,7 +55,7 @@ jobs:
|
||||
workflow_conclusion: success
|
||||
branch: ${{ github.ref_name }}
|
||||
|
||||
- name: Download all artifacts
|
||||
- name: Dry Run - Download all artifacts
|
||||
if: ${{ github.event.inputs.release_type == 'Dry Run' }}
|
||||
uses: bitwarden/gh-actions/download-artifacts@main
|
||||
with:
|
||||
@@ -75,7 +65,7 @@ jobs:
|
||||
|
||||
- name: Create release
|
||||
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
|
||||
uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0
|
||||
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
|
||||
env:
|
||||
PKG_VERSION: ${{ needs.setup.outputs.release-version }}
|
||||
with:
|
||||
@@ -101,19 +91,3 @@ jobs:
|
||||
body: "<insert release notes here>"
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
draft: true
|
||||
|
||||
- name: Update deployment status to Success
|
||||
if: ${{ success() }}
|
||||
uses: chrnorm/deployment-status@2afb7d27101260f4a764219439564d954d10b5b0 # v2.0.1
|
||||
with:
|
||||
token: '${{ secrets.GITHUB_TOKEN }}'
|
||||
state: 'success'
|
||||
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
|
||||
|
||||
- name: Update deployment status to Failure
|
||||
if: ${{ failure() }}
|
||||
uses: chrnorm/deployment-status@2afb7d27101260f4a764219439564d954d10b5b0 # v2.0.1
|
||||
with:
|
||||
token: '${{ secrets.GITHUB_TOKEN }}'
|
||||
state: 'failure'
|
||||
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
|
||||
|
||||
78
.github/workflows/scan.yml
vendored
Normal file
78
.github/workflows/scan.yml
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
name: Scan
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
pull_request_target:
|
||||
types: [opened, synchronize]
|
||||
|
||||
jobs:
|
||||
check-run:
|
||||
name: Check PR run
|
||||
uses: bitwarden/gh-actions/.github/workflows/check-run.yml@main
|
||||
|
||||
sast:
|
||||
name: SAST scan
|
||||
runs-on: ubuntu-22.04
|
||||
needs: check-run
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
security-events: write
|
||||
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
|
||||
- name: Scan with Checkmarx
|
||||
uses: checkmarx/ast-github-action@6c56658230f79c227a55120e9b24845d574d5225 # 2.0.31
|
||||
env:
|
||||
INCREMENTAL: "${{ contains(github.event_name, 'pull_request') && '--sast-incremental' || '' }}"
|
||||
with:
|
||||
project_name: ${{ github.repository }}
|
||||
cx_tenant: ${{ secrets.CHECKMARX_TENANT }}
|
||||
base_uri: https://ast.checkmarx.net/
|
||||
cx_client_id: ${{ secrets.CHECKMARX_CLIENT_ID }}
|
||||
cx_client_secret: ${{ secrets.CHECKMARX_SECRET }}
|
||||
additional_params: |
|
||||
--report-format sarif \
|
||||
--filter "state=TO_VERIFY;PROPOSED_NOT_EXPLOITABLE;CONFIRMED;URGENT" \
|
||||
--output-path . ${{ env.INCREMENTAL }}
|
||||
|
||||
- name: Upload Checkmarx results to GitHub
|
||||
uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
|
||||
with:
|
||||
sarif_file: cx_result.sarif
|
||||
|
||||
quality:
|
||||
name: Quality scan
|
||||
runs-on: ubuntu-22.04
|
||||
needs: check-run
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
|
||||
- name: Scan with SonarCloud
|
||||
uses: sonarsource/sonarcloud-github-action@eb211723266fe8e83102bac7361f0a05c3ac1d1b # v3.0.0
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
args: >
|
||||
-Dsonar.organization=${{ github.repository_owner }}
|
||||
-Dsonar.projectKey=${{ github.repository_owner }}_${{ github.event.repository.name }}
|
||||
-Dsonar.tests=.
|
||||
-Dsonar.sources=.
|
||||
-Dsonar.test.inclusions=**/*.spec.ts
|
||||
-Dsonar.exclusions=**/*.spec.ts
|
||||
88
.github/workflows/test.yml
vendored
Normal file
88
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
name: Testing
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
check-test-secrets:
|
||||
name: Check for test secrets
|
||||
runs-on: ubuntu-22.04
|
||||
outputs:
|
||||
available: ${{ steps.check-test-secrets.outputs.available }}
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
steps:
|
||||
- name: Check
|
||||
id: check-test-secrets
|
||||
run: |
|
||||
if [ "${{ secrets.CODECOV_TOKEN }}" != '' ]; then
|
||||
echo "available=true" >> $GITHUB_OUTPUT;
|
||||
else
|
||||
echo "available=false" >> $GITHUB_OUTPUT;
|
||||
fi
|
||||
|
||||
testing:
|
||||
name: Run tests
|
||||
if: ${{ startsWith(github.head_ref, 'version_bump_') == false }}
|
||||
runs-on: ubuntu-22.04
|
||||
needs: check-test-secrets
|
||||
permissions:
|
||||
checks: write
|
||||
contents: read
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- name: Check out repo
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
||||
- name: Get Node version
|
||||
id: retrieve-node-version
|
||||
run: |
|
||||
NODE_NVMRC=$(cat .nvmrc)
|
||||
NODE_VERSION=${NODE_NVMRC/v/''}
|
||||
echo "node_version=$NODE_VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
|
||||
with:
|
||||
cache: 'npm'
|
||||
cache-dependency-path: '**/package-lock.json'
|
||||
node-version: ${{ steps.retrieve-node-version.outputs.node_version }}
|
||||
|
||||
- name: Install Node dependencies
|
||||
run: npm ci
|
||||
|
||||
# We use isolatedModules: true which disables typechecking in tests
|
||||
# Tests in apps/ are typechecked when their app is built, so we just do it here for libs/
|
||||
# See https://bitwarden.atlassian.net/browse/EC-497
|
||||
- name: Run typechecking
|
||||
run: npm run test:types --coverage
|
||||
|
||||
- name: Run tests
|
||||
run: npm run test --coverage
|
||||
|
||||
- name: Report test results
|
||||
uses: dorny/test-reporter@31a54ee7ebcacc03a09ea97a7e5465a47b84aea5 # v1.9.1
|
||||
if: ${{ needs.check-test-secrets.outputs.available == 'true' && !cancelled() }}
|
||||
with:
|
||||
name: Test Results
|
||||
path: "junit.xml"
|
||||
reporter: jest-junit
|
||||
fail-on-error: true
|
||||
|
||||
- name: Upload coverage to codecov.io
|
||||
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
|
||||
if: ${{ needs.check-test-secrets.outputs.available == 'true' }}
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
- name: Upload results to codecov.io
|
||||
uses: codecov/test-results-action@1b5b448b98e58ba90d1a1a1d9fcb72ca2263be46 # v1.0.0
|
||||
if: ${{ needs.check-test-secrets.outputs.available == 'true' }}
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
146
.github/workflows/version-bump.yml
vendored
146
.github/workflows/version-bump.yml
vendored
@@ -1,26 +1,44 @@
|
||||
---
|
||||
name: Version Bump
|
||||
run-name: Version Bump - v${{ inputs.version_number }}
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version_number:
|
||||
description: "New version (example: '2024.1.0')"
|
||||
required: true
|
||||
version_number_override:
|
||||
description: "New version override (leave blank for automatic calculation, example: '2024.1.0')"
|
||||
required: false
|
||||
type: string
|
||||
cut_rc_branch:
|
||||
description: "Cut RC branch?"
|
||||
default: true
|
||||
enable_slack_notification:
|
||||
description: "Enable Slack notifications for upcoming release?"
|
||||
default: false
|
||||
type: boolean
|
||||
|
||||
jobs:
|
||||
bump_version:
|
||||
name: "Bump Version to v${{ inputs.version_number }}"
|
||||
name: Bump Version
|
||||
runs-on: ubuntu-22.04
|
||||
outputs:
|
||||
version: ${{ steps.set-final-version-output.outputs.version }}
|
||||
steps:
|
||||
- name: Validate version input
|
||||
if: ${{ inputs.version_number_override != '' }}
|
||||
uses: bitwarden/gh-actions/version-check@main
|
||||
with:
|
||||
version: ${{ inputs.version_number_override }}
|
||||
|
||||
- name: Slack Notification Check
|
||||
run: |
|
||||
if [[ "${{ inputs.enable_slack_notification }}" == true ]]; then
|
||||
echo "Slack notifications enabled."
|
||||
else
|
||||
echo "Slack notifications disabled."
|
||||
fi
|
||||
|
||||
- name: Checkout Branch
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
||||
- name: Login to Azure - CI Subscription
|
||||
uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7
|
||||
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
|
||||
with:
|
||||
creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
|
||||
|
||||
@@ -30,36 +48,40 @@ jobs:
|
||||
with:
|
||||
keyvault: "bitwarden-ci"
|
||||
secrets: "github-gpg-private-key,
|
||||
github-gpg-private-key-passphrase,
|
||||
github-pat-bitwarden-devops-bot-repo-scope"
|
||||
|
||||
- name: Checkout Branch
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
with:
|
||||
ref: main
|
||||
repository: bitwarden/directory-connector
|
||||
github-gpg-private-key-passphrase"
|
||||
|
||||
- name: Import GPG key
|
||||
uses: crazy-max/ghaction-import-gpg@82a020f1f7f605c65dd2449b392a52c3fcfef7ef # v6.0.0
|
||||
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0
|
||||
with:
|
||||
gpg_private_key: ${{ steps.retrieve-secrets.outputs.github-gpg-private-key }}
|
||||
passphrase: ${{ steps.retrieve-secrets.outputs.github-gpg-private-key-passphrase }}
|
||||
git_user_signingkey: true
|
||||
git_commit_gpgsign: true
|
||||
|
||||
- name: Setup git
|
||||
run: |
|
||||
git config --local user.email "106330231+bitwarden-devops-bot@users.noreply.github.com"
|
||||
git config --local user.name "bitwarden-devops-bot"
|
||||
|
||||
- name: Create Version Branch
|
||||
id: create-branch
|
||||
run: |
|
||||
NAME=version_bump_${{ github.ref_name }}_${{ inputs.version_number }}
|
||||
NAME=version_bump_${{ github.ref_name }}_$(date +"%Y-%m-%d")
|
||||
git switch -c $NAME
|
||||
echo "name=$NAME" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Verify input version
|
||||
env:
|
||||
NEW_VERSION: ${{ inputs.version_number }}
|
||||
- name: Get current version
|
||||
id: current-version
|
||||
run: |
|
||||
CURRENT_VERSION=$(cat package.json | jq -r '.version')
|
||||
echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Verify input version
|
||||
if: ${{ inputs.version_number_override != '' }}
|
||||
env:
|
||||
CURRENT_VERSION: ${{ steps.current-version.outputs.version }}
|
||||
NEW_VERSION: ${{ inputs.version_number_override }}
|
||||
run: |
|
||||
# Error if version has not changed.
|
||||
if [[ "$NEW_VERSION" == "$CURRENT_VERSION" ]]; then
|
||||
echo "Version has not changed."
|
||||
@@ -75,16 +97,37 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Bump Version - Package
|
||||
- name: Calculate next release version
|
||||
if: ${{ inputs.version_number_override == '' }}
|
||||
id: calculate-next-version
|
||||
uses: bitwarden/gh-actions/version-next@main
|
||||
with:
|
||||
version: ${{ steps.current-version.outputs.version }}
|
||||
|
||||
- name: Bump Version - Package - Version Override
|
||||
if: ${{ inputs.version_number_override != '' }}
|
||||
id: bump-version-override
|
||||
uses: bitwarden/gh-actions/version-bump@main
|
||||
with:
|
||||
version: ${{ inputs.version_number }}
|
||||
file_path: "./package.json"
|
||||
version: ${{ inputs.version_number_override }}
|
||||
|
||||
- name: Setup git
|
||||
- name: Bump Version - Package - Automatic Calculation
|
||||
if: ${{ inputs.version_number_override == '' }}
|
||||
id: bump-version-automatic
|
||||
uses: bitwarden/gh-actions/version-bump@main
|
||||
with:
|
||||
file_path: "./package.json"
|
||||
version: ${{ steps.calculate-next-version.outputs.version }}
|
||||
|
||||
- name: Set final version output
|
||||
id: set-final-version-output
|
||||
run: |
|
||||
git config --local user.email "106330231+bitwarden-devops-bot@users.noreply.github.com"
|
||||
git config --local user.name "bitwarden-devops-bot"
|
||||
if [[ "${{ steps.bump-version-override.outcome }}" == "success" ]]; then
|
||||
echo "version=${{ inputs.version_number_override }}" >> $GITHUB_OUTPUT
|
||||
elif [[ "${{ steps.bump-version-automatic.outcome }}" == "success" ]]; then
|
||||
echo "version=${{ steps.calculate-next-version.outputs.version }}" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Check if version changed
|
||||
id: version-changed
|
||||
@@ -98,7 +141,7 @@ jobs:
|
||||
|
||||
- name: Commit files
|
||||
if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }}
|
||||
run: git commit -m "Bumped version to ${{ inputs.version_number }}" -a
|
||||
run: git commit -m "Bumped version to ${{ steps.set-final-version-output.outputs.version }}" -a
|
||||
|
||||
- name: Push changes
|
||||
if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }}
|
||||
@@ -106,13 +149,21 @@ jobs:
|
||||
PR_BRANCH: ${{ steps.create-branch.outputs.name }}
|
||||
run: git push -u origin $PR_BRANCH
|
||||
|
||||
- name: Generate GH App token
|
||||
uses: actions/create-github-app-token@3378cda945da322a8db4b193e19d46352ebe2de5 # v1.10.4
|
||||
id: app-token
|
||||
with:
|
||||
app-id: ${{ secrets.BW_GHAPP_ID }}
|
||||
private-key: ${{ secrets.BW_GHAPP_KEY }}
|
||||
owner: ${{ github.repository_owner }}
|
||||
|
||||
- name: Create Version PR
|
||||
if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }}
|
||||
id: create-pr
|
||||
env:
|
||||
GH_TOKEN: ${{ steps.retrieve-secrets.outputs.github-pat-bitwarden-devops-bot-repo-scope }}
|
||||
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||
PR_BRANCH: ${{ steps.create-branch.outputs.name }}
|
||||
TITLE: "Bump version to ${{ inputs.version_number }}"
|
||||
TITLE: "Bump version to ${{ steps.set-final-version-output.outputs.version }}"
|
||||
run: |
|
||||
PR_URL=$(gh pr create --title "$TITLE" \
|
||||
--base "main" \
|
||||
@@ -128,42 +179,27 @@ jobs:
|
||||
- [X] Other
|
||||
|
||||
## Objective
|
||||
Automated version bump to ${{ inputs.version_number }}")
|
||||
Automated version bump to ${{ steps.set-final-version-output.outputs.version }}")
|
||||
echo "pr_number=${PR_URL##*/}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Approve PR
|
||||
if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }}
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PR_NUMBER: ${{ steps.create-pr.outputs.pr_number }}
|
||||
run: gh pr review $PR_NUMBER --approve
|
||||
|
||||
- name: Merge PR
|
||||
if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }}
|
||||
env:
|
||||
GH_TOKEN: ${{ steps.retrieve-secrets.outputs.github-pat-bitwarden-devops-bot-repo-scope }}
|
||||
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||
PR_NUMBER: ${{ steps.create-pr.outputs.pr_number }}
|
||||
run: gh pr merge $PR_NUMBER --squash --auto --delete-branch
|
||||
|
||||
cut_rc:
|
||||
name: Cut RC branch
|
||||
needs: bump_version
|
||||
if: ${{ inputs.cut_rc_branch == true }}
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout Branch
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- name: Report upcoming release version to Slack
|
||||
if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' && inputs.enable_slack_notification == true }}
|
||||
uses: bitwarden/gh-actions/report-upcoming-release-version@main
|
||||
with:
|
||||
ref: main
|
||||
|
||||
- name: Check if RC branch exists
|
||||
run: |
|
||||
remote_rc_branch_check=$(git ls-remote --heads origin rc | wc -l)
|
||||
if [[ "${remote_rc_branch_check}" -gt 0 ]]; then
|
||||
echo "Remote RC branch exists."
|
||||
echo "Please delete current RC branch before running again."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Cut RC branch
|
||||
run: |
|
||||
git switch --quiet --create rc
|
||||
git push --quiet --set-upstream origin rc
|
||||
version: ${{ steps.set-final-version-output.outputs.version }}
|
||||
project: ${{ github.repository }}
|
||||
AZURE_KV_CI_SERVICE_PRINCIPAL: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
|
||||
|
||||
11
.github/workflows/workflow-linter.yml
vendored
11
.github/workflows/workflow-linter.yml
vendored
@@ -1,11 +0,0 @@
|
||||
---
|
||||
name: Workflow Linter
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/**
|
||||
|
||||
jobs:
|
||||
call-workflow:
|
||||
uses: bitwarden/gh-actions/.github/workflows/workflow-linter.yml@main
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -26,6 +26,7 @@ npm-debug.log
|
||||
# Build directories
|
||||
dist
|
||||
build
|
||||
build-cli
|
||||
.angular/cache
|
||||
|
||||
# Testing
|
||||
|
||||
@@ -1,27 +1,50 @@
|
||||
const { pathsToModuleNameMapper } = require("ts-jest");
|
||||
|
||||
const { compilerOptions } = require("./tsconfig");
|
||||
|
||||
/** @type {import('jest').Config} */
|
||||
const tsPreset = require("ts-jest/jest-preset");
|
||||
const angularPreset = require("jest-preset-angular/jest-preset");
|
||||
const { defaultTransformerOptions } = require("jest-preset-angular/presets");
|
||||
|
||||
/** @type {import('ts-jest').JestConfigWithTsJest} */
|
||||
module.exports = {
|
||||
// ...tsPreset,
|
||||
// ...angularPreset,
|
||||
preset: "jest-preset-angular",
|
||||
|
||||
reporters: ["default", "jest-junit"],
|
||||
|
||||
collectCoverage: true,
|
||||
// Ensure we collect coverage from files without tests
|
||||
collectCoverageFrom: ["src/**/*.ts"],
|
||||
coverageReporters: ["html", "lcov"],
|
||||
coverageDirectory: "coverage",
|
||||
|
||||
moduleNameMapper: pathsToModuleNameMapper(compilerOptions?.paths || {}, {
|
||||
prefix: "<rootDir>/",
|
||||
}),
|
||||
projects: [
|
||||
"<rootDir>/jslib/angular/jest.config.js",
|
||||
"<rootDir>/jslib/common/jest.config.js",
|
||||
"<rootDir>/jslib/electron/jest.config.js",
|
||||
"<rootDir>/jslib/node/jest.config.js",
|
||||
],
|
||||
testEnvironment: "jsdom",
|
||||
testMatch: ["**/+(*.)+(spec).+(ts)"],
|
||||
|
||||
roots: ["<rootDir>"],
|
||||
modulePaths: [compilerOptions.baseUrl],
|
||||
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: "<rootDir>/" }),
|
||||
setupFilesAfterEnv: ["<rootDir>/test.setup.ts"],
|
||||
|
||||
// Workaround for a memory leak that crashes tests in CI:
|
||||
// https://github.com/facebook/jest/issues/9430#issuecomment-1149882002
|
||||
// Also anecdotally improves performance when run locally
|
||||
maxWorkers: 3,
|
||||
|
||||
transform: {
|
||||
"^.+\\.tsx?$": [
|
||||
"jest-preset-angular",
|
||||
// 'ts-jest',
|
||||
{
|
||||
...defaultTransformerOptions,
|
||||
tsconfig: "./tsconfig.json",
|
||||
// Further workaround for memory leak, recommended here:
|
||||
// https://github.com/kulshekhar/ts-jest/issues/1967#issuecomment-697494014
|
||||
// Makes tests run faster and reduces size/rate of leak, but loses typechecking on test code
|
||||
// See https://bitwarden.atlassian.net/browse/EC-497 for more info
|
||||
isolatedModules: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
const { pathsToModuleNameMapper } = require("ts-jest");
|
||||
|
||||
const { compilerOptions } = require("../shared/tsconfig.libs");
|
||||
|
||||
const sharedConfig = require("../shared/jest.config.angular");
|
||||
|
||||
/** @type {import('jest').Config} */
|
||||
module.exports = {
|
||||
...sharedConfig,
|
||||
displayName: "libs/angular tests",
|
||||
preset: "jest-preset-angular",
|
||||
setupFilesAfterEnv: ["<rootDir>/test.setup.ts"],
|
||||
moduleNameMapper: pathsToModuleNameMapper(compilerOptions?.paths || {}, {
|
||||
prefix: "<rootDir>/",
|
||||
}),
|
||||
};
|
||||
@@ -12,10 +12,10 @@
|
||||
{{ enforcedPolicyMessage }}
|
||||
<ul>
|
||||
<li *ngIf="enforcedPolicyOptions?.minComplexity > 0">
|
||||
{{ "policyInEffectMinComplexity" | i18n : getPasswordScoreAlertDisplay() }}
|
||||
{{ "policyInEffectMinComplexity" | i18n: getPasswordScoreAlertDisplay() }}
|
||||
</li>
|
||||
<li *ngIf="enforcedPolicyOptions?.minLength > 0">
|
||||
{{ "policyInEffectMinLength" | i18n : enforcedPolicyOptions?.minLength.toString() }}
|
||||
{{ "policyInEffectMinLength" | i18n: enforcedPolicyOptions?.minLength.toString() }}
|
||||
</li>
|
||||
<li *ngIf="enforcedPolicyOptions?.requireUpper">
|
||||
{{ "policyInEffectUppercase" | i18n }}
|
||||
@@ -27,7 +27,7 @@
|
||||
{{ "policyInEffectNumbers" | i18n }}
|
||||
</li>
|
||||
<li *ngIf="enforcedPolicyOptions?.requireSpecial">
|
||||
{{ "policyInEffectSpecial" | i18n : "!@#$%^&*" }}
|
||||
{{ "policyInEffectSpecial" | i18n: "!@#$%^&*" }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -19,7 +19,7 @@ export class EnvironmentComponent {
|
||||
constructor(
|
||||
protected platformUtilsService: PlatformUtilsService,
|
||||
protected environmentService: EnvironmentService,
|
||||
protected i18nService: I18nService
|
||||
protected i18nService: I18nService,
|
||||
) {
|
||||
const urls = this.environmentService.getUrls();
|
||||
|
||||
|
||||
@@ -34,7 +34,10 @@ export class IconComponent implements OnChanges {
|
||||
|
||||
private iconsUrl: string;
|
||||
|
||||
constructor(environmentService: EnvironmentService, private stateService: StateService) {
|
||||
constructor(
|
||||
environmentService: EnvironmentService,
|
||||
private stateService: StateService,
|
||||
) {
|
||||
this.iconsUrl = environmentService.getIconsUrl();
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ export class DynamicModalComponent implements AfterViewInit, OnDestroy {
|
||||
private cd: ChangeDetectorRef,
|
||||
private el: ElementRef<HTMLElement>,
|
||||
private focusTrapFactory: ConfigurableFocusTrapFactory,
|
||||
public modalRef: ModalRef
|
||||
public modalRef: ModalRef,
|
||||
) {}
|
||||
|
||||
ngAfterViewInit() {
|
||||
@@ -47,7 +47,7 @@ export class DynamicModalComponent implements AfterViewInit, OnDestroy {
|
||||
|
||||
this.modalRef.created(this.el.nativeElement);
|
||||
this.focusTrap = this.focusTrapFactory.create(
|
||||
this.el.nativeElement.querySelector(".modal-dialog")
|
||||
this.el.nativeElement.querySelector(".modal-dialog"),
|
||||
);
|
||||
if (this.el.nativeElement.querySelector("[appAutoFocus]") == null) {
|
||||
this.focusTrap.focusFirstTabbableElementWhenReady();
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
import { InjectFlags, InjectOptions, Injector, ProviderToken } from "@angular/core";
|
||||
|
||||
export class ModalInjector implements Injector {
|
||||
constructor(private _parentInjector: Injector, private _additionalTokens: WeakMap<any, any>) {}
|
||||
constructor(
|
||||
private _parentInjector: Injector,
|
||||
private _additionalTokens: WeakMap<any, any>,
|
||||
) {}
|
||||
|
||||
get<T>(
|
||||
token: ProviderToken<T>,
|
||||
notFoundValue: undefined,
|
||||
options: InjectOptions & { optional?: false }
|
||||
options: InjectOptions & { optional?: false },
|
||||
): T;
|
||||
get<T>(token: ProviderToken<T>, notFoundValue: null, options: InjectOptions): T;
|
||||
get<T>(token: ProviderToken<T>, notFoundValue?: T, options?: InjectOptions | InjectFlags): T;
|
||||
|
||||
@@ -19,7 +19,7 @@ export class PasswordRepromptComponent {
|
||||
private modalRef: ModalRef,
|
||||
private cryptoService: CryptoService,
|
||||
private platformUtilsService: PlatformUtilsService,
|
||||
private i18nService: I18nService
|
||||
private i18nService: I18nService,
|
||||
) {}
|
||||
|
||||
togglePassword() {
|
||||
@@ -31,7 +31,7 @@ export class PasswordRepromptComponent {
|
||||
this.platformUtilsService.showToast(
|
||||
"error",
|
||||
this.i18nService.t("errorOccurred"),
|
||||
this.i18nService.t("invalidMasterPassword")
|
||||
this.i18nService.t("invalidMasterPassword"),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,10 @@ import {
|
||||
preserveWhitespaces: false,
|
||||
})
|
||||
export class BitwardenToast extends BaseToast {
|
||||
constructor(protected toastrService: ToastrService, public toastPackage: ToastPackage) {
|
||||
constructor(
|
||||
protected toastrService: ToastrService,
|
||||
public toastPackage: ToastPackage,
|
||||
) {
|
||||
super(toastrService, toastPackage);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,10 @@ export class A11yTitleDirective {
|
||||
|
||||
private title: string;
|
||||
|
||||
constructor(private el: ElementRef, private renderer: Renderer2) {}
|
||||
constructor(
|
||||
private el: ElementRef,
|
||||
private renderer: Renderer2,
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
if (!this.el.nativeElement.hasAttribute("title")) {
|
||||
|
||||
@@ -20,7 +20,7 @@ export class ApiActionDirective implements OnChanges {
|
||||
constructor(
|
||||
private el: ElementRef,
|
||||
private validationService: ValidationService,
|
||||
private logService: LogService
|
||||
private logService: LogService,
|
||||
) {}
|
||||
|
||||
ngOnChanges(changes: any) {
|
||||
@@ -43,7 +43,7 @@ export class ApiActionDirective implements OnChanges {
|
||||
}
|
||||
this.logService?.error(`Received API exception: ${e}`);
|
||||
this.validationService.showError(e);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,10 @@ export class AutofocusDirective {
|
||||
|
||||
private autofocus: boolean;
|
||||
|
||||
constructor(private el: ElementRef, private ngZone: NgZone) {}
|
||||
constructor(
|
||||
private el: ElementRef,
|
||||
private ngZone: NgZone,
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
if (!Utils.isMobileBrowser && this.autofocus) {
|
||||
|
||||
@@ -13,7 +13,7 @@ export class BoxRowDirective implements OnInit {
|
||||
|
||||
ngOnInit(): void {
|
||||
this.formEls = Array.from(
|
||||
this.el.querySelectorAll('input:not([type="hidden"]), select, textarea')
|
||||
this.el.querySelectorAll('input:not([type="hidden"]), select, textarea'),
|
||||
);
|
||||
this.formEls.forEach((formEl) => {
|
||||
formEl.addEventListener(
|
||||
@@ -21,7 +21,7 @@ export class BoxRowDirective implements OnInit {
|
||||
() => {
|
||||
this.el.classList.add("active");
|
||||
},
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
formEl.addEventListener(
|
||||
@@ -29,7 +29,7 @@ export class BoxRowDirective implements OnInit {
|
||||
() => {
|
||||
this.el.classList.remove("active");
|
||||
},
|
||||
false
|
||||
false,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -4,7 +4,8 @@ $icomoon-font-path: "/jslib/angular/src/scss/bwicons/fonts/" !default;
|
||||
// New font sheet? Update the font-face information below
|
||||
@font-face {
|
||||
font-family: "#{$icomoon-font-family}";
|
||||
src: url($icomoon-font-path + "bwi-font.svg") format("svg"),
|
||||
src:
|
||||
url($icomoon-font-path + "bwi-font.svg") format("svg"),
|
||||
url($icomoon-font-path + "bwi-font.ttf") format("truetype"),
|
||||
url($icomoon-font-path + "bwi-font.woff") format("woff"),
|
||||
url($icomoon-font-path + "bwi-font.woff2") format("woff2");
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
import { Injectable } from "@angular/core";
|
||||
import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from "@angular/router";
|
||||
|
||||
import { KeyConnectorService } from "@/jslib/common/src/abstractions/keyConnector.service";
|
||||
import { MessagingService } from "@/jslib/common/src/abstractions/messaging.service";
|
||||
import { StateService } from "@/jslib/common/src/abstractions/state.service";
|
||||
import { VaultTimeoutService } from "@/jslib/common/src/abstractions/vaultTimeout.service";
|
||||
|
||||
@Injectable()
|
||||
export class AuthGuardService implements CanActivate {
|
||||
constructor(
|
||||
private vaultTimeoutService: VaultTimeoutService,
|
||||
private router: Router,
|
||||
private messagingService: MessagingService,
|
||||
private keyConnectorService: KeyConnectorService,
|
||||
private stateService: StateService
|
||||
) {}
|
||||
|
||||
async canActivate(route: ActivatedRouteSnapshot, routerState: RouterStateSnapshot) {
|
||||
const isAuthed = await this.stateService.getIsAuthenticated();
|
||||
if (!isAuthed) {
|
||||
this.messagingService.send("authBlocked");
|
||||
return false;
|
||||
}
|
||||
|
||||
const locked = await this.vaultTimeoutService.isLocked();
|
||||
if (locked) {
|
||||
if (routerState != null) {
|
||||
this.messagingService.send("lockedUrl", { url: routerState.url });
|
||||
}
|
||||
this.router.navigate(["lock"], { queryParams: { promptBiometric: true } });
|
||||
return false;
|
||||
}
|
||||
|
||||
if (
|
||||
!routerState.url.includes("remove-password") &&
|
||||
(await this.keyConnectorService.getConvertAccountRequired())
|
||||
) {
|
||||
this.router.navigate(["/remove-password"]);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,191 +1,70 @@
|
||||
import { Injector, LOCALE_ID, NgModule } from "@angular/core";
|
||||
import { LOCALE_ID, NgModule } from "@angular/core";
|
||||
|
||||
import { ApiService as ApiServiceAbstraction } from "@/jslib/common/src/abstractions/api.service";
|
||||
import { AppIdService as AppIdServiceAbstraction } from "@/jslib/common/src/abstractions/appId.service";
|
||||
import { AuditService as AuditServiceAbstraction } from "@/jslib/common/src/abstractions/audit.service";
|
||||
import { AuthService as AuthServiceAbstraction } from "@/jslib/common/src/abstractions/auth.service";
|
||||
import { BroadcasterService as BroadcasterServiceAbstraction } from "@/jslib/common/src/abstractions/broadcaster.service";
|
||||
import { CipherService as CipherServiceAbstraction } from "@/jslib/common/src/abstractions/cipher.service";
|
||||
import { CollectionService as CollectionServiceAbstraction } from "@/jslib/common/src/abstractions/collection.service";
|
||||
import { CryptoService as CryptoServiceAbstraction } from "@/jslib/common/src/abstractions/crypto.service";
|
||||
import { CryptoFunctionService as CryptoFunctionServiceAbstraction } from "@/jslib/common/src/abstractions/cryptoFunction.service";
|
||||
import { EnvironmentService as EnvironmentServiceAbstraction } from "@/jslib/common/src/abstractions/environment.service";
|
||||
import { EventService as EventServiceAbstraction } from "@/jslib/common/src/abstractions/event.service";
|
||||
import { ExportService as ExportServiceAbstraction } from "@/jslib/common/src/abstractions/export.service";
|
||||
import { FileUploadService as FileUploadServiceAbstraction } from "@/jslib/common/src/abstractions/fileUpload.service";
|
||||
import { FolderService as FolderServiceAbstraction } from "@/jslib/common/src/abstractions/folder.service";
|
||||
import { I18nService as I18nServiceAbstraction } from "@/jslib/common/src/abstractions/i18n.service";
|
||||
import { KeyConnectorService as KeyConnectorServiceAbstraction } from "@/jslib/common/src/abstractions/keyConnector.service";
|
||||
import { LogService } from "@/jslib/common/src/abstractions/log.service";
|
||||
import { MessagingService as MessagingServiceAbstraction } from "@/jslib/common/src/abstractions/messaging.service";
|
||||
import { NotificationsService as NotificationsServiceAbstraction } from "@/jslib/common/src/abstractions/notifications.service";
|
||||
import { OrganizationService as OrganizationServiceAbstraction } from "@/jslib/common/src/abstractions/organization.service";
|
||||
import { PasswordGenerationService as PasswordGenerationServiceAbstraction } from "@/jslib/common/src/abstractions/passwordGeneration.service";
|
||||
import { PasswordRepromptService as PasswordRepromptServiceAbstraction } from "@/jslib/common/src/abstractions/passwordReprompt.service";
|
||||
import { PlatformUtilsService as PlatformUtilsServiceAbstraction } from "@/jslib/common/src/abstractions/platformUtils.service";
|
||||
import { PolicyService as PolicyServiceAbstraction } from "@/jslib/common/src/abstractions/policy.service";
|
||||
import { ProviderService as ProviderServiceAbstraction } from "@/jslib/common/src/abstractions/provider.service";
|
||||
import { SearchService as SearchServiceAbstraction } from "@/jslib/common/src/abstractions/search.service";
|
||||
import { SendService as SendServiceAbstraction } from "@/jslib/common/src/abstractions/send.service";
|
||||
import { SettingsService as SettingsServiceAbstraction } from "@/jslib/common/src/abstractions/settings.service";
|
||||
import { StateService as StateServiceAbstraction } from "@/jslib/common/src/abstractions/state.service";
|
||||
import { StateMigrationService as StateMigrationServiceAbstraction } from "@/jslib/common/src/abstractions/stateMigration.service";
|
||||
import { StorageService as StorageServiceAbstraction } from "@/jslib/common/src/abstractions/storage.service";
|
||||
import { SyncService as SyncServiceAbstraction } from "@/jslib/common/src/abstractions/sync.service";
|
||||
import { TokenService as TokenServiceAbstraction } from "@/jslib/common/src/abstractions/token.service";
|
||||
import { TotpService as TotpServiceAbstraction } from "@/jslib/common/src/abstractions/totp.service";
|
||||
import { TwoFactorService as TwoFactorServiceAbstraction } from "@/jslib/common/src/abstractions/twoFactor.service";
|
||||
import { UserVerificationService as UserVerificationServiceAbstraction } from "@/jslib/common/src/abstractions/userVerification.service";
|
||||
import { UsernameGenerationService as UsernameGenerationServiceAbstraction } from "@/jslib/common/src/abstractions/usernameGeneration.service";
|
||||
import { VaultTimeoutService as VaultTimeoutServiceAbstraction } from "@/jslib/common/src/abstractions/vaultTimeout.service";
|
||||
import { StateFactory } from "@/jslib/common/src/factories/stateFactory";
|
||||
import { Account } from "@/jslib/common/src/models/domain/account";
|
||||
import { GlobalState } from "@/jslib/common/src/models/domain/globalState";
|
||||
import { ApiService } from "@/jslib/common/src/services/api.service";
|
||||
import { AppIdService } from "@/jslib/common/src/services/appId.service";
|
||||
import { AuditService } from "@/jslib/common/src/services/audit.service";
|
||||
import { AuthService } from "@/jslib/common/src/services/auth.service";
|
||||
import { CipherService } from "@/jslib/common/src/services/cipher.service";
|
||||
import { CollectionService } from "@/jslib/common/src/services/collection.service";
|
||||
import { ConsoleLogService } from "@/jslib/common/src/services/consoleLog.service";
|
||||
import { CryptoService } from "@/jslib/common/src/services/crypto.service";
|
||||
import { EnvironmentService } from "@/jslib/common/src/services/environment.service";
|
||||
import { EventService } from "@/jslib/common/src/services/event.service";
|
||||
import { ExportService } from "@/jslib/common/src/services/export.service";
|
||||
import { FileUploadService } from "@/jslib/common/src/services/fileUpload.service";
|
||||
import { FolderService } from "@/jslib/common/src/services/folder.service";
|
||||
import { KeyConnectorService } from "@/jslib/common/src/services/keyConnector.service";
|
||||
import { NotificationsService } from "@/jslib/common/src/services/notifications.service";
|
||||
import { OrganizationService } from "@/jslib/common/src/services/organization.service";
|
||||
import { PasswordGenerationService } from "@/jslib/common/src/services/passwordGeneration.service";
|
||||
import { PolicyService } from "@/jslib/common/src/services/policy.service";
|
||||
import { ProviderService } from "@/jslib/common/src/services/provider.service";
|
||||
import { SearchService } from "@/jslib/common/src/services/search.service";
|
||||
import { SendService } from "@/jslib/common/src/services/send.service";
|
||||
import { SettingsService } from "@/jslib/common/src/services/settings.service";
|
||||
import { StateService } from "@/jslib/common/src/services/state.service";
|
||||
import { StateMigrationService } from "@/jslib/common/src/services/stateMigration.service";
|
||||
import { SyncService } from "@/jslib/common/src/services/sync.service";
|
||||
import { TokenService } from "@/jslib/common/src/services/token.service";
|
||||
import { TotpService } from "@/jslib/common/src/services/totp.service";
|
||||
import { TwoFactorService } from "@/jslib/common/src/services/twoFactor.service";
|
||||
import { UserVerificationService } from "@/jslib/common/src/services/userVerification.service";
|
||||
import { UsernameGenerationService } from "@/jslib/common/src/services/usernameGeneration.service";
|
||||
import { VaultTimeoutService } from "@/jslib/common/src/services/vaultTimeout.service";
|
||||
import { WebCryptoFunctionService } from "@/jslib/common/src/services/webCryptoFunction.service";
|
||||
|
||||
import { AuthGuardService } from "./auth-guard.service";
|
||||
import {
|
||||
SafeInjectionToken,
|
||||
SECURE_STORAGE,
|
||||
WINDOW,
|
||||
} from "../../../../src/app/services/injection-tokens";
|
||||
import { SafeProvider, safeProvider } from "../../../../src/app/services/safe-provider";
|
||||
|
||||
import { BroadcasterService } from "./broadcaster.service";
|
||||
import { LockGuardService } from "./lock-guard.service";
|
||||
import { ModalService } from "./modal.service";
|
||||
import { PasswordRepromptService } from "./passwordReprompt.service";
|
||||
import { UnauthGuardService } from "./unauth-guard.service";
|
||||
import { ValidationService } from "./validation.service";
|
||||
|
||||
@NgModule({
|
||||
declarations: [],
|
||||
providers: [
|
||||
{ provide: "WINDOW", useValue: window },
|
||||
{
|
||||
provide: LOCALE_ID,
|
||||
safeProvider({ provide: WINDOW, useValue: window }),
|
||||
safeProvider({
|
||||
provide: LOCALE_ID as SafeInjectionToken<string>,
|
||||
useFactory: (i18nService: I18nServiceAbstraction) => i18nService.translationLocale,
|
||||
deps: [I18nServiceAbstraction],
|
||||
},
|
||||
ValidationService,
|
||||
AuthGuardService,
|
||||
UnauthGuardService,
|
||||
LockGuardService,
|
||||
ModalService,
|
||||
{
|
||||
}),
|
||||
safeProvider(ValidationService),
|
||||
safeProvider(ModalService),
|
||||
safeProvider({
|
||||
provide: AppIdServiceAbstraction,
|
||||
useClass: AppIdService,
|
||||
deps: [StorageServiceAbstraction],
|
||||
},
|
||||
{
|
||||
provide: AuditServiceAbstraction,
|
||||
useClass: AuditService,
|
||||
deps: [CryptoFunctionServiceAbstraction, ApiServiceAbstraction],
|
||||
},
|
||||
{
|
||||
provide: AuthServiceAbstraction,
|
||||
useClass: AuthService,
|
||||
deps: [
|
||||
CryptoServiceAbstraction,
|
||||
ApiServiceAbstraction,
|
||||
TokenServiceAbstraction,
|
||||
AppIdServiceAbstraction,
|
||||
PlatformUtilsServiceAbstraction,
|
||||
MessagingServiceAbstraction,
|
||||
LogService,
|
||||
KeyConnectorServiceAbstraction,
|
||||
EnvironmentServiceAbstraction,
|
||||
StateServiceAbstraction,
|
||||
TwoFactorServiceAbstraction,
|
||||
I18nServiceAbstraction,
|
||||
],
|
||||
},
|
||||
{
|
||||
provide: CipherServiceAbstraction,
|
||||
useFactory: (
|
||||
cryptoService: CryptoServiceAbstraction,
|
||||
settingsService: SettingsServiceAbstraction,
|
||||
apiService: ApiServiceAbstraction,
|
||||
fileUploadService: FileUploadServiceAbstraction,
|
||||
i18nService: I18nServiceAbstraction,
|
||||
injector: Injector,
|
||||
logService: LogService,
|
||||
stateService: StateServiceAbstraction
|
||||
) =>
|
||||
new CipherService(
|
||||
cryptoService,
|
||||
settingsService,
|
||||
apiService,
|
||||
fileUploadService,
|
||||
i18nService,
|
||||
() => injector.get(SearchServiceAbstraction),
|
||||
logService,
|
||||
stateService
|
||||
),
|
||||
deps: [
|
||||
CryptoServiceAbstraction,
|
||||
SettingsServiceAbstraction,
|
||||
ApiServiceAbstraction,
|
||||
FileUploadServiceAbstraction,
|
||||
I18nServiceAbstraction,
|
||||
Injector, // TODO: Get rid of this circular dependency!
|
||||
LogService,
|
||||
StateServiceAbstraction,
|
||||
],
|
||||
},
|
||||
{
|
||||
provide: FolderServiceAbstraction,
|
||||
useClass: FolderService,
|
||||
deps: [
|
||||
CryptoServiceAbstraction,
|
||||
ApiServiceAbstraction,
|
||||
I18nServiceAbstraction,
|
||||
CipherServiceAbstraction,
|
||||
StateServiceAbstraction,
|
||||
],
|
||||
},
|
||||
{ provide: LogService, useFactory: () => new ConsoleLogService(false) },
|
||||
{
|
||||
provide: CollectionServiceAbstraction,
|
||||
useClass: CollectionService,
|
||||
deps: [CryptoServiceAbstraction, I18nServiceAbstraction, StateServiceAbstraction],
|
||||
},
|
||||
{
|
||||
}),
|
||||
safeProvider({ provide: LogService, useFactory: () => new ConsoleLogService(false), deps: [] }),
|
||||
safeProvider({
|
||||
provide: EnvironmentServiceAbstraction,
|
||||
useClass: EnvironmentService,
|
||||
deps: [StateServiceAbstraction],
|
||||
},
|
||||
{
|
||||
provide: TotpServiceAbstraction,
|
||||
useClass: TotpService,
|
||||
deps: [CryptoFunctionServiceAbstraction, LogService, StateServiceAbstraction],
|
||||
},
|
||||
{ provide: TokenServiceAbstraction, useClass: TokenService, deps: [StateServiceAbstraction] },
|
||||
{
|
||||
}),
|
||||
safeProvider({
|
||||
provide: TokenServiceAbstraction,
|
||||
useClass: TokenService,
|
||||
deps: [StateServiceAbstraction],
|
||||
}),
|
||||
safeProvider({
|
||||
provide: CryptoServiceAbstraction,
|
||||
useClass: CryptoService,
|
||||
deps: [
|
||||
@@ -194,32 +73,22 @@ import { ValidationService } from "./validation.service";
|
||||
LogService,
|
||||
StateServiceAbstraction,
|
||||
],
|
||||
},
|
||||
{
|
||||
provide: PasswordGenerationServiceAbstraction,
|
||||
useClass: PasswordGenerationService,
|
||||
deps: [CryptoServiceAbstraction, PolicyServiceAbstraction, StateServiceAbstraction],
|
||||
},
|
||||
{
|
||||
provide: UsernameGenerationServiceAbstraction,
|
||||
useClass: UsernameGenerationService,
|
||||
deps: [CryptoServiceAbstraction, StateServiceAbstraction],
|
||||
},
|
||||
{
|
||||
}),
|
||||
safeProvider({
|
||||
provide: ApiServiceAbstraction,
|
||||
useFactory: (
|
||||
tokenService: TokenServiceAbstraction,
|
||||
platformUtilsService: PlatformUtilsServiceAbstraction,
|
||||
environmentService: EnvironmentServiceAbstraction,
|
||||
messagingService: MessagingServiceAbstraction,
|
||||
appIdService: AppIdServiceAbstraction
|
||||
appIdService: AppIdServiceAbstraction,
|
||||
) =>
|
||||
new ApiService(
|
||||
tokenService,
|
||||
platformUtilsService,
|
||||
environmentService,
|
||||
appIdService,
|
||||
async (expired: boolean) => messagingService.send("logout", { expired: expired })
|
||||
async (expired: boolean) => messagingService.send("logout", { expired: expired }),
|
||||
),
|
||||
deps: [
|
||||
TokenServiceAbstraction,
|
||||
@@ -228,265 +97,47 @@ import { ValidationService } from "./validation.service";
|
||||
MessagingServiceAbstraction,
|
||||
AppIdServiceAbstraction,
|
||||
],
|
||||
},
|
||||
{
|
||||
provide: FileUploadServiceAbstraction,
|
||||
useClass: FileUploadService,
|
||||
deps: [LogService, ApiServiceAbstraction],
|
||||
},
|
||||
{
|
||||
provide: SyncServiceAbstraction,
|
||||
useFactory: (
|
||||
apiService: ApiServiceAbstraction,
|
||||
settingsService: SettingsServiceAbstraction,
|
||||
folderService: FolderServiceAbstraction,
|
||||
cipherService: CipherServiceAbstraction,
|
||||
cryptoService: CryptoServiceAbstraction,
|
||||
collectionService: CollectionServiceAbstraction,
|
||||
messagingService: MessagingServiceAbstraction,
|
||||
policyService: PolicyServiceAbstraction,
|
||||
sendService: SendServiceAbstraction,
|
||||
logService: LogService,
|
||||
keyConnectorService: KeyConnectorServiceAbstraction,
|
||||
stateService: StateServiceAbstraction,
|
||||
organizationService: OrganizationServiceAbstraction,
|
||||
providerService: ProviderServiceAbstraction
|
||||
) =>
|
||||
new SyncService(
|
||||
apiService,
|
||||
settingsService,
|
||||
folderService,
|
||||
cipherService,
|
||||
cryptoService,
|
||||
collectionService,
|
||||
messagingService,
|
||||
policyService,
|
||||
sendService,
|
||||
logService,
|
||||
keyConnectorService,
|
||||
stateService,
|
||||
organizationService,
|
||||
providerService,
|
||||
async (expired: boolean) => messagingService.send("logout", { expired: expired })
|
||||
),
|
||||
deps: [
|
||||
ApiServiceAbstraction,
|
||||
SettingsServiceAbstraction,
|
||||
FolderServiceAbstraction,
|
||||
CipherServiceAbstraction,
|
||||
CryptoServiceAbstraction,
|
||||
CollectionServiceAbstraction,
|
||||
MessagingServiceAbstraction,
|
||||
PolicyServiceAbstraction,
|
||||
SendServiceAbstraction,
|
||||
LogService,
|
||||
KeyConnectorServiceAbstraction,
|
||||
StateServiceAbstraction,
|
||||
OrganizationServiceAbstraction,
|
||||
ProviderServiceAbstraction,
|
||||
],
|
||||
},
|
||||
{ provide: BroadcasterServiceAbstraction, useClass: BroadcasterService },
|
||||
{
|
||||
provide: SettingsServiceAbstraction,
|
||||
useClass: SettingsService,
|
||||
deps: [StateServiceAbstraction],
|
||||
},
|
||||
{
|
||||
provide: VaultTimeoutServiceAbstraction,
|
||||
useFactory: (
|
||||
cipherService: CipherServiceAbstraction,
|
||||
folderService: FolderServiceAbstraction,
|
||||
collectionService: CollectionServiceAbstraction,
|
||||
cryptoService: CryptoServiceAbstraction,
|
||||
platformUtilsService: PlatformUtilsServiceAbstraction,
|
||||
messagingService: MessagingServiceAbstraction,
|
||||
searchService: SearchServiceAbstraction,
|
||||
tokenService: TokenServiceAbstraction,
|
||||
policyService: PolicyServiceAbstraction,
|
||||
keyConnectorService: KeyConnectorServiceAbstraction,
|
||||
stateService: StateServiceAbstraction
|
||||
) =>
|
||||
new VaultTimeoutService(
|
||||
cipherService,
|
||||
folderService,
|
||||
collectionService,
|
||||
cryptoService,
|
||||
platformUtilsService,
|
||||
messagingService,
|
||||
searchService,
|
||||
tokenService,
|
||||
policyService,
|
||||
keyConnectorService,
|
||||
stateService,
|
||||
null,
|
||||
async (userId?: string) =>
|
||||
messagingService.send("logout", { expired: false, userId: userId })
|
||||
),
|
||||
deps: [
|
||||
CipherServiceAbstraction,
|
||||
FolderServiceAbstraction,
|
||||
CollectionServiceAbstraction,
|
||||
CryptoServiceAbstraction,
|
||||
PlatformUtilsServiceAbstraction,
|
||||
MessagingServiceAbstraction,
|
||||
SearchServiceAbstraction,
|
||||
TokenServiceAbstraction,
|
||||
PolicyServiceAbstraction,
|
||||
KeyConnectorServiceAbstraction,
|
||||
StateServiceAbstraction,
|
||||
],
|
||||
},
|
||||
{
|
||||
}),
|
||||
safeProvider({
|
||||
provide: BroadcasterServiceAbstraction,
|
||||
useClass: BroadcasterService,
|
||||
useAngularDecorators: true,
|
||||
}),
|
||||
safeProvider({
|
||||
provide: StateServiceAbstraction,
|
||||
useFactory: (
|
||||
storageService: StorageServiceAbstraction,
|
||||
secureStorageService: StorageServiceAbstraction,
|
||||
logService: LogService,
|
||||
stateMigrationService: StateMigrationServiceAbstraction
|
||||
stateMigrationService: StateMigrationServiceAbstraction,
|
||||
) =>
|
||||
new StateService(
|
||||
storageService,
|
||||
secureStorageService,
|
||||
logService,
|
||||
stateMigrationService,
|
||||
new StateFactory(GlobalState, Account)
|
||||
new StateFactory(GlobalState, Account),
|
||||
),
|
||||
deps: [
|
||||
StorageServiceAbstraction,
|
||||
"SECURE_STORAGE",
|
||||
SECURE_STORAGE,
|
||||
LogService,
|
||||
StateMigrationServiceAbstraction,
|
||||
],
|
||||
},
|
||||
{
|
||||
}),
|
||||
safeProvider({
|
||||
provide: StateMigrationServiceAbstraction,
|
||||
useFactory: (
|
||||
storageService: StorageServiceAbstraction,
|
||||
secureStorageService: StorageServiceAbstraction
|
||||
secureStorageService: StorageServiceAbstraction,
|
||||
) =>
|
||||
new StateMigrationService(
|
||||
storageService,
|
||||
secureStorageService,
|
||||
new StateFactory(GlobalState, Account)
|
||||
new StateFactory(GlobalState, Account),
|
||||
),
|
||||
deps: [StorageServiceAbstraction, "SECURE_STORAGE"],
|
||||
},
|
||||
{
|
||||
provide: ExportServiceAbstraction,
|
||||
useClass: ExportService,
|
||||
deps: [
|
||||
FolderServiceAbstraction,
|
||||
CipherServiceAbstraction,
|
||||
ApiServiceAbstraction,
|
||||
CryptoServiceAbstraction,
|
||||
],
|
||||
},
|
||||
{
|
||||
provide: SearchServiceAbstraction,
|
||||
useClass: SearchService,
|
||||
deps: [CipherServiceAbstraction, LogService, I18nServiceAbstraction],
|
||||
},
|
||||
{
|
||||
provide: NotificationsServiceAbstraction,
|
||||
useFactory: (
|
||||
syncService: SyncServiceAbstraction,
|
||||
appIdService: AppIdServiceAbstraction,
|
||||
apiService: ApiServiceAbstraction,
|
||||
vaultTimeoutService: VaultTimeoutServiceAbstraction,
|
||||
environmentService: EnvironmentServiceAbstraction,
|
||||
messagingService: MessagingServiceAbstraction,
|
||||
logService: LogService,
|
||||
stateService: StateServiceAbstraction
|
||||
) =>
|
||||
new NotificationsService(
|
||||
syncService,
|
||||
appIdService,
|
||||
apiService,
|
||||
vaultTimeoutService,
|
||||
environmentService,
|
||||
async () => messagingService.send("logout", { expired: true }),
|
||||
logService,
|
||||
stateService
|
||||
),
|
||||
deps: [
|
||||
SyncServiceAbstraction,
|
||||
AppIdServiceAbstraction,
|
||||
ApiServiceAbstraction,
|
||||
VaultTimeoutServiceAbstraction,
|
||||
EnvironmentServiceAbstraction,
|
||||
MessagingServiceAbstraction,
|
||||
LogService,
|
||||
StateServiceAbstraction,
|
||||
],
|
||||
},
|
||||
{
|
||||
provide: CryptoFunctionServiceAbstraction,
|
||||
useClass: WebCryptoFunctionService,
|
||||
deps: ["WINDOW"],
|
||||
},
|
||||
{
|
||||
provide: EventServiceAbstraction,
|
||||
useClass: EventService,
|
||||
deps: [
|
||||
ApiServiceAbstraction,
|
||||
CipherServiceAbstraction,
|
||||
StateServiceAbstraction,
|
||||
LogService,
|
||||
OrganizationServiceAbstraction,
|
||||
],
|
||||
},
|
||||
{
|
||||
provide: PolicyServiceAbstraction,
|
||||
useClass: PolicyService,
|
||||
deps: [StateServiceAbstraction, OrganizationServiceAbstraction, ApiServiceAbstraction],
|
||||
},
|
||||
{
|
||||
provide: SendServiceAbstraction,
|
||||
useClass: SendService,
|
||||
deps: [
|
||||
CryptoServiceAbstraction,
|
||||
ApiServiceAbstraction,
|
||||
FileUploadServiceAbstraction,
|
||||
I18nServiceAbstraction,
|
||||
CryptoFunctionServiceAbstraction,
|
||||
StateServiceAbstraction,
|
||||
],
|
||||
},
|
||||
{
|
||||
provide: KeyConnectorServiceAbstraction,
|
||||
useClass: KeyConnectorService,
|
||||
deps: [
|
||||
StateServiceAbstraction,
|
||||
CryptoServiceAbstraction,
|
||||
ApiServiceAbstraction,
|
||||
TokenServiceAbstraction,
|
||||
LogService,
|
||||
OrganizationServiceAbstraction,
|
||||
CryptoFunctionServiceAbstraction,
|
||||
],
|
||||
},
|
||||
{
|
||||
provide: UserVerificationServiceAbstraction,
|
||||
useClass: UserVerificationService,
|
||||
deps: [CryptoServiceAbstraction, I18nServiceAbstraction, ApiServiceAbstraction],
|
||||
},
|
||||
{ provide: PasswordRepromptServiceAbstraction, useClass: PasswordRepromptService },
|
||||
{
|
||||
provide: OrganizationServiceAbstraction,
|
||||
useClass: OrganizationService,
|
||||
deps: [StateServiceAbstraction],
|
||||
},
|
||||
{
|
||||
provide: ProviderServiceAbstraction,
|
||||
useClass: ProviderService,
|
||||
deps: [StateServiceAbstraction],
|
||||
},
|
||||
{
|
||||
provide: TwoFactorServiceAbstraction,
|
||||
useClass: TwoFactorService,
|
||||
deps: [I18nServiceAbstraction, PlatformUtilsServiceAbstraction],
|
||||
},
|
||||
],
|
||||
deps: [StorageServiceAbstraction, SECURE_STORAGE],
|
||||
}),
|
||||
] satisfies SafeProvider[],
|
||||
})
|
||||
export class JslibServicesModule {}
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
import { Injectable } from "@angular/core";
|
||||
import { CanActivate, Router } from "@angular/router";
|
||||
|
||||
import { StateService } from "@/jslib/common/src/abstractions/state.service";
|
||||
import { VaultTimeoutService } from "@/jslib/common/src/abstractions/vaultTimeout.service";
|
||||
|
||||
@Injectable()
|
||||
export class LockGuardService implements CanActivate {
|
||||
protected homepage = "vault";
|
||||
protected loginpage = "login";
|
||||
constructor(
|
||||
private vaultTimeoutService: VaultTimeoutService,
|
||||
private router: Router,
|
||||
private stateService: StateService
|
||||
) {}
|
||||
|
||||
async canActivate() {
|
||||
if (await this.vaultTimeoutService.isLocked()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const redirectUrl = (await this.stateService.getIsAuthenticated())
|
||||
? [this.homepage]
|
||||
: [this.loginpage];
|
||||
|
||||
this.router.navigate(redirectUrl);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ export class ModalService {
|
||||
constructor(
|
||||
private componentFactoryResolver: ComponentFactoryResolver,
|
||||
private applicationRef: ApplicationRef,
|
||||
private injector: Injector
|
||||
private injector: Injector,
|
||||
) {
|
||||
document.addEventListener("keyup", (event) => {
|
||||
if (event.key === "Escape" && this.modalCount > 0) {
|
||||
@@ -51,7 +51,7 @@ export class ModalService {
|
||||
async openViewRef<T>(
|
||||
componentType: Type<T>,
|
||||
viewContainerRef: ViewContainerRef,
|
||||
setComponentParameters: (component: T) => void = null
|
||||
setComponentParameters: (component: T) => void = null,
|
||||
): Promise<[ModalRef, T]> {
|
||||
const [modalRef, modalComponentRef] = this.openInternal(componentType, null, false);
|
||||
modalComponentRef.instance.setComponentParameters = setComponentParameters;
|
||||
@@ -76,7 +76,7 @@ export class ModalService {
|
||||
|
||||
registerComponentFactoryResolver<T>(
|
||||
componentType: Type<T>,
|
||||
componentFactoryResolver: ComponentFactoryResolver
|
||||
componentFactoryResolver: ComponentFactoryResolver,
|
||||
): void {
|
||||
this.factoryResolvers.set(componentType, componentFactoryResolver);
|
||||
}
|
||||
@@ -92,7 +92,7 @@ export class ModalService {
|
||||
protected openInternal(
|
||||
componentType: Type<any>,
|
||||
config?: ModalConfig,
|
||||
attachToDom?: boolean
|
||||
attachToDom?: boolean,
|
||||
): [ModalRef, ComponentRef<DynamicModalComponent>] {
|
||||
const [modalRef, componentRef] = this.createModalComponent(config);
|
||||
componentRef.instance.childComponentType = componentType;
|
||||
@@ -143,7 +143,7 @@ export class ModalService {
|
||||
dialogEl.style.zIndex = `${this.modalCount}050`;
|
||||
|
||||
const modals = Array.from(
|
||||
el.querySelectorAll('.modal-backdrop, .modal *[data-dismiss="modal"]')
|
||||
el.querySelectorAll('.modal-backdrop, .modal *[data-bs-dismiss="modal"]'),
|
||||
);
|
||||
for (const closeElement of modals) {
|
||||
closeElement.addEventListener("click", () => {
|
||||
@@ -163,7 +163,7 @@ export class ModalService {
|
||||
}
|
||||
|
||||
protected createModalComponent(
|
||||
config: ModalConfig
|
||||
config: ModalConfig,
|
||||
): [ModalRef, ComponentRef<DynamicModalComponent>] {
|
||||
const modalRef = new ModalRef();
|
||||
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
import { Injectable } from "@angular/core";
|
||||
|
||||
import { KeyConnectorService } from "@/jslib/common/src/abstractions/keyConnector.service";
|
||||
import { PasswordRepromptService as PasswordRepromptServiceAbstraction } from "@/jslib/common/src/abstractions/passwordReprompt.service";
|
||||
|
||||
import { PasswordRepromptComponent } from "../components/password-reprompt.component";
|
||||
|
||||
import { ModalService } from "./modal.service";
|
||||
|
||||
/**
|
||||
* Used to verify the user's Master Password for the "Master Password Re-prompt" feature only.
|
||||
* See UserVerificationService for any other situation where you need to verify the user's identity.
|
||||
*/
|
||||
@Injectable()
|
||||
export class PasswordRepromptService implements PasswordRepromptServiceAbstraction {
|
||||
protected component = PasswordRepromptComponent;
|
||||
|
||||
constructor(
|
||||
private modalService: ModalService,
|
||||
private keyConnectorService: KeyConnectorService
|
||||
) {}
|
||||
|
||||
protectedFields() {
|
||||
return ["TOTP", "Password", "H_Field", "Card Number", "Security Code"];
|
||||
}
|
||||
|
||||
async showPasswordPrompt() {
|
||||
if (!(await this.enabled())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const ref = this.modalService.open(this.component, { allowMultipleModals: true });
|
||||
|
||||
if (ref == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const result = await ref.onClosedPromise();
|
||||
return result === true;
|
||||
}
|
||||
|
||||
async enabled() {
|
||||
return !(await this.keyConnectorService.getUsesKeyConnector());
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
import { Injectable } from "@angular/core";
|
||||
import { CanActivate, Router } from "@angular/router";
|
||||
|
||||
import { StateService } from "@/jslib/common/src/abstractions/state.service";
|
||||
import { VaultTimeoutService } from "@/jslib/common/src/abstractions/vaultTimeout.service";
|
||||
|
||||
@Injectable()
|
||||
export class UnauthGuardService implements CanActivate {
|
||||
protected homepage = "vault";
|
||||
constructor(
|
||||
private vaultTimeoutService: VaultTimeoutService,
|
||||
private router: Router,
|
||||
private stateService: StateService
|
||||
) {}
|
||||
|
||||
async canActivate() {
|
||||
const isAuthed = await this.stateService.getIsAuthenticated();
|
||||
if (isAuthed) {
|
||||
const locked = await this.vaultTimeoutService.isLocked();
|
||||
if (locked) {
|
||||
this.router.navigate(["lock"]);
|
||||
} else {
|
||||
this.router.navigate([this.homepage]);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import { ErrorResponse } from "@/jslib/common/src/models/response/errorResponse"
|
||||
export class ValidationService {
|
||||
constructor(
|
||||
private i18nService: I18nService,
|
||||
private platformUtilsService: PlatformUtilsService
|
||||
private platformUtilsService: PlatformUtilsService,
|
||||
) {}
|
||||
|
||||
showError(data: any): string[] {
|
||||
|
||||
15
jslib/common/custom-matchers.d.ts
vendored
15
jslib/common/custom-matchers.d.ts
vendored
@@ -1,15 +0,0 @@
|
||||
import type { CustomMatchers } from "./test.setup";
|
||||
|
||||
// This declares the types for our custom matchers so that they're recognised by Typescript
|
||||
// This file must also be included in the TS compilation (via the tsconfig.json "include" property) to be recognised by
|
||||
// vscode
|
||||
|
||||
/* eslint-disable */
|
||||
declare global {
|
||||
namespace jest {
|
||||
interface Expect extends CustomMatchers {}
|
||||
interface Matchers<R> extends CustomMatchers<R> {}
|
||||
interface InverseAsymmetricMatchers extends CustomMatchers {}
|
||||
}
|
||||
}
|
||||
/* eslint-enable */
|
||||
@@ -1,17 +0,0 @@
|
||||
const { pathsToModuleNameMapper } = require("ts-jest");
|
||||
|
||||
const { compilerOptions } = require("../shared/tsconfig.libs");
|
||||
|
||||
const sharedConfig = require("../shared/jest.config.ts");
|
||||
|
||||
/** @type {import('jest').Config} */
|
||||
module.exports = {
|
||||
...sharedConfig,
|
||||
displayName: "libs/common tests",
|
||||
preset: "ts-jest",
|
||||
testEnvironment: "jsdom",
|
||||
setupFilesAfterEnv: ["<rootDir>/test.setup.ts"],
|
||||
moduleNameMapper: pathsToModuleNameMapper(compilerOptions?.paths || {}, {
|
||||
prefix: "<rootDir>/",
|
||||
}),
|
||||
};
|
||||
@@ -1,4 +1,4 @@
|
||||
import Substitute, { Arg } from "@fluffy-spoon/substitute";
|
||||
import { Substitute, Arg } from "@fluffy-spoon/substitute";
|
||||
|
||||
import { CryptoService } from "@/jslib/common/src/abstractions/crypto.service";
|
||||
import { AttachmentData } from "@/jslib/common/src/models/data/attachmentData";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Substitute, { Arg } from "@fluffy-spoon/substitute";
|
||||
import { Substitute, Arg } from "@fluffy-spoon/substitute";
|
||||
|
||||
import { CipherRepromptType } from "@/jslib/common/src/enums/cipherRepromptType";
|
||||
import { CipherType } from "@/jslib/common/src/enums/cipherType";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Substitute, { Arg } from "@fluffy-spoon/substitute";
|
||||
import { Substitute, Arg } from "@fluffy-spoon/substitute";
|
||||
|
||||
import { CryptoService } from "@/jslib/common/src/abstractions/crypto.service";
|
||||
import { EncryptionType } from "@/jslib/common/src/enums/encryptionType";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Substitute, { Arg } from "@fluffy-spoon/substitute";
|
||||
import { Substitute, Arg } from "@fluffy-spoon/substitute";
|
||||
|
||||
import { UriMatchType } from "@/jslib/common/src/enums/uriMatchType";
|
||||
import { LoginData } from "@/jslib/common/src/models/data/loginData";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Substitute, { Arg, SubstituteOf } from "@fluffy-spoon/substitute";
|
||||
import { Substitute, Arg, SubstituteOf } from "@fluffy-spoon/substitute";
|
||||
|
||||
import { CryptoService } from "@/jslib/common/src/abstractions/crypto.service";
|
||||
import { SendType } from "@/jslib/common/src/enums/sendType";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Substitute, { Arg } from "@fluffy-spoon/substitute";
|
||||
import { Substitute, Arg } from "@fluffy-spoon/substitute";
|
||||
|
||||
import { SendType } from "@/jslib/common/src/enums/sendType";
|
||||
import { SendAccess } from "@/jslib/common/src/models/domain/sendAccess";
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
import { Substitute, SubstituteOf } from "@fluffy-spoon/substitute";
|
||||
|
||||
import { CryptoService } from "@/jslib/common/src/abstractions/crypto.service";
|
||||
import { I18nService } from "@/jslib/common/src/abstractions/i18n.service";
|
||||
import { BitwardenJsonImporter } from "@/jslib/common/src/importers/bitwardenJsonImporter";
|
||||
|
||||
import { data as passwordProtectedData } from "./testData/bitwardenJson/passwordProtected.json";
|
||||
|
||||
describe("bitwarden json importer", () => {
|
||||
let sut: BitwardenJsonImporter;
|
||||
let cryptoService: SubstituteOf<CryptoService>;
|
||||
let i18nService: SubstituteOf<I18nService>;
|
||||
|
||||
beforeEach(() => {
|
||||
cryptoService = Substitute.for<CryptoService>();
|
||||
i18nService = Substitute.for<I18nService>();
|
||||
|
||||
sut = new BitwardenJsonImporter(cryptoService, i18nService);
|
||||
});
|
||||
|
||||
it("should fail if password is needed", async () => {
|
||||
expect((await sut.parse(passwordProtectedData)).success).toBe(false);
|
||||
});
|
||||
|
||||
it("should return password needed error message", async () => {
|
||||
const expected = "Password required error message";
|
||||
i18nService.t("importPasswordRequired").returns(expected);
|
||||
|
||||
expect((await sut.parse(passwordProtectedData)).errorMessage).toEqual(expected);
|
||||
});
|
||||
});
|
||||
@@ -1,113 +0,0 @@
|
||||
import Substitute, { Arg, SubstituteOf } from "@fluffy-spoon/substitute";
|
||||
|
||||
import { CryptoService } from "@/jslib/common/src/abstractions/crypto.service";
|
||||
import { I18nService } from "@/jslib/common/src/abstractions/i18n.service";
|
||||
import { KdfType } from "@/jslib/common/src/enums/kdfType";
|
||||
import { BitwardenPasswordProtectedImporter } from "@/jslib/common/src/importers/bitwardenPasswordProtectedImporter";
|
||||
import { Utils } from "@/jslib/common/src/misc/utils";
|
||||
import { ImportResult } from "@/jslib/common/src/models/domain/importResult";
|
||||
|
||||
import { data as emptyDecryptedData } from "./testData/bitwardenJson/empty.json";
|
||||
|
||||
describe("BitwardenPasswordProtectedImporter", () => {
|
||||
let importer: BitwardenPasswordProtectedImporter;
|
||||
let cryptoService: SubstituteOf<CryptoService>;
|
||||
let i18nService: SubstituteOf<I18nService>;
|
||||
const password = Utils.newGuid();
|
||||
const result = new ImportResult();
|
||||
let jDoc: {
|
||||
encrypted?: boolean;
|
||||
passwordProtected?: boolean;
|
||||
salt?: string;
|
||||
kdfIterations?: any;
|
||||
kdfType?: any;
|
||||
encKeyValidation_DO_NOT_EDIT?: string;
|
||||
data?: string;
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
cryptoService = Substitute.for<CryptoService>();
|
||||
i18nService = Substitute.for<I18nService>();
|
||||
|
||||
jDoc = {
|
||||
encrypted: true,
|
||||
passwordProtected: true,
|
||||
salt: "c2FsdA==",
|
||||
kdfIterations: 100000,
|
||||
kdfType: KdfType.PBKDF2_SHA256,
|
||||
encKeyValidation_DO_NOT_EDIT: Utils.newGuid(),
|
||||
data: Utils.newGuid(),
|
||||
};
|
||||
|
||||
result.success = true;
|
||||
importer = new BitwardenPasswordProtectedImporter(cryptoService, i18nService, password);
|
||||
});
|
||||
|
||||
describe("Required Json Data", () => {
|
||||
it("succeeds with default jdoc", async () => {
|
||||
cryptoService.decryptToUtf8(Arg.any(), Arg.any()).resolves(emptyDecryptedData);
|
||||
|
||||
expect((await importer.parse(JSON.stringify(jDoc))).success).toEqual(true);
|
||||
});
|
||||
|
||||
it("fails if encrypted === false", async () => {
|
||||
jDoc.encrypted = false;
|
||||
expect((await importer.parse(JSON.stringify(jDoc))).success).toEqual(false);
|
||||
});
|
||||
|
||||
it("fails if encrypted === null", async () => {
|
||||
jDoc.encrypted = null;
|
||||
expect((await importer.parse(JSON.stringify(jDoc))).success).toEqual(false);
|
||||
});
|
||||
|
||||
it("fails if passwordProtected === false", async () => {
|
||||
jDoc.passwordProtected = false;
|
||||
expect((await importer.parse(JSON.stringify(jDoc))).success).toEqual(false);
|
||||
});
|
||||
|
||||
it("fails if passwordProtected === null", async () => {
|
||||
jDoc.passwordProtected = null;
|
||||
expect((await importer.parse(JSON.stringify(jDoc))).success).toEqual(false);
|
||||
});
|
||||
|
||||
it("fails if salt === null", async () => {
|
||||
jDoc.salt = null;
|
||||
expect((await importer.parse(JSON.stringify(jDoc))).success).toEqual(false);
|
||||
});
|
||||
|
||||
it("fails if kdfIterations === null", async () => {
|
||||
jDoc.kdfIterations = null;
|
||||
expect((await importer.parse(JSON.stringify(jDoc))).success).toEqual(false);
|
||||
});
|
||||
|
||||
it("fails if kdfIterations is not a number", async () => {
|
||||
jDoc.kdfIterations = "not a number";
|
||||
expect((await importer.parse(JSON.stringify(jDoc))).success).toEqual(false);
|
||||
});
|
||||
|
||||
it("fails if kdfType === null", async () => {
|
||||
jDoc.kdfType = null;
|
||||
expect((await importer.parse(JSON.stringify(jDoc))).success).toEqual(false);
|
||||
});
|
||||
|
||||
it("fails if kdfType is not a string", async () => {
|
||||
jDoc.kdfType = "not a valid kdf type";
|
||||
expect((await importer.parse(JSON.stringify(jDoc))).success).toEqual(false);
|
||||
});
|
||||
|
||||
it("fails if kdfType is not a known kdfType", async () => {
|
||||
jDoc.kdfType = -1;
|
||||
expect((await importer.parse(JSON.stringify(jDoc))).success).toEqual(false);
|
||||
});
|
||||
|
||||
it("fails if encKeyValidation_DO_NOT_EDIT === null", async () => {
|
||||
jDoc.encKeyValidation_DO_NOT_EDIT = null;
|
||||
expect((await importer.parse(JSON.stringify(jDoc))).success).toEqual(false);
|
||||
});
|
||||
|
||||
it("fails if data === null", async () => {
|
||||
jDoc.data = null;
|
||||
expect((await importer.parse(JSON.stringify(jDoc))).success).toEqual(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,367 +0,0 @@
|
||||
import { CipherType } from "@/jslib/common/src/enums/cipherType";
|
||||
import { DashlaneCsvImporter as Importer } from "@/jslib/common/src/importers/dashlaneImporters/dashlaneCsvImporter";
|
||||
|
||||
import { credentialsData } from "./testData/dashlaneCsv/credentials.csv";
|
||||
import { identityData } from "./testData/dashlaneCsv/id.csv";
|
||||
import { multiplePersonalInfoData } from "./testData/dashlaneCsv/multiplePersonalInfo.csv";
|
||||
import { paymentsData } from "./testData/dashlaneCsv/payments.csv";
|
||||
import { personalInfoData } from "./testData/dashlaneCsv/personalInfo.csv";
|
||||
import { secureNoteData } from "./testData/dashlaneCsv/securenotes.csv";
|
||||
|
||||
describe("Dashlane CSV Importer", () => {
|
||||
let importer: Importer;
|
||||
beforeEach(() => {
|
||||
importer = new Importer();
|
||||
});
|
||||
|
||||
it("should parse login records", async () => {
|
||||
const result = await importer.parse(credentialsData);
|
||||
expect(result != null).toBe(true);
|
||||
|
||||
const cipher = result.ciphers.shift();
|
||||
expect(cipher.name).toEqual("example.com");
|
||||
expect(cipher.login.username).toEqual("jdoe");
|
||||
expect(cipher.login.password).toEqual("somePassword");
|
||||
expect(cipher.login.totp).toEqual("someTOTPSeed");
|
||||
expect(cipher.login.uris.length).toEqual(1);
|
||||
const uriView = cipher.login.uris.shift();
|
||||
expect(uriView.uri).toEqual("https://www.example.com");
|
||||
expect(cipher.notes).toEqual("some note for example.com");
|
||||
});
|
||||
|
||||
it("should parse an item and create a folder", async () => {
|
||||
const result = await importer.parse(credentialsData);
|
||||
|
||||
expect(result).not.toBeNull();
|
||||
expect(result.success).toBe(true);
|
||||
expect(result.folders.length).toBe(1);
|
||||
expect(result.folders[0].name).toBe("Entertainment");
|
||||
expect(result.folderRelationships[0]).toEqual([0, 0]);
|
||||
});
|
||||
|
||||
it("should parse payment records", async () => {
|
||||
const result = await importer.parse(paymentsData);
|
||||
|
||||
expect(result).not.toBeNull();
|
||||
expect(result.success).toBe(true);
|
||||
expect(result.ciphers.length).toBe(2);
|
||||
|
||||
// Account
|
||||
const cipher = result.ciphers.shift();
|
||||
expect(cipher.type).toBe(CipherType.Card);
|
||||
expect(cipher.name).toBe("John's savings account");
|
||||
expect(cipher.card.brand).toBeNull();
|
||||
expect(cipher.card.cardholderName).toBe("John Doe");
|
||||
expect(cipher.card.number).toBe("accountNumber");
|
||||
expect(cipher.card.code).toBeNull();
|
||||
expect(cipher.card.expMonth).toBeNull();
|
||||
expect(cipher.card.expYear).toBeNull();
|
||||
|
||||
expect(cipher.fields.length).toBe(4);
|
||||
|
||||
expect(cipher.fields[0].name).toBe("type");
|
||||
expect(cipher.fields[0].value).toBe("bank");
|
||||
|
||||
expect(cipher.fields[1].name).toBe("routing_number");
|
||||
expect(cipher.fields[1].value).toBe("routingNumber");
|
||||
|
||||
expect(cipher.fields[2].name).toBe("country");
|
||||
expect(cipher.fields[2].value).toBe("US");
|
||||
|
||||
expect(cipher.fields[3].name).toBe("issuing_bank");
|
||||
expect(cipher.fields[3].value).toBe("US-ALLY");
|
||||
|
||||
// CreditCard
|
||||
const cipher2 = result.ciphers.shift();
|
||||
expect(cipher2.type).toBe(CipherType.Card);
|
||||
expect(cipher2.name).toBe("John Doe");
|
||||
expect(cipher2.card.brand).toBe("Visa");
|
||||
expect(cipher2.card.cardholderName).toBe("John Doe");
|
||||
expect(cipher2.card.number).toBe("41111111111111111");
|
||||
expect(cipher2.card.code).toBe("123");
|
||||
expect(cipher2.card.expMonth).toBe("01");
|
||||
expect(cipher2.card.expYear).toBe("23");
|
||||
|
||||
expect(cipher2.fields.length).toBe(2);
|
||||
|
||||
expect(cipher2.fields[0].name).toBe("type");
|
||||
expect(cipher2.fields[0].value).toBe("credit_card");
|
||||
|
||||
expect(cipher2.fields[1].name).toBe("country");
|
||||
expect(cipher2.fields[1].value).toBe("US");
|
||||
});
|
||||
|
||||
it("should parse ids records", async () => {
|
||||
const result = await importer.parse(identityData);
|
||||
|
||||
expect(result).not.toBeNull();
|
||||
expect(result.success).toBe(true);
|
||||
|
||||
// Type card
|
||||
const cipher = result.ciphers.shift();
|
||||
expect(cipher.type).toBe(CipherType.Identity);
|
||||
expect(cipher.name).toBe("John Doe card");
|
||||
expect(cipher.identity.fullName).toBe("John Doe");
|
||||
expect(cipher.identity.firstName).toBe("John");
|
||||
expect(cipher.identity.middleName).toBeNull();
|
||||
expect(cipher.identity.lastName).toBe("Doe");
|
||||
expect(cipher.identity.licenseNumber).toBe("123123123");
|
||||
|
||||
expect(cipher.fields.length).toBe(3);
|
||||
|
||||
expect(cipher.fields[0].name).toEqual("type");
|
||||
expect(cipher.fields[0].value).toEqual("card");
|
||||
|
||||
expect(cipher.fields[1].name).toEqual("issue_date");
|
||||
expect(cipher.fields[1].value).toEqual("2022-1-30");
|
||||
|
||||
expect(cipher.fields[2].name).toEqual("expiration_date");
|
||||
expect(cipher.fields[2].value).toEqual("2032-1-30");
|
||||
|
||||
// Type passport
|
||||
const cipher2 = result.ciphers.shift();
|
||||
expect(cipher2.type).toBe(CipherType.Identity);
|
||||
expect(cipher2.name).toBe("John Doe passport");
|
||||
expect(cipher2.identity.fullName).toBe("John Doe");
|
||||
expect(cipher2.identity.firstName).toBe("John");
|
||||
expect(cipher2.identity.middleName).toBeNull();
|
||||
expect(cipher2.identity.lastName).toBe("Doe");
|
||||
expect(cipher2.identity.passportNumber).toBe("123123123");
|
||||
|
||||
expect(cipher2.fields.length).toBe(4);
|
||||
|
||||
expect(cipher2.fields[0].name).toEqual("type");
|
||||
expect(cipher2.fields[0].value).toEqual("passport");
|
||||
expect(cipher2.fields[1].name).toEqual("issue_date");
|
||||
expect(cipher2.fields[1].value).toEqual("2022-1-30");
|
||||
expect(cipher2.fields[2].name).toEqual("expiration_date");
|
||||
expect(cipher2.fields[2].value).toEqual("2032-1-30");
|
||||
expect(cipher2.fields[3].name).toEqual("place_of_issue");
|
||||
expect(cipher2.fields[3].value).toEqual("somewhere in Germany");
|
||||
|
||||
// Type license
|
||||
const cipher3 = result.ciphers.shift();
|
||||
expect(cipher3.type).toBe(CipherType.Identity);
|
||||
expect(cipher3.name).toBe("John Doe license");
|
||||
expect(cipher3.identity.fullName).toBe("John Doe");
|
||||
expect(cipher3.identity.firstName).toBe("John");
|
||||
expect(cipher3.identity.middleName).toBeNull();
|
||||
expect(cipher3.identity.lastName).toBe("Doe");
|
||||
expect(cipher3.identity.licenseNumber).toBe("1234556");
|
||||
expect(cipher3.identity.state).toBe("DC");
|
||||
|
||||
expect(cipher3.fields.length).toBe(3);
|
||||
expect(cipher3.fields[0].name).toEqual("type");
|
||||
expect(cipher3.fields[0].value).toEqual("license");
|
||||
expect(cipher3.fields[1].name).toEqual("issue_date");
|
||||
expect(cipher3.fields[1].value).toEqual("2022-8-10");
|
||||
expect(cipher3.fields[2].name).toEqual("expiration_date");
|
||||
expect(cipher3.fields[2].value).toEqual("2022-10-10");
|
||||
|
||||
// Type social_security
|
||||
const cipher4 = result.ciphers.shift();
|
||||
expect(cipher4.type).toBe(CipherType.Identity);
|
||||
expect(cipher4.name).toBe("John Doe social_security");
|
||||
expect(cipher4.identity.fullName).toBe("John Doe");
|
||||
expect(cipher4.identity.firstName).toBe("John");
|
||||
expect(cipher4.identity.middleName).toBeNull();
|
||||
expect(cipher4.identity.lastName).toBe("Doe");
|
||||
expect(cipher4.identity.ssn).toBe("123123123");
|
||||
|
||||
expect(cipher4.fields.length).toBe(1);
|
||||
expect(cipher4.fields[0].name).toEqual("type");
|
||||
expect(cipher4.fields[0].value).toEqual("social_security");
|
||||
|
||||
// Type tax_number
|
||||
const cipher5 = result.ciphers.shift();
|
||||
expect(cipher5.type).toBe(CipherType.Identity);
|
||||
expect(cipher5.name).toBe("tax_number");
|
||||
expect(cipher5.identity.licenseNumber).toBe("123123123");
|
||||
|
||||
expect(cipher5.fields.length).toBe(1);
|
||||
expect(cipher5.fields[0].name).toEqual("type");
|
||||
expect(cipher5.fields[0].value).toEqual("tax_number");
|
||||
});
|
||||
|
||||
it("should parse secureNote records", async () => {
|
||||
const result = await importer.parse(secureNoteData);
|
||||
|
||||
expect(result).not.toBeNull();
|
||||
expect(result.success).toBe(true);
|
||||
expect(result.ciphers.length).toBe(1);
|
||||
|
||||
const cipher = result.ciphers.shift();
|
||||
expect(cipher.type).toBe(CipherType.SecureNote);
|
||||
expect(cipher.name).toBe("01");
|
||||
expect(cipher.notes).toBe("test");
|
||||
});
|
||||
|
||||
it("should parse personal information records (multiple identities)", async () => {
|
||||
const result = await importer.parse(multiplePersonalInfoData);
|
||||
|
||||
expect(result).not.toBeNull();
|
||||
expect(result.success).toBe(true);
|
||||
expect(result.ciphers.length).toBe(6);
|
||||
|
||||
// name
|
||||
const cipher = result.ciphers.shift();
|
||||
expect(cipher.type).toBe(CipherType.SecureNote);
|
||||
expect(cipher.name).toBe("MR John Doe");
|
||||
|
||||
expect(cipher.fields.length).toBe(7);
|
||||
expect(cipher.fields[0].name).toEqual("type");
|
||||
expect(cipher.fields[0].value).toEqual("name");
|
||||
expect(cipher.fields[1].name).toEqual("title");
|
||||
expect(cipher.fields[1].value).toEqual("MR");
|
||||
expect(cipher.fields[2].name).toEqual("first_name");
|
||||
expect(cipher.fields[2].value).toEqual("John");
|
||||
expect(cipher.fields[3].name).toEqual("last_name");
|
||||
expect(cipher.fields[3].value).toEqual("Doe");
|
||||
expect(cipher.fields[4].name).toEqual("login");
|
||||
expect(cipher.fields[4].value).toEqual("jdoe");
|
||||
expect(cipher.fields[5].name).toEqual("date_of_birth");
|
||||
expect(cipher.fields[5].value).toEqual("2022-01-30");
|
||||
expect(cipher.fields[6].name).toEqual("place_of_birth");
|
||||
expect(cipher.fields[6].value).toEqual("world");
|
||||
|
||||
// email
|
||||
const cipher2 = result.ciphers.shift();
|
||||
expect(cipher2.type).toBe(CipherType.SecureNote);
|
||||
expect(cipher2.name).toBe("Johns email");
|
||||
|
||||
expect(cipher2.fields.length).toBe(4);
|
||||
expect(cipher2.fields[0].name).toEqual("type");
|
||||
expect(cipher2.fields[0].value).toEqual("email");
|
||||
expect(cipher2.fields[1].name).toEqual("email");
|
||||
expect(cipher2.fields[1].value).toEqual("jdoe@example.com");
|
||||
expect(cipher2.fields[2].name).toEqual("email_type");
|
||||
expect(cipher2.fields[2].value).toEqual("personal");
|
||||
expect(cipher2.fields[3].name).toEqual("item_name");
|
||||
expect(cipher2.fields[3].value).toEqual("Johns email");
|
||||
|
||||
// number
|
||||
const cipher3 = result.ciphers.shift();
|
||||
expect(cipher3.type).toBe(CipherType.SecureNote);
|
||||
expect(cipher3.name).toBe("John's number");
|
||||
|
||||
expect(cipher3.fields.length).toBe(3);
|
||||
expect(cipher3.fields[0].name).toEqual("type");
|
||||
expect(cipher3.fields[0].value).toEqual("number");
|
||||
expect(cipher3.fields[1].name).toEqual("item_name");
|
||||
expect(cipher3.fields[1].value).toEqual("John's number");
|
||||
expect(cipher3.fields[2].name).toEqual("phone_number");
|
||||
expect(cipher3.fields[2].value).toEqual("+49123123123");
|
||||
|
||||
// address
|
||||
const cipher4 = result.ciphers.shift();
|
||||
expect(cipher4.type).toBe(CipherType.SecureNote);
|
||||
expect(cipher4.name).toBe("John's home address");
|
||||
|
||||
expect(cipher4.fields.length).toBe(12);
|
||||
expect(cipher4.fields[0].name).toEqual("type");
|
||||
expect(cipher4.fields[0].value).toEqual("address");
|
||||
expect(cipher4.fields[1].name).toEqual("item_name");
|
||||
expect(cipher4.fields[1].value).toEqual("John's home address");
|
||||
expect(cipher4.fields[2].name).toEqual("address");
|
||||
expect(cipher4.fields[2].value).toEqual("1 some street");
|
||||
expect(cipher4.fields[3].name).toEqual("country");
|
||||
expect(cipher4.fields[3].value).toEqual("de");
|
||||
expect(cipher4.fields[4].name).toEqual("state");
|
||||
expect(cipher4.fields[4].value).toEqual("DE-0-NW");
|
||||
expect(cipher4.fields[5].name).toEqual("city");
|
||||
expect(cipher4.fields[5].value).toEqual("some city");
|
||||
expect(cipher4.fields[6].name).toEqual("zip");
|
||||
expect(cipher4.fields[6].value).toEqual("123123");
|
||||
expect(cipher4.fields[7].name).toEqual("address_recipient");
|
||||
expect(cipher4.fields[7].value).toEqual("John");
|
||||
expect(cipher4.fields[8].name).toEqual("address_building");
|
||||
expect(cipher4.fields[8].value).toEqual("1");
|
||||
expect(cipher4.fields[9].name).toEqual("address_apartment");
|
||||
expect(cipher4.fields[9].value).toEqual("1");
|
||||
expect(cipher4.fields[10].name).toEqual("address_floor");
|
||||
expect(cipher4.fields[10].value).toEqual("1");
|
||||
expect(cipher4.fields[11].name).toEqual("address_door_code");
|
||||
expect(cipher4.fields[11].value).toEqual("123");
|
||||
|
||||
// website
|
||||
const cipher5 = result.ciphers.shift();
|
||||
expect(cipher5.type).toBe(CipherType.SecureNote);
|
||||
expect(cipher5.name).toBe("Website");
|
||||
|
||||
expect(cipher5.fields.length).toBe(3);
|
||||
expect(cipher5.fields[0].name).toEqual("type");
|
||||
expect(cipher5.fields[0].value).toEqual("website");
|
||||
expect(cipher5.fields[1].name).toEqual("item_name");
|
||||
expect(cipher5.fields[1].value).toEqual("Website");
|
||||
expect(cipher5.fields[2].name).toEqual("url");
|
||||
expect(cipher5.fields[2].value).toEqual("website.com");
|
||||
|
||||
// 2nd name/identity
|
||||
const cipher6 = result.ciphers.shift();
|
||||
expect(cipher6.type).toBe(CipherType.SecureNote);
|
||||
expect(cipher6.name).toBe("Mrs Jane Doe");
|
||||
|
||||
expect(cipher6.fields.length).toBe(7);
|
||||
expect(cipher6.fields[0].name).toEqual("type");
|
||||
expect(cipher6.fields[0].value).toEqual("name");
|
||||
expect(cipher6.fields[1].name).toEqual("title");
|
||||
expect(cipher6.fields[1].value).toEqual("Mrs");
|
||||
expect(cipher6.fields[2].name).toEqual("first_name");
|
||||
expect(cipher6.fields[2].value).toEqual("Jane");
|
||||
expect(cipher6.fields[3].name).toEqual("last_name");
|
||||
expect(cipher6.fields[3].value).toEqual("Doe");
|
||||
expect(cipher6.fields[4].name).toEqual("login");
|
||||
expect(cipher6.fields[4].value).toEqual("jdoe");
|
||||
expect(cipher6.fields[5].name).toEqual("date_of_birth");
|
||||
expect(cipher6.fields[5].value).toEqual("2022-01-30");
|
||||
expect(cipher6.fields[6].name).toEqual("place_of_birth");
|
||||
expect(cipher6.fields[6].value).toEqual("earth");
|
||||
});
|
||||
|
||||
it("should combine personal information records to one identity if only one identity present", async () => {
|
||||
const result = await importer.parse(personalInfoData);
|
||||
|
||||
expect(result).not.toBeNull();
|
||||
expect(result.success).toBe(true);
|
||||
|
||||
const cipher = result.ciphers.shift();
|
||||
expect(cipher.type).toBe(CipherType.Identity);
|
||||
expect(cipher.name).toBe("MR John Doe");
|
||||
expect(cipher.identity.fullName).toBe("MR John Doe");
|
||||
expect(cipher.identity.title).toBe("MR");
|
||||
expect(cipher.identity.firstName).toBe("John");
|
||||
expect(cipher.identity.middleName).toBeNull();
|
||||
expect(cipher.identity.lastName).toBe("Doe");
|
||||
expect(cipher.identity.username).toBe("jdoe");
|
||||
expect(cipher.identity.email).toBe("jdoe@example.com");
|
||||
expect(cipher.identity.phone).toBe("+49123123123");
|
||||
|
||||
expect(cipher.fields.length).toBe(9);
|
||||
expect(cipher.fields[0].name).toBe("date_of_birth");
|
||||
expect(cipher.fields[0].value).toBe("2022-01-30");
|
||||
|
||||
expect(cipher.fields[1].name).toBe("place_of_birth");
|
||||
expect(cipher.fields[1].value).toBe("world");
|
||||
|
||||
expect(cipher.fields[2].name).toBe("email_type");
|
||||
expect(cipher.fields[2].value).toBe("personal");
|
||||
|
||||
expect(cipher.fields[3].name).toBe("address_recipient");
|
||||
expect(cipher.fields[3].value).toBe("John");
|
||||
|
||||
expect(cipher.fields[4].name).toBe("address_building");
|
||||
expect(cipher.fields[4].value).toBe("1");
|
||||
|
||||
expect(cipher.fields[5].name).toBe("address_apartment");
|
||||
expect(cipher.fields[5].value).toBe("1");
|
||||
|
||||
expect(cipher.fields[6].name).toBe("address_floor");
|
||||
expect(cipher.fields[6].value).toBe("1");
|
||||
|
||||
expect(cipher.fields[7].name).toBe("address_door_code");
|
||||
expect(cipher.fields[7].value).toBe("123");
|
||||
|
||||
expect(cipher.fields[8].name).toBe("url");
|
||||
expect(cipher.fields[8].value).toBe("website.com");
|
||||
});
|
||||
});
|
||||
@@ -1,74 +0,0 @@
|
||||
import { FirefoxCsvImporter as Importer } from "@/jslib/common/src/importers/firefoxCsvImporter";
|
||||
import { CipherView } from "@/jslib/common/src/models/view/cipherView";
|
||||
import { LoginUriView } from "@/jslib/common/src/models/view/loginUriView";
|
||||
import { LoginView } from "@/jslib/common/src/models/view/loginView";
|
||||
|
||||
import { data as firefoxAccountsData } from "./testData/firefoxCsv/firefoxAccountsData.csv";
|
||||
import { data as simplePasswordData } from "./testData/firefoxCsv/simplePasswordData.csv";
|
||||
|
||||
const CipherData = [
|
||||
{
|
||||
title: "should parse password",
|
||||
csv: simplePasswordData,
|
||||
expected: Object.assign(new CipherView(), {
|
||||
id: null,
|
||||
organizationId: null,
|
||||
folderId: null,
|
||||
name: "example.com",
|
||||
login: Object.assign(new LoginView(), {
|
||||
username: "foo",
|
||||
password: "bar",
|
||||
uris: [
|
||||
Object.assign(new LoginUriView(), {
|
||||
uri: "https://example.com",
|
||||
}),
|
||||
],
|
||||
}),
|
||||
notes: null,
|
||||
type: 1,
|
||||
}),
|
||||
},
|
||||
{
|
||||
title: 'should skip "chrome://FirefoxAccounts"',
|
||||
csv: firefoxAccountsData,
|
||||
expected: Object.assign(new CipherView(), {
|
||||
id: null,
|
||||
organizationId: null,
|
||||
folderId: null,
|
||||
name: "example.com",
|
||||
login: Object.assign(new LoginView(), {
|
||||
username: "foo",
|
||||
password: "bar",
|
||||
uris: [
|
||||
Object.assign(new LoginUriView(), {
|
||||
uri: "https://example.com",
|
||||
}),
|
||||
],
|
||||
}),
|
||||
notes: null,
|
||||
type: 1,
|
||||
}),
|
||||
},
|
||||
];
|
||||
|
||||
describe("Firefox CSV Importer", () => {
|
||||
CipherData.forEach((data) => {
|
||||
it(data.title, async () => {
|
||||
const importer = new Importer();
|
||||
const result = await importer.parse(data.csv);
|
||||
expect(result != null).toBe(true);
|
||||
expect(result.ciphers.length).toBeGreaterThan(0);
|
||||
|
||||
const cipher = result.ciphers.shift();
|
||||
let property: keyof typeof data.expected;
|
||||
for (property in data.expected) {
|
||||
// eslint-disable-next-line
|
||||
if (data.expected.hasOwnProperty(property)) {
|
||||
// eslint-disable-next-line
|
||||
expect(cipher.hasOwnProperty(property)).toBe(true);
|
||||
expect(cipher[property]).toEqual(data.expected[property]);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,77 +0,0 @@
|
||||
import { FSecureFskImporter as Importer } from "@/jslib/common/src/importers/fsecureFskImporter";
|
||||
|
||||
const TestDataWithStyleSetToWebsite: string = JSON.stringify({
|
||||
data: {
|
||||
"8d58b5cf252dd06fbd98f5289e918ab1": {
|
||||
color: "#00baff",
|
||||
reatedDate: 1609302913,
|
||||
creditCvv: "",
|
||||
creditExpiry: "",
|
||||
creditNumber: "",
|
||||
favorite: 0,
|
||||
modifiedDate: 1609302913,
|
||||
notes: "note",
|
||||
password: "word",
|
||||
passwordList: [],
|
||||
passwordModifiedDate: 1609302913,
|
||||
rev: 1,
|
||||
service: "My first pass",
|
||||
style: "website",
|
||||
type: 1,
|
||||
url: "https://bitwarden.com",
|
||||
username: "pass",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const TestDataWithStyleSetToGlobe: string = JSON.stringify({
|
||||
data: {
|
||||
"8d58b5cf252dd06fbd98f5289e918ab1": {
|
||||
color: "#00baff",
|
||||
reatedDate: 1609302913,
|
||||
creditCvv: "",
|
||||
creditExpiry: "",
|
||||
creditNumber: "",
|
||||
favorite: 0,
|
||||
modifiedDate: 1609302913,
|
||||
notes: "note",
|
||||
password: "word",
|
||||
passwordList: [],
|
||||
passwordModifiedDate: 1609302913,
|
||||
rev: 1,
|
||||
service: "My first pass",
|
||||
style: "globe",
|
||||
type: 1,
|
||||
url: "https://bitwarden.com",
|
||||
username: "pass",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
describe("FSecure FSK Importer", () => {
|
||||
it("should parse data with style set to website", async () => {
|
||||
const importer = new Importer();
|
||||
const result = await importer.parse(TestDataWithStyleSetToWebsite);
|
||||
expect(result != null).toBe(true);
|
||||
|
||||
const cipher = result.ciphers.shift();
|
||||
expect(cipher.login.username).toEqual("pass");
|
||||
expect(cipher.login.password).toEqual("word");
|
||||
expect(cipher.login.uris.length).toEqual(1);
|
||||
const uriView = cipher.login.uris.shift();
|
||||
expect(uriView.uri).toEqual("https://bitwarden.com");
|
||||
});
|
||||
|
||||
it("should parse data with style set to globe", async () => {
|
||||
const importer = new Importer();
|
||||
const result = await importer.parse(TestDataWithStyleSetToGlobe);
|
||||
expect(result != null).toBe(true);
|
||||
|
||||
const cipher = result.ciphers.shift();
|
||||
expect(cipher.login.username).toEqual("pass");
|
||||
expect(cipher.login.password).toEqual("word");
|
||||
expect(cipher.login.uris.length).toEqual(1);
|
||||
const uriView = cipher.login.uris.shift();
|
||||
expect(uriView.uri).toEqual("https://bitwarden.com");
|
||||
});
|
||||
});
|
||||
@@ -1,189 +0,0 @@
|
||||
import { KeePass2XmlImporter as Importer } from "@/jslib/common/src/importers/keepass2XmlImporter";
|
||||
|
||||
const TestData = `<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<KeePassFile>
|
||||
<Meta>
|
||||
<Generator>KeePass</Generator>
|
||||
<DatabaseName />
|
||||
<DatabaseNameChanged>2016-12-31T21:33:52Z</DatabaseNameChanged>
|
||||
<DatabaseDescription />
|
||||
<DatabaseDescriptionChanged>2016-12-31T21:33:52Z</DatabaseDescriptionChanged>
|
||||
<DefaultUserName />
|
||||
<DefaultUserNameChanged>2016-12-31T21:33:52Z</DefaultUserNameChanged>
|
||||
<MaintenanceHistoryDays>365</MaintenanceHistoryDays>
|
||||
<Color />
|
||||
<MasterKeyChanged>2016-12-31T21:33:59Z</MasterKeyChanged>
|
||||
<MasterKeyChangeRec>-1</MasterKeyChangeRec>
|
||||
<MasterKeyChangeForce>-1</MasterKeyChangeForce>
|
||||
<MemoryProtection>
|
||||
<ProtectTitle>False</ProtectTitle>
|
||||
<ProtectUserName>False</ProtectUserName>
|
||||
<ProtectPassword>True</ProtectPassword>
|
||||
<ProtectURL>False</ProtectURL>
|
||||
<ProtectNotes>False</ProtectNotes>
|
||||
</MemoryProtection>
|
||||
<RecycleBinEnabled>True</RecycleBinEnabled>
|
||||
<RecycleBinUUID>AAAAAAAAAAAAAAAAAAAAAA==</RecycleBinUUID>
|
||||
<RecycleBinChanged>2016-12-31T21:33:52Z</RecycleBinChanged>
|
||||
<EntryTemplatesGroup>AAAAAAAAAAAAAAAAAAAAAA==</EntryTemplatesGroup>
|
||||
<EntryTemplatesGroupChanged>2016-12-31T21:33:52Z</EntryTemplatesGroupChanged>
|
||||
<HistoryMaxItems>10</HistoryMaxItems>
|
||||
<HistoryMaxSize>6291456</HistoryMaxSize>
|
||||
<LastSelectedGroup>AAAAAAAAAAAAAAAAAAAAAA==</LastSelectedGroup>
|
||||
<LastTopVisibleGroup>AAAAAAAAAAAAAAAAAAAAAA==</LastTopVisibleGroup>
|
||||
<Binaries />
|
||||
<CustomData />
|
||||
</Meta>
|
||||
<Root>
|
||||
<Group>
|
||||
<UUID>KvS57lVwl13AfGFLwkvq4Q==</UUID>
|
||||
<Name>Root</Name>
|
||||
<Notes />
|
||||
<IconID>48</IconID>
|
||||
<Times>
|
||||
<CreationTime>2016-12-31T21:33:52Z</CreationTime>
|
||||
<LastModificationTime>2016-12-31T21:33:52Z</LastModificationTime>
|
||||
<LastAccessTime>2017-01-01T22:58:00Z</LastAccessTime>
|
||||
<ExpiryTime>2016-12-31T21:33:52Z</ExpiryTime>
|
||||
<Expires>False</Expires>
|
||||
<UsageCount>1</UsageCount>
|
||||
<LocationChanged>2016-12-31T21:33:52Z</LocationChanged>
|
||||
</Times>
|
||||
<IsExpanded>True</IsExpanded>
|
||||
<DefaultAutoTypeSequence />
|
||||
<EnableAutoType>null</EnableAutoType>
|
||||
<EnableSearching>null</EnableSearching>
|
||||
<LastTopVisibleEntry>AAAAAAAAAAAAAAAAAAAAAA==</LastTopVisibleEntry>
|
||||
<Group>
|
||||
<UUID>P0ParXgGMBW6caOL2YrhqQ==</UUID>
|
||||
<Name>Folder2</Name>
|
||||
<Notes>a note about the folder</Notes>
|
||||
<IconID>48</IconID>
|
||||
<Times>
|
||||
<CreationTime>2016-12-31T21:43:30Z</CreationTime>
|
||||
<LastModificationTime>2016-12-31T21:43:43Z</LastModificationTime>
|
||||
<LastAccessTime>2017-01-01T22:58:00Z</LastAccessTime>
|
||||
<ExpiryTime>2016-12-31T21:43:30Z</ExpiryTime>
|
||||
<Expires>False</Expires>
|
||||
<UsageCount>1</UsageCount>
|
||||
<LocationChanged>2016-12-31T21:43:43Z</LocationChanged>
|
||||
</Times>
|
||||
<IsExpanded>True</IsExpanded>
|
||||
<DefaultAutoTypeSequence />
|
||||
<EnableAutoType>null</EnableAutoType>
|
||||
<EnableSearching>null</EnableSearching>
|
||||
<LastTopVisibleEntry>AAAAAAAAAAAAAAAAAAAAAA==</LastTopVisibleEntry>
|
||||
<Entry>
|
||||
<UUID>fAa543oYlgnJKkhKag5HLw==</UUID>
|
||||
<IconID>1</IconID>
|
||||
<ForegroundColor />
|
||||
<BackgroundColor />
|
||||
<OverrideURL />
|
||||
<Tags />
|
||||
<Times>
|
||||
<CreationTime>2016-12-31T21:34:13Z</CreationTime>
|
||||
<LastModificationTime>2016-12-31T21:40:23Z</LastModificationTime>
|
||||
<LastAccessTime>2016-12-31T21:40:23Z</LastAccessTime>
|
||||
<ExpiryTime>2016-12-31T21:34:13Z</ExpiryTime>
|
||||
<Expires>False</Expires>
|
||||
<UsageCount>0</UsageCount>
|
||||
<LocationChanged>2016-12-31T21:43:48Z</LocationChanged>
|
||||
</Times>
|
||||
<String>
|
||||
<Key>att2</Key>
|
||||
<Value>att2value</Value>
|
||||
</String>
|
||||
<String>
|
||||
<Key>attr1</Key>
|
||||
<Value>att1value
|
||||
|
||||
line1
|
||||
line2</Value>
|
||||
</String>
|
||||
<String>
|
||||
<Key>Notes</Key>
|
||||
<Value>This is a note!!!
|
||||
|
||||
line1
|
||||
line2</Value>
|
||||
</String>
|
||||
<String>
|
||||
<Key>Password</Key>
|
||||
<Value ProtectInMemory="True">googpass</Value>
|
||||
</String>
|
||||
<String>
|
||||
<Key>Title</Key>
|
||||
<Value>Google</Value>
|
||||
</String>
|
||||
<String>
|
||||
<Key>URL</Key>
|
||||
<Value>google.com</Value>
|
||||
</String>
|
||||
<String>
|
||||
<Key>UserName</Key>
|
||||
<Value>googleuser</Value>
|
||||
</String>
|
||||
<AutoType>
|
||||
<Enabled>True</Enabled>
|
||||
<DataTransferObfuscation>0</DataTransferObfuscation>
|
||||
</AutoType>
|
||||
<History>
|
||||
<Entry>
|
||||
<UUID>fAa543oYlgnJKkhKag5HLw==</UUID>
|
||||
<IconID>0</IconID>
|
||||
<ForegroundColor />
|
||||
<BackgroundColor />
|
||||
<OverrideURL />
|
||||
<Tags />
|
||||
<Times>
|
||||
<CreationTime>2016-12-31T21:34:13Z</CreationTime>
|
||||
<LastModificationTime>2016-12-31T21:34:40Z</LastModificationTime>
|
||||
<LastAccessTime>2016-12-31T21:34:40Z</LastAccessTime>
|
||||
<ExpiryTime>2016-12-31T21:34:13Z</ExpiryTime>
|
||||
<Expires>False</Expires>
|
||||
<UsageCount>0</UsageCount>
|
||||
<LocationChanged>2016-12-31T21:34:40Z</LocationChanged>
|
||||
</Times>
|
||||
<String>
|
||||
<Key>Notes</Key>
|
||||
<Value>This is a note!!!
|
||||
|
||||
line1
|
||||
line2</Value>
|
||||
</String>
|
||||
<String>
|
||||
<Key>Password</Key>
|
||||
<Value ProtectInMemory="True">googpass</Value>
|
||||
</String>
|
||||
<String>
|
||||
<Key>Title</Key>
|
||||
<Value>Google</Value>
|
||||
</String>
|
||||
<String>
|
||||
<Key>URL</Key>
|
||||
<Value>google.com</Value>
|
||||
</String>
|
||||
<String>
|
||||
<Key>UserName</Key>
|
||||
<Value>googleuser</Value>
|
||||
</String>
|
||||
<AutoType>
|
||||
<Enabled>True</Enabled>
|
||||
<DataTransferObfuscation>0</DataTransferObfuscation>
|
||||
</AutoType>
|
||||
</Entry>
|
||||
</History>
|
||||
</Entry>
|
||||
</Group>
|
||||
</Group>
|
||||
<DeletedObjects />
|
||||
</Root>
|
||||
</KeePassFile>`;
|
||||
|
||||
describe("KeePass2 Xml Importer", () => {
|
||||
it("should parse XML data", async () => {
|
||||
const importer = new Importer();
|
||||
const result = await importer.parse(TestData);
|
||||
expect(result != null).toBe(true);
|
||||
});
|
||||
});
|
||||
@@ -1,108 +0,0 @@
|
||||
import { KeeperJsonImporter as Importer } from "@/jslib/common/src/importers/keeperImporters/keeperJsonImporter";
|
||||
import { Utils } from "@/jslib/common/src/misc/utils";
|
||||
|
||||
import { testData as TestData } from "./testData/keeperJson/testData";
|
||||
|
||||
describe("Keeper Json Importer", () => {
|
||||
const testDataJson = JSON.stringify(TestData);
|
||||
|
||||
let importer: Importer;
|
||||
beforeEach(() => {
|
||||
importer = new Importer();
|
||||
});
|
||||
|
||||
it("should parse login data", async () => {
|
||||
const result = await importer.parse(testDataJson);
|
||||
expect(result != null).toBe(true);
|
||||
|
||||
const cipher = result.ciphers.shift();
|
||||
expect(cipher.name).toEqual("Bank Account 1");
|
||||
expect(cipher.login.username).toEqual("customer1234");
|
||||
expect(cipher.login.password).toEqual("4813fJDHF4239fdk");
|
||||
expect(cipher.login.uris.length).toEqual(1);
|
||||
const uriView = cipher.login.uris.shift();
|
||||
expect(uriView.uri).toEqual("https://chase.com");
|
||||
expect(cipher.notes).toEqual("These are some notes.");
|
||||
|
||||
const cipher2 = result.ciphers.shift();
|
||||
expect(cipher2.name).toEqual("Bank Account 2");
|
||||
expect(cipher2.login.username).toEqual("mybankusername");
|
||||
expect(cipher2.login.password).toEqual("w4k4k193f$^&@#*%2");
|
||||
expect(cipher2.login.uris.length).toEqual(1);
|
||||
const uriView2 = cipher2.login.uris.shift();
|
||||
expect(uriView2.uri).toEqual("https://amex.com");
|
||||
expect(cipher2.notes).toEqual("Some great information here.");
|
||||
|
||||
const cipher3 = result.ciphers.shift();
|
||||
expect(cipher3.name).toEqual("Some Account");
|
||||
expect(cipher3.login.username).toEqual("someUserName");
|
||||
expect(cipher3.login.password).toEqual("w4k4k1wergf$^&@#*%2");
|
||||
expect(cipher3.notes).toBeNull();
|
||||
expect(cipher3.fields).toBeNull();
|
||||
expect(cipher3.login.uris.length).toEqual(1);
|
||||
const uriView3 = cipher3.login.uris.shift();
|
||||
expect(uriView3.uri).toEqual("https://example.com");
|
||||
});
|
||||
|
||||
it("should import TOTP when present", async () => {
|
||||
const result = await importer.parse(testDataJson);
|
||||
expect(result != null).toBe(true);
|
||||
|
||||
const cipher = result.ciphers.shift();
|
||||
expect(cipher.login.totp).toBeNull();
|
||||
|
||||
// 2nd Cipher
|
||||
const cipher2 = result.ciphers.shift();
|
||||
expect(cipher2.login.totp).toEqual(
|
||||
"otpauth://totp/Amazon:me@company.com?secret=JBSWY3DPEHPK3PXP&issuer=Amazon&algorithm=SHA1&digits=6&period=30"
|
||||
);
|
||||
});
|
||||
|
||||
it("should parse custom fields", async () => {
|
||||
const result = await importer.parse(testDataJson);
|
||||
expect(result != null).toBe(true);
|
||||
|
||||
const cipher = result.ciphers.shift();
|
||||
expect(cipher.fields.length).toBe(1);
|
||||
expect(cipher.fields[0].name).toEqual("Account Number");
|
||||
expect(cipher.fields[0].value).toEqual("123-456-789");
|
||||
|
||||
// 2nd Cipher
|
||||
const cipher2 = result.ciphers.shift();
|
||||
expect(cipher2.fields.length).toBe(2);
|
||||
expect(cipher2.fields[0].name).toEqual("Security Group");
|
||||
expect(cipher2.fields[0].value).toEqual("Public");
|
||||
|
||||
expect(cipher2.fields[1].name).toEqual("IP Address");
|
||||
expect(cipher2.fields[1].value).toEqual("12.45.67.8");
|
||||
});
|
||||
|
||||
it("should create folders and assigned ciphers to them", async () => {
|
||||
const result = await importer.parse(testDataJson);
|
||||
expect(result != null).toBe(true);
|
||||
|
||||
const folders = result.folders;
|
||||
expect(folders.length).toBe(2);
|
||||
expect(folders[0].name).toBe("Optional Private Folder 1");
|
||||
expect(folders[1].name).toBe("My Customer 1");
|
||||
|
||||
expect(result.folderRelationships[0]).toEqual([0, 0]);
|
||||
expect(result.folderRelationships[1]).toEqual([1, 0]);
|
||||
expect(result.folderRelationships[2]).toEqual([1, 1]);
|
||||
});
|
||||
|
||||
it("should create collections if part of an organization", async () => {
|
||||
importer.organizationId = Utils.newGuid();
|
||||
const result = await importer.parse(testDataJson);
|
||||
expect(result != null).toBe(true);
|
||||
|
||||
const collections = result.collections;
|
||||
expect(collections.length).toBe(2);
|
||||
expect(collections[0].name).toBe("Optional Private Folder 1");
|
||||
expect(collections[1].name).toBe("My Customer 1");
|
||||
|
||||
expect(result.collectionRelationships[0]).toEqual([0, 0]);
|
||||
expect(result.collectionRelationships[1]).toEqual([1, 0]);
|
||||
expect(result.collectionRelationships[2]).toEqual([1, 1]);
|
||||
});
|
||||
});
|
||||
@@ -1,202 +0,0 @@
|
||||
import { CipherType } from "@/jslib/common/src/enums/cipherType";
|
||||
import { FieldType } from "@/jslib/common/src/enums/fieldType";
|
||||
import { LastPassCsvImporter as Importer } from "@/jslib/common/src/importers/lastpassCsvImporter";
|
||||
import { ImportResult } from "@/jslib/common/src/models/domain/importResult";
|
||||
import { CipherView } from "@/jslib/common/src/models/view/cipherView";
|
||||
import { FieldView } from "@/jslib/common/src/models/view/fieldView";
|
||||
|
||||
function baseExcept(result: ImportResult) {
|
||||
expect(result).not.toBeNull();
|
||||
expect(result.success).toBe(true);
|
||||
expect(result.ciphers.length).toBe(1);
|
||||
}
|
||||
|
||||
function expectLogin(cipher: CipherView) {
|
||||
expect(cipher.type).toBe(CipherType.Login);
|
||||
|
||||
expect(cipher.name).toBe("example.com");
|
||||
expect(cipher.notes).toBe("super secure notes");
|
||||
expect(cipher.login.uri).toBe("http://example.com");
|
||||
expect(cipher.login.username).toBe("someUser");
|
||||
expect(cipher.login.password).toBe("myPassword");
|
||||
expect(cipher.login.totp).toBe("Y64VEVMBTSXCYIWRSHRNDZW62MPGVU2G");
|
||||
}
|
||||
|
||||
const CipherData = [
|
||||
{
|
||||
title: "should parse expiration date",
|
||||
csv: `url,username,password,extra,name,grouping,fav
|
||||
http://sn,,,"NoteType:Credit Card
|
||||
Name on Card:John Doe
|
||||
Type:
|
||||
Number:1234567812345678
|
||||
Security Code:123
|
||||
Start Date:October,2017
|
||||
Expiration Date:June,2020
|
||||
Notes:some text
|
||||
",Credit-card,,0`,
|
||||
expected: Object.assign(new CipherView(), {
|
||||
id: null,
|
||||
organizationId: null,
|
||||
folderId: null,
|
||||
name: "Credit-card",
|
||||
notes: "some text\n",
|
||||
type: 3,
|
||||
card: {
|
||||
cardholderName: "John Doe",
|
||||
number: "1234567812345678",
|
||||
code: "123",
|
||||
expYear: "2020",
|
||||
expMonth: "6",
|
||||
},
|
||||
fields: [
|
||||
Object.assign(new FieldView(), {
|
||||
name: "Start Date",
|
||||
value: "October,2017",
|
||||
type: FieldType.Text,
|
||||
}),
|
||||
],
|
||||
}),
|
||||
},
|
||||
{
|
||||
title: "should parse blank card note",
|
||||
csv: `url,username,password,extra,name,grouping,fav
|
||||
http://sn,,,"NoteType:Credit Card
|
||||
Name on Card:
|
||||
Type:
|
||||
Number:
|
||||
Security Code:
|
||||
Start Date:,
|
||||
Expiration Date:,
|
||||
Notes:",empty,,0`,
|
||||
expected: Object.assign(new CipherView(), {
|
||||
id: null,
|
||||
organizationId: null,
|
||||
folderId: null,
|
||||
name: "empty",
|
||||
notes: null,
|
||||
type: 3,
|
||||
card: {
|
||||
expMonth: undefined,
|
||||
},
|
||||
fields: [
|
||||
Object.assign(new FieldView(), {
|
||||
name: "Start Date",
|
||||
value: ",",
|
||||
type: FieldType.Text,
|
||||
}),
|
||||
],
|
||||
}),
|
||||
},
|
||||
{
|
||||
title: "should parse card expiration date w/ no exp year",
|
||||
csv: `url,username,password,extra,name,grouping,fav
|
||||
http://sn,,,"NoteType:Credit Card
|
||||
Name on Card:John Doe
|
||||
Type:Visa
|
||||
Number:1234567887654321
|
||||
Security Code:321
|
||||
Start Date:,
|
||||
Expiration Date:January,
|
||||
Notes:",noyear,,0`,
|
||||
expected: Object.assign(new CipherView(), {
|
||||
id: null,
|
||||
organizationId: null,
|
||||
folderId: null,
|
||||
name: "noyear",
|
||||
notes: null,
|
||||
type: 3,
|
||||
card: {
|
||||
cardholderName: "John Doe",
|
||||
number: "1234567887654321",
|
||||
code: "321",
|
||||
expMonth: "1",
|
||||
},
|
||||
fields: [
|
||||
Object.assign(new FieldView(), {
|
||||
name: "Type",
|
||||
value: "Visa",
|
||||
type: FieldType.Text,
|
||||
}),
|
||||
Object.assign(new FieldView(), {
|
||||
name: "Start Date",
|
||||
value: ",",
|
||||
type: FieldType.Text,
|
||||
}),
|
||||
],
|
||||
}),
|
||||
},
|
||||
{
|
||||
title: "should parse card expiration date w/ no month",
|
||||
csv: `url,username,password,extra,name,grouping,fav
|
||||
http://sn,,,"NoteType:Credit Card
|
||||
Name on Card:John Doe
|
||||
Type:Mastercard
|
||||
Number:8765432112345678
|
||||
Security Code:987
|
||||
Start Date:,
|
||||
Expiration Date:,2020
|
||||
Notes:",nomonth,,0`,
|
||||
expected: Object.assign(new CipherView(), {
|
||||
id: null,
|
||||
organizationId: null,
|
||||
folderId: null,
|
||||
name: "nomonth",
|
||||
notes: null,
|
||||
type: 3,
|
||||
card: {
|
||||
cardholderName: "John Doe",
|
||||
number: "8765432112345678",
|
||||
code: "987",
|
||||
expYear: "2020",
|
||||
expMonth: undefined,
|
||||
},
|
||||
fields: [
|
||||
Object.assign(new FieldView(), {
|
||||
name: "Type",
|
||||
value: "Mastercard",
|
||||
type: FieldType.Text,
|
||||
}),
|
||||
Object.assign(new FieldView(), {
|
||||
name: "Start Date",
|
||||
value: ",",
|
||||
type: FieldType.Text,
|
||||
}),
|
||||
],
|
||||
}),
|
||||
},
|
||||
];
|
||||
|
||||
describe("Lastpass CSV Importer", () => {
|
||||
CipherData.forEach((data) => {
|
||||
it(data.title, async () => {
|
||||
const importer = new Importer();
|
||||
const result = await importer.parse(data.csv);
|
||||
expect(result != null).toBe(true);
|
||||
expect(result.ciphers.length).toBeGreaterThan(0);
|
||||
|
||||
const cipher = result.ciphers.shift();
|
||||
let property: keyof typeof data.expected;
|
||||
for (property in data.expected) {
|
||||
// eslint-disable-next-line
|
||||
if (data.expected.hasOwnProperty(property)) {
|
||||
// eslint-disable-next-line
|
||||
expect(cipher.hasOwnProperty(property)).toBe(true);
|
||||
expect(cipher[property]).toEqual(data.expected[property]);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it("should parse login with totp", async () => {
|
||||
const input = `url,username,password,totp,extra,name,grouping,fav
|
||||
http://example.com,someUser,myPassword,Y64VEVMBTSXCYIWRSHRNDZW62MPGVU2G,super secure notes,example.com,,0`;
|
||||
|
||||
const importer = new Importer();
|
||||
const result = await importer.parse(input);
|
||||
baseExcept(result);
|
||||
|
||||
const cipher = result.ciphers[0];
|
||||
expectLogin(cipher);
|
||||
});
|
||||
});
|
||||
@@ -1,633 +0,0 @@
|
||||
import { CipherType } from "@/jslib/common/src/enums/cipherType";
|
||||
import { MykiCsvImporter as Importer } from "@/jslib/common/src/importers/mykiCsvImporter";
|
||||
import { CipherView } from "@/jslib/common/src/models/view/cipherView";
|
||||
|
||||
import { userAccountData } from "./testData/mykiCsv/UserAccount.csv";
|
||||
import { userCreditCardData } from "./testData/mykiCsv/UserCreditCard.csv";
|
||||
import { userIdCardData } from "./testData/mykiCsv/UserIdCard.csv";
|
||||
import { userIdentityData } from "./testData/mykiCsv/UserIdentity.csv";
|
||||
import { userNoteData } from "./testData/mykiCsv/UserNote.csv";
|
||||
import { userTwoFaData } from "./testData/mykiCsv/UserTwofa.csv";
|
||||
|
||||
function expectDriversLicense(cipher: CipherView) {
|
||||
expect(cipher.type).toBe(CipherType.Identity);
|
||||
expect(cipher.name).toBe("Joe User's nickname");
|
||||
expect(cipher.notes).toBe("Additional information");
|
||||
|
||||
expect(cipher.identity.fullName).toBe("Joe M User");
|
||||
expect(cipher.identity.firstName).toBe("Joe");
|
||||
expect(cipher.identity.middleName).toBe("M");
|
||||
expect(cipher.identity.lastName).toBe("User");
|
||||
expect(cipher.identity.licenseNumber).toBe("123456");
|
||||
expect(cipher.identity.country).toBe("United States");
|
||||
|
||||
expect(cipher.fields.length).toBe(5);
|
||||
|
||||
expect(cipher.fields[0].name).toEqual("status");
|
||||
expect(cipher.fields[0].value).toEqual("active");
|
||||
|
||||
expect(cipher.fields[1].name).toEqual("tags");
|
||||
expect(cipher.fields[1].value).toEqual("someTag");
|
||||
|
||||
expect(cipher.fields[2].name).toEqual("idType");
|
||||
expect(cipher.fields[2].value).toEqual("Driver's License");
|
||||
|
||||
expect(cipher.fields[3].name).toEqual("idIssuanceDate");
|
||||
expect(cipher.fields[3].value).toEqual("02/02/2022");
|
||||
|
||||
expect(cipher.fields[4].name).toEqual("idExpirationDate");
|
||||
expect(cipher.fields[4].value).toEqual("02/02/2024");
|
||||
}
|
||||
|
||||
function expectPassport(cipher: CipherView) {
|
||||
expect(cipher.type).toBe(CipherType.Identity);
|
||||
expect(cipher.name).toBe("Passport ID card");
|
||||
expect(cipher.notes).toBe("Additional information field");
|
||||
|
||||
expect(cipher.identity.fullName).toBe("Joe M User");
|
||||
expect(cipher.identity.firstName).toBe("Joe");
|
||||
expect(cipher.identity.middleName).toBe("M");
|
||||
expect(cipher.identity.lastName).toBe("User");
|
||||
expect(cipher.identity.passportNumber).toBe("1234567");
|
||||
expect(cipher.identity.country).toBe("United States");
|
||||
|
||||
expect(cipher.fields.length).toBe(5);
|
||||
|
||||
expect(cipher.fields[0].name).toEqual("status");
|
||||
expect(cipher.fields[0].value).toEqual("active");
|
||||
|
||||
expect(cipher.fields[1].name).toEqual("tags");
|
||||
expect(cipher.fields[1].value).toEqual("someTag");
|
||||
|
||||
expect(cipher.fields[2].name).toEqual("idType");
|
||||
expect(cipher.fields[2].value).toEqual("Passport");
|
||||
|
||||
expect(cipher.fields[3].name).toEqual("idIssuanceDate");
|
||||
expect(cipher.fields[3].value).toEqual("03/07/2022");
|
||||
|
||||
expect(cipher.fields[4].name).toEqual("idExpirationDate");
|
||||
expect(cipher.fields[4].value).toEqual("03/07/2028");
|
||||
}
|
||||
|
||||
function expectSocialSecurity(cipher: CipherView) {
|
||||
expect(cipher.type).toBe(CipherType.Identity);
|
||||
expect(cipher.name).toBe("Social Security ID card");
|
||||
expect(cipher.notes).toBe("Additional information field text");
|
||||
|
||||
expect(cipher.identity.fullName).toBe("Joe M User");
|
||||
expect(cipher.identity.firstName).toBe("Joe");
|
||||
expect(cipher.identity.middleName).toBe("M");
|
||||
expect(cipher.identity.lastName).toBe("User");
|
||||
expect(cipher.identity.ssn).toBe("123455678");
|
||||
expect(cipher.identity.country).toBe("United States");
|
||||
|
||||
expect(cipher.fields.length).toBe(5);
|
||||
|
||||
expect(cipher.fields[0].name).toEqual("status");
|
||||
expect(cipher.fields[0].value).toEqual("active");
|
||||
|
||||
expect(cipher.fields[1].name).toEqual("tags");
|
||||
expect(cipher.fields[1].value).toEqual("someTag");
|
||||
|
||||
expect(cipher.fields[2].name).toEqual("idType");
|
||||
expect(cipher.fields[2].value).toEqual("Social Security");
|
||||
|
||||
expect(cipher.fields[3].name).toEqual("idIssuanceDate");
|
||||
expect(cipher.fields[3].value).toEqual("03/07/2022");
|
||||
|
||||
expect(cipher.fields[4].name).toEqual("idExpirationDate");
|
||||
expect(cipher.fields[4].value).toEqual("03/07/2028");
|
||||
}
|
||||
|
||||
function expectIdCard(cipher: CipherView) {
|
||||
expect(cipher.type).toBe(CipherType.Identity);
|
||||
expect(cipher.name).toBe("ID card type ID card");
|
||||
expect(cipher.notes).toBe("Additional Information field text");
|
||||
|
||||
expect(cipher.identity.fullName).toBe("Joe M User");
|
||||
expect(cipher.identity.firstName).toBe("Joe");
|
||||
expect(cipher.identity.middleName).toBe("M");
|
||||
expect(cipher.identity.lastName).toBe("User");
|
||||
expect(cipher.identity.licenseNumber).toBe("1234566");
|
||||
expect(cipher.identity.country).toBe("United States");
|
||||
|
||||
expect(cipher.fields.length).toBe(5);
|
||||
|
||||
expect(cipher.fields[0].name).toEqual("status");
|
||||
expect(cipher.fields[0].value).toEqual("active");
|
||||
|
||||
expect(cipher.fields[1].name).toEqual("tags");
|
||||
expect(cipher.fields[1].value).toEqual("someTag");
|
||||
|
||||
expect(cipher.fields[2].name).toEqual("idType");
|
||||
expect(cipher.fields[2].value).toEqual("ID Card");
|
||||
|
||||
expect(cipher.fields[3].name).toEqual("idIssuanceDate");
|
||||
expect(cipher.fields[3].value).toEqual("03/07/2022");
|
||||
|
||||
expect(cipher.fields[4].name).toEqual("idExpirationDate");
|
||||
expect(cipher.fields[4].value).toEqual("03/07/2028");
|
||||
}
|
||||
|
||||
function expectTaxNumber(cipher: CipherView) {
|
||||
expect(cipher.type).toBe(CipherType.Identity);
|
||||
expect(cipher.name).toBe("Tax number ID card");
|
||||
expect(cipher.notes).toBe("Additinoal information text field");
|
||||
|
||||
expect(cipher.identity.fullName).toBe("Joe M User");
|
||||
expect(cipher.identity.firstName).toBe("Joe");
|
||||
expect(cipher.identity.middleName).toBe("M");
|
||||
expect(cipher.identity.lastName).toBe("User");
|
||||
expect(cipher.identity.licenseNumber).toBe("12345678");
|
||||
expect(cipher.identity.country).toBe("United States");
|
||||
|
||||
expect(cipher.fields.length).toBe(5);
|
||||
|
||||
expect(cipher.fields[0].name).toEqual("status");
|
||||
expect(cipher.fields[0].value).toEqual("active");
|
||||
|
||||
expect(cipher.fields[1].name).toEqual("tags");
|
||||
expect(cipher.fields[1].value).toEqual("someTag");
|
||||
|
||||
expect(cipher.fields[2].name).toEqual("idType");
|
||||
expect(cipher.fields[2].value).toEqual("Tax Number");
|
||||
|
||||
expect(cipher.fields[3].name).toEqual("idIssuanceDate");
|
||||
expect(cipher.fields[3].value).toEqual("03/07/2022");
|
||||
|
||||
expect(cipher.fields[4].name).toEqual("idExpirationDate");
|
||||
expect(cipher.fields[4].value).toEqual("03/07/2028");
|
||||
}
|
||||
|
||||
function expectBankAccount(cipher: CipherView) {
|
||||
expect(cipher.type).toBe(CipherType.Identity);
|
||||
expect(cipher.name).toBe("Bank account ID card");
|
||||
expect(cipher.notes).toBe("Additional text information here");
|
||||
|
||||
expect(cipher.identity.fullName).toBe("Joe M User");
|
||||
expect(cipher.identity.firstName).toBe("Joe");
|
||||
expect(cipher.identity.middleName).toBe("M");
|
||||
expect(cipher.identity.lastName).toBe("User");
|
||||
expect(cipher.identity.licenseNumber).toBe("12344556677");
|
||||
expect(cipher.identity.country).toBe("United States");
|
||||
|
||||
expect(cipher.fields.length).toBe(5);
|
||||
|
||||
expect(cipher.fields[0].name).toEqual("status");
|
||||
expect(cipher.fields[0].value).toEqual("active");
|
||||
|
||||
expect(cipher.fields[1].name).toEqual("tags");
|
||||
expect(cipher.fields[1].value).toEqual("someTag");
|
||||
|
||||
expect(cipher.fields[2].name).toEqual("idType");
|
||||
expect(cipher.fields[2].value).toEqual("Bank Account");
|
||||
|
||||
expect(cipher.fields[3].name).toEqual("idIssuanceDate");
|
||||
expect(cipher.fields[3].value).toEqual("03/07/2022");
|
||||
|
||||
expect(cipher.fields[4].name).toEqual("idExpirationDate");
|
||||
expect(cipher.fields[4].value).toEqual("03/07/2028");
|
||||
}
|
||||
|
||||
function expectInsuranceCard(cipher: CipherView) {
|
||||
expect(cipher.type).toBe(CipherType.Identity);
|
||||
expect(cipher.name).toBe("Insurance card ID card");
|
||||
expect(cipher.notes).toBe("Additional information text goes here");
|
||||
|
||||
expect(cipher.identity.fullName).toBe("Joe M User");
|
||||
expect(cipher.identity.firstName).toBe("Joe");
|
||||
expect(cipher.identity.middleName).toBe("M");
|
||||
expect(cipher.identity.lastName).toBe("User");
|
||||
expect(cipher.identity.licenseNumber).toBe("123456677");
|
||||
expect(cipher.identity.country).toBe("United States");
|
||||
|
||||
expect(cipher.fields.length).toBe(5);
|
||||
|
||||
expect(cipher.fields[0].name).toEqual("status");
|
||||
expect(cipher.fields[0].value).toEqual("active");
|
||||
|
||||
expect(cipher.fields[1].name).toEqual("tags");
|
||||
expect(cipher.fields[1].value).toEqual("someTag");
|
||||
|
||||
expect(cipher.fields[2].name).toEqual("idType");
|
||||
expect(cipher.fields[2].value).toEqual("Insurance Card");
|
||||
|
||||
expect(cipher.fields[3].name).toEqual("idIssuanceDate");
|
||||
expect(cipher.fields[3].value).toEqual("03/07/2022");
|
||||
|
||||
expect(cipher.fields[4].name).toEqual("idExpirationDate");
|
||||
expect(cipher.fields[4].value).toEqual("03/07/2022");
|
||||
}
|
||||
|
||||
function expectHealthCard(cipher: CipherView) {
|
||||
expect(cipher.type).toBe(CipherType.Identity);
|
||||
expect(cipher.name).toBe("Health card Id card");
|
||||
expect(cipher.notes).toBe("More info");
|
||||
|
||||
expect(cipher.identity.fullName).toBe("Joe M User");
|
||||
expect(cipher.identity.firstName).toBe("Joe");
|
||||
expect(cipher.identity.middleName).toBe("M");
|
||||
expect(cipher.identity.lastName).toBe("User");
|
||||
expect(cipher.identity.licenseNumber).toBe("1234670");
|
||||
expect(cipher.identity.country).toBe("United States");
|
||||
|
||||
expect(cipher.fields.length).toBe(5);
|
||||
|
||||
expect(cipher.fields[0].name).toEqual("status");
|
||||
expect(cipher.fields[0].value).toEqual("active");
|
||||
|
||||
expect(cipher.fields[1].name).toEqual("tags");
|
||||
expect(cipher.fields[1].value).toEqual("someTag");
|
||||
|
||||
expect(cipher.fields[2].name).toEqual("idType");
|
||||
expect(cipher.fields[2].value).toEqual("Health Card");
|
||||
|
||||
expect(cipher.fields[3].name).toEqual("idIssuanceDate");
|
||||
expect(cipher.fields[3].value).toEqual("03/07/2022");
|
||||
|
||||
expect(cipher.fields[4].name).toEqual("idExpirationDate");
|
||||
expect(cipher.fields[4].value).toEqual("03/07/2028");
|
||||
}
|
||||
|
||||
function expectMembershipCard(cipher: CipherView) {
|
||||
expect(cipher.type).toBe(CipherType.Identity);
|
||||
expect(cipher.name).toBe("Membership ID card");
|
||||
expect(cipher.notes).toBe("Add'l info");
|
||||
|
||||
expect(cipher.identity.fullName).toBe("Joe M User");
|
||||
expect(cipher.identity.firstName).toBe("Joe");
|
||||
expect(cipher.identity.middleName).toBe("M");
|
||||
expect(cipher.identity.lastName).toBe("User");
|
||||
expect(cipher.identity.licenseNumber).toBe("12345709");
|
||||
expect(cipher.identity.country).toBe("United States");
|
||||
|
||||
expect(cipher.fields.length).toBe(5);
|
||||
|
||||
expect(cipher.fields[0].name).toEqual("status");
|
||||
expect(cipher.fields[0].value).toEqual("active");
|
||||
|
||||
expect(cipher.fields[1].name).toEqual("tags");
|
||||
expect(cipher.fields[1].value).toEqual("someTag");
|
||||
|
||||
expect(cipher.fields[2].name).toEqual("idType");
|
||||
expect(cipher.fields[2].value).toEqual("Membership");
|
||||
|
||||
expect(cipher.fields[3].name).toEqual("idIssuanceDate");
|
||||
expect(cipher.fields[3].value).toEqual("03/07/2022");
|
||||
|
||||
expect(cipher.fields[4].name).toEqual("idExpirationDate");
|
||||
expect(cipher.fields[4].value).toEqual("03/07/2028");
|
||||
}
|
||||
|
||||
function expectDatabase(cipher: CipherView) {
|
||||
expect(cipher.type).toBe(CipherType.Identity);
|
||||
expect(cipher.name).toBe("Database ID card");
|
||||
expect(cipher.notes).toBe("Addin't info");
|
||||
|
||||
expect(cipher.identity.fullName).toBe("Joe M User");
|
||||
expect(cipher.identity.firstName).toBe("Joe");
|
||||
expect(cipher.identity.middleName).toBe("M");
|
||||
expect(cipher.identity.lastName).toBe("User");
|
||||
expect(cipher.identity.licenseNumber).toBe("12345089u");
|
||||
expect(cipher.identity.country).toBe("United States");
|
||||
|
||||
expect(cipher.fields.length).toBe(5);
|
||||
|
||||
expect(cipher.fields[0].name).toEqual("status");
|
||||
expect(cipher.fields[0].value).toEqual("active");
|
||||
|
||||
expect(cipher.fields[1].name).toEqual("tags");
|
||||
expect(cipher.fields[1].value).toEqual("someTag");
|
||||
|
||||
expect(cipher.fields[2].name).toEqual("idType");
|
||||
expect(cipher.fields[2].value).toEqual("Database");
|
||||
|
||||
expect(cipher.fields[3].name).toEqual("idIssuanceDate");
|
||||
expect(cipher.fields[3].value).toEqual("03/07/2022");
|
||||
|
||||
expect(cipher.fields[4].name).toEqual("idExpirationDate");
|
||||
expect(cipher.fields[4].value).toEqual("03/07/2028");
|
||||
}
|
||||
|
||||
function expectOutdoorLicense(cipher: CipherView) {
|
||||
expect(cipher.type).toBe(CipherType.Identity);
|
||||
expect(cipher.name).toBe("Outdoor license ID card");
|
||||
expect(cipher.notes).toBe("Additional info");
|
||||
|
||||
expect(cipher.identity.fullName).toBe("Joe M User");
|
||||
expect(cipher.identity.firstName).toBe("Joe");
|
||||
expect(cipher.identity.middleName).toBe("M");
|
||||
expect(cipher.identity.lastName).toBe("User");
|
||||
expect(cipher.identity.licenseNumber).toBe("123890090");
|
||||
expect(cipher.identity.country).toBe("United States");
|
||||
|
||||
expect(cipher.fields.length).toBe(5);
|
||||
|
||||
expect(cipher.fields[0].name).toEqual("status");
|
||||
expect(cipher.fields[0].value).toEqual("active");
|
||||
|
||||
expect(cipher.fields[1].name).toEqual("tags");
|
||||
expect(cipher.fields[1].value).toEqual("someTag");
|
||||
|
||||
expect(cipher.fields[2].name).toEqual("idType");
|
||||
expect(cipher.fields[2].value).toEqual("Outdoor License");
|
||||
|
||||
expect(cipher.fields[3].name).toEqual("idIssuanceDate");
|
||||
expect(cipher.fields[3].value).toEqual("03/07/2022");
|
||||
|
||||
expect(cipher.fields[4].name).toEqual("idExpirationDate");
|
||||
expect(cipher.fields[4].value).toEqual("03/07/2028");
|
||||
}
|
||||
|
||||
function expectRewardProgram(cipher: CipherView) {
|
||||
expect(cipher.type).toBe(CipherType.Identity);
|
||||
expect(cipher.name).toBe("Reward program Id card");
|
||||
expect(cipher.notes).toBe("1234890");
|
||||
|
||||
expect(cipher.identity.fullName).toBe("Joe M User");
|
||||
expect(cipher.identity.firstName).toBe("Joe");
|
||||
expect(cipher.identity.middleName).toBe("M");
|
||||
expect(cipher.identity.lastName).toBe("User");
|
||||
expect(cipher.identity.licenseNumber).toBe("12345890b");
|
||||
expect(cipher.identity.country).toBe("United States");
|
||||
|
||||
expect(cipher.fields.length).toBe(5);
|
||||
|
||||
expect(cipher.fields[0].name).toEqual("status");
|
||||
expect(cipher.fields[0].value).toEqual("active");
|
||||
|
||||
expect(cipher.fields[1].name).toEqual("tags");
|
||||
expect(cipher.fields[1].value).toEqual("someTag");
|
||||
|
||||
expect(cipher.fields[2].name).toEqual("idType");
|
||||
expect(cipher.fields[2].value).toEqual("Reward Program");
|
||||
|
||||
expect(cipher.fields[3].name).toEqual("idIssuanceDate");
|
||||
expect(cipher.fields[3].value).toEqual("03/07/2022");
|
||||
|
||||
expect(cipher.fields[4].name).toEqual("idExpirationDate");
|
||||
expect(cipher.fields[4].value).toEqual("03/07/2028");
|
||||
}
|
||||
|
||||
function expectSoftwareLicense(cipher: CipherView) {
|
||||
expect(cipher.type).toBe(CipherType.Identity);
|
||||
expect(cipher.name).toBe("Software license ID card");
|
||||
expect(cipher.notes).toBe(
|
||||
"It seems like the fields don't change, which makes it pretty useless that they have so many ID card types."
|
||||
);
|
||||
|
||||
expect(cipher.identity.fullName).toBe("Joe M User");
|
||||
expect(cipher.identity.firstName).toBe("Joe");
|
||||
expect(cipher.identity.middleName).toBe("M");
|
||||
expect(cipher.identity.lastName).toBe("User");
|
||||
expect(cipher.identity.licenseNumber).toBe("1234567c");
|
||||
expect(cipher.identity.country).toBe("United States");
|
||||
|
||||
expect(cipher.fields.length).toBe(5);
|
||||
|
||||
expect(cipher.fields[0].name).toEqual("status");
|
||||
expect(cipher.fields[0].value).toEqual("active");
|
||||
|
||||
expect(cipher.fields[1].name).toEqual("tags");
|
||||
expect(cipher.fields[1].value).toEqual("someTag");
|
||||
|
||||
expect(cipher.fields[2].name).toEqual("idType");
|
||||
expect(cipher.fields[2].value).toEqual("Software License");
|
||||
|
||||
expect(cipher.fields[3].name).toEqual("idIssuanceDate");
|
||||
expect(cipher.fields[3].value).toEqual("03/07/2022");
|
||||
|
||||
expect(cipher.fields[4].name).toEqual("idExpirationDate");
|
||||
expect(cipher.fields[4].value).toEqual("03/07/2028");
|
||||
}
|
||||
|
||||
function expectTourVisa(cipher: CipherView) {
|
||||
expect(cipher.type).toBe(CipherType.Identity);
|
||||
expect(cipher.name).toBe("Tour visa ID card");
|
||||
expect(cipher.notes).toBe("Additional Informaion text");
|
||||
|
||||
expect(cipher.identity.fullName).toBe("Joe M User");
|
||||
expect(cipher.identity.firstName).toBe("Joe");
|
||||
expect(cipher.identity.middleName).toBe("M");
|
||||
expect(cipher.identity.lastName).toBe("User");
|
||||
expect(cipher.identity.licenseNumber).toBe("123456lkhj");
|
||||
expect(cipher.identity.country).toBe("United States");
|
||||
|
||||
expect(cipher.fields.length).toBe(5);
|
||||
|
||||
expect(cipher.fields[0].name).toEqual("status");
|
||||
expect(cipher.fields[0].value).toEqual("active");
|
||||
|
||||
expect(cipher.fields[1].name).toEqual("tags");
|
||||
expect(cipher.fields[1].value).toEqual("someTag");
|
||||
|
||||
expect(cipher.fields[2].name).toEqual("idType");
|
||||
expect(cipher.fields[2].value).toEqual("Tour Visa");
|
||||
|
||||
expect(cipher.fields[3].name).toEqual("idIssuanceDate");
|
||||
expect(cipher.fields[3].value).toEqual("03/07/2022");
|
||||
|
||||
expect(cipher.fields[4].name).toEqual("idExpirationDate");
|
||||
expect(cipher.fields[4].value).toEqual("03/07/2028");
|
||||
}
|
||||
|
||||
describe("Myki CSV Importer", () => {
|
||||
let importer: Importer;
|
||||
beforeEach(() => {
|
||||
importer = new Importer();
|
||||
});
|
||||
|
||||
it("should parse userAccount records", async () => {
|
||||
const result = await importer.parse(userAccountData);
|
||||
expect(result != null).toBe(true);
|
||||
|
||||
const cipher = result.ciphers.shift();
|
||||
|
||||
expect(cipher.name).toEqual("PasswordNickname");
|
||||
expect(cipher.login.username).toEqual("user.name@email.com");
|
||||
expect(cipher.login.password).toEqual("abc123");
|
||||
expect(cipher.login.totp).toEqual("someTOTPSeed");
|
||||
expect(cipher.login.uris.length).toEqual(1);
|
||||
const uriView = cipher.login.uris.shift();
|
||||
expect(uriView.uri).toEqual("http://www.google.com");
|
||||
expect(cipher.notes).toEqual("This is the additional information text.");
|
||||
|
||||
expect(cipher.fields.length).toBe(2);
|
||||
|
||||
expect(cipher.fields[0].name).toBe("status");
|
||||
expect(cipher.fields[0].value).toBe("active");
|
||||
|
||||
expect(cipher.fields[1].name).toBe("tags");
|
||||
expect(cipher.fields[1].value).toBe("someTag");
|
||||
});
|
||||
|
||||
it("should parse userTwoFa records", async () => {
|
||||
const result = await importer.parse(userTwoFaData);
|
||||
expect(result != null).toBe(true);
|
||||
|
||||
const cipher = result.ciphers.shift();
|
||||
|
||||
expect(cipher.name).toEqual("2FA nickname");
|
||||
expect(cipher.login.username).toBeNull();
|
||||
expect(cipher.login.password).toBeNull();
|
||||
expect(cipher.login.totp).toBe("someTOTPSeed");
|
||||
expect(cipher.notes).toEqual("Additional information field content.");
|
||||
|
||||
expect(cipher.fields.length).toBe(2);
|
||||
|
||||
expect(cipher.fields[0].name).toBe("status");
|
||||
expect(cipher.fields[0].value).toBe("active");
|
||||
|
||||
expect(cipher.fields[1].name).toBe("tags");
|
||||
expect(cipher.fields[1].value).toBe("someTag");
|
||||
});
|
||||
|
||||
it("should parse creditCard records", async () => {
|
||||
const result = await importer.parse(userCreditCardData);
|
||||
|
||||
expect(result).not.toBeNull();
|
||||
expect(result.success).toBe(true);
|
||||
expect(result.ciphers.length).toBe(1);
|
||||
|
||||
const cipher = result.ciphers.shift();
|
||||
expect(cipher.type).toBe(CipherType.Card);
|
||||
expect(cipher.name).toBe("Visa test card");
|
||||
expect(cipher.card.brand).toBe("Visa");
|
||||
expect(cipher.card.cardholderName).toBe("Joe User");
|
||||
expect(cipher.card.number).toBe("4111111111111111");
|
||||
expect(cipher.card.code).toBe("222");
|
||||
expect(cipher.card.expMonth).toBe("04");
|
||||
expect(cipher.card.expYear).toBe("24");
|
||||
|
||||
expect(cipher.notes).toBe("This is the additional information field");
|
||||
|
||||
expect(cipher.fields.length).toBe(2);
|
||||
|
||||
expect(cipher.fields[0].name).toBe("status");
|
||||
expect(cipher.fields[0].value).toBe("active");
|
||||
|
||||
expect(cipher.fields[1].name).toBe("tags");
|
||||
expect(cipher.fields[1].value).toBe("someTag");
|
||||
});
|
||||
|
||||
it("should parse identity records", async () => {
|
||||
const result = await importer.parse(userIdentityData);
|
||||
|
||||
expect(result).not.toBeNull();
|
||||
expect(result.success).toBe(true);
|
||||
|
||||
const cipher = result.ciphers.shift();
|
||||
expect(cipher.type).toBe(CipherType.Identity);
|
||||
expect(cipher.name).toBe("Joe User's nickname");
|
||||
expect(cipher.identity.fullName).toBe("Mr Joe M User");
|
||||
expect(cipher.identity.title).toBe("Mr");
|
||||
expect(cipher.identity.firstName).toBe("Joe");
|
||||
expect(cipher.identity.middleName).toBe("M");
|
||||
expect(cipher.identity.lastName).toBe("User");
|
||||
expect(cipher.identity.email).toBe("joe.user@email.com");
|
||||
|
||||
expect(cipher.identity.address1).toBe("1 Example House");
|
||||
expect(cipher.identity.address2).toBe("Suite 300");
|
||||
|
||||
expect(cipher.identity.city).toBe("Portland");
|
||||
expect(cipher.identity.postalCode).toBe("04101");
|
||||
expect(cipher.identity.country).toBe("United States");
|
||||
|
||||
expect(cipher.fields.length).toBe(4);
|
||||
|
||||
expect(cipher.fields[0].name).toEqual("status");
|
||||
expect(cipher.fields[0].value).toEqual("active");
|
||||
|
||||
expect(cipher.fields[1].name).toBe("tags");
|
||||
expect(cipher.fields[1].value).toBe("someTag");
|
||||
|
||||
expect(cipher.fields[2].name).toEqual("gender");
|
||||
expect(cipher.fields[2].value).toEqual("Male");
|
||||
|
||||
expect(cipher.fields[3].name).toEqual("number");
|
||||
expect(cipher.fields[3].value).toEqual("2223334444");
|
||||
});
|
||||
|
||||
it("should parse secureNote records", async () => {
|
||||
const result = await importer.parse(userNoteData);
|
||||
|
||||
expect(result).not.toBeNull();
|
||||
expect(result.success).toBe(true);
|
||||
expect(result.ciphers.length).toBe(1);
|
||||
|
||||
const cipher = result.ciphers.shift();
|
||||
expect(cipher.type).toBe(CipherType.SecureNote);
|
||||
expect(cipher.name).toBe("The title of a secure note");
|
||||
expect(cipher.notes).toBe("The content of a secure note. Lorem ipsum, etc.");
|
||||
|
||||
expect(cipher.fields.length).toBe(1);
|
||||
|
||||
expect(cipher.fields[0].name).toBe("status");
|
||||
expect(cipher.fields[0].value).toBe("active");
|
||||
});
|
||||
|
||||
it("should parse idCard records", async () => {
|
||||
const result = await importer.parse(userIdCardData);
|
||||
|
||||
expect(result).not.toBeNull();
|
||||
expect(result.success).toBe(true);
|
||||
|
||||
expect(result.ciphers.length).toBe(14);
|
||||
|
||||
// Driver's license
|
||||
const cipher = result.ciphers.shift();
|
||||
expectDriversLicense(cipher);
|
||||
|
||||
// Passport
|
||||
const cipher2 = result.ciphers.shift();
|
||||
expectPassport(cipher2);
|
||||
|
||||
// Social Security
|
||||
const cipher3 = result.ciphers.shift();
|
||||
expectSocialSecurity(cipher3);
|
||||
|
||||
// Id Card
|
||||
const cipher4 = result.ciphers.shift();
|
||||
expectIdCard(cipher4);
|
||||
|
||||
// Tax Number
|
||||
const cipher5 = result.ciphers.shift();
|
||||
expectTaxNumber(cipher5);
|
||||
|
||||
// Bank Account
|
||||
const cipher6 = result.ciphers.shift();
|
||||
expectBankAccount(cipher6);
|
||||
|
||||
// Insurance card
|
||||
const cipher7 = result.ciphers.shift();
|
||||
expectInsuranceCard(cipher7);
|
||||
|
||||
// Health card
|
||||
const cipher8 = result.ciphers.shift();
|
||||
expectHealthCard(cipher8);
|
||||
|
||||
// Membership card
|
||||
const cipher9 = result.ciphers.shift();
|
||||
expectMembershipCard(cipher9);
|
||||
|
||||
// Database card
|
||||
const cipher10 = result.ciphers.shift();
|
||||
expectDatabase(cipher10);
|
||||
|
||||
// Outdoor license
|
||||
const cipher11 = result.ciphers.shift();
|
||||
expectOutdoorLicense(cipher11);
|
||||
|
||||
// Reward program
|
||||
const cipher12 = result.ciphers.shift();
|
||||
expectRewardProgram(cipher12);
|
||||
|
||||
// Software license
|
||||
const cipher13 = result.ciphers.shift();
|
||||
expectSoftwareLicense(cipher13);
|
||||
|
||||
// Tour visa
|
||||
const cipher14 = result.ciphers.shift();
|
||||
expectTourVisa(cipher14);
|
||||
});
|
||||
});
|
||||
@@ -1,181 +0,0 @@
|
||||
import { CipherType } from "@/jslib/common/src/enums/cipherType";
|
||||
import { SecureNoteType } from "@/jslib/common/src/enums/secureNoteType";
|
||||
import { NordPassCsvImporter as Importer } from "@/jslib/common/src/importers/nordpassCsvImporter";
|
||||
import { CipherView } from "@/jslib/common/src/models/view/cipherView";
|
||||
import { IdentityView } from "@/jslib/common/src/models/view/identityView";
|
||||
|
||||
import { data as creditCardData } from "./testData/nordpassCsv/nordpass.card.csv";
|
||||
import { data as identityData } from "./testData/nordpassCsv/nordpass.identity.csv";
|
||||
import { data as loginData } from "./testData/nordpassCsv/nordpass.login.csv";
|
||||
import { data as secureNoteData } from "./testData/nordpassCsv/nordpass.secureNote.csv";
|
||||
|
||||
const namesTestData = [
|
||||
{
|
||||
title: "Given #fullName should set firstName",
|
||||
fullName: "MyFirstName",
|
||||
expected: Object.assign(new IdentityView(), {
|
||||
firstName: "MyFirstName",
|
||||
middleName: null,
|
||||
lastName: null,
|
||||
}),
|
||||
},
|
||||
{
|
||||
title: "Given #fullName should set first- and lastName",
|
||||
fullName: "MyFirstName MyLastName",
|
||||
expected: Object.assign(new IdentityView(), {
|
||||
firstName: "MyFirstName",
|
||||
middleName: null,
|
||||
lastName: "MyLastName",
|
||||
}),
|
||||
},
|
||||
{
|
||||
title: "Given #fullName should set first-, middle and lastName",
|
||||
fullName: "MyFirstName MyMiddleName MyLastName",
|
||||
expected: Object.assign(new IdentityView(), {
|
||||
firstName: "MyFirstName",
|
||||
middleName: "MyMiddleName",
|
||||
lastName: "MyLastName",
|
||||
}),
|
||||
},
|
||||
{
|
||||
title: "Given #fullName should set first-, middle and lastName with Jr",
|
||||
fullName: "MyFirstName MyMiddleName MyLastName Jr",
|
||||
expected: Object.assign(new IdentityView(), {
|
||||
firstName: "MyFirstName",
|
||||
middleName: "MyMiddleName",
|
||||
lastName: "MyLastName Jr",
|
||||
}),
|
||||
},
|
||||
{
|
||||
title: "Given #fullName should set first-, middle and lastName with Jr and III",
|
||||
fullName: "MyFirstName MyMiddleName MyLastName Jr III",
|
||||
expected: Object.assign(new IdentityView(), {
|
||||
firstName: "MyFirstName",
|
||||
middleName: "MyMiddleName",
|
||||
lastName: "MyLastName Jr III",
|
||||
}),
|
||||
},
|
||||
];
|
||||
|
||||
function expectLogin(cipher: CipherView) {
|
||||
expect(cipher.type).toBe(CipherType.Login);
|
||||
|
||||
expect(cipher.name).toBe("SomeVaultItemName");
|
||||
expect(cipher.notes).toBe("Some note for the VaultItem");
|
||||
expect(cipher.login.uri).toBe("https://example.com");
|
||||
expect(cipher.login.username).toBe("hello@bitwarden.com");
|
||||
expect(cipher.login.password).toBe("someStrongPassword");
|
||||
}
|
||||
|
||||
function expectCreditCard(cipher: CipherView) {
|
||||
expect(cipher.type).toBe(CipherType.Card);
|
||||
|
||||
expect(cipher.name).toBe("SomeVisa");
|
||||
expect(cipher.card.brand).toBe("Visa");
|
||||
expect(cipher.card.cardholderName).toBe("SomeHolder");
|
||||
expect(cipher.card.number).toBe("4024007103939509");
|
||||
expect(cipher.card.code).toBe("123");
|
||||
expect(cipher.card.expMonth).toBe("1");
|
||||
expect(cipher.card.expYear).toBe("22");
|
||||
}
|
||||
|
||||
function expectIdentity(cipher: CipherView) {
|
||||
expect(cipher.type).toBe(CipherType.Identity);
|
||||
|
||||
expect(cipher.name).toBe("SomeTitle");
|
||||
expect(cipher.identity.fullName).toBe("MyFirstName MyMiddleName MyLastName");
|
||||
expect(cipher.identity.firstName).toBe("MyFirstName");
|
||||
expect(cipher.identity.middleName).toBe("MyMiddleName");
|
||||
expect(cipher.identity.lastName).toBe("MyLastName");
|
||||
expect(cipher.identity.email).toBe("hello@bitwarden.com");
|
||||
expect(cipher.identity.phone).toBe("123456789");
|
||||
|
||||
expect(cipher.identity.address1).toBe("Test street 123");
|
||||
expect(cipher.identity.address2).toBe("additional addressinfo");
|
||||
expect(cipher.identity.postalCode).toBe("123456");
|
||||
expect(cipher.identity.city).toBe("Cologne");
|
||||
expect(cipher.identity.state).toBe("North-Rhine-Westphalia");
|
||||
expect(cipher.identity.country).toBe("GERMANY");
|
||||
expect(cipher.notes).toBe("SomeNoteToMyIdentity");
|
||||
}
|
||||
|
||||
function expectSecureNote(cipher: CipherView) {
|
||||
expect(cipher.type).toBe(CipherType.SecureNote);
|
||||
|
||||
expect(cipher.name).toBe("MySuperSecureNoteTitle");
|
||||
expect(cipher.secureNote.type).toBe(SecureNoteType.Generic);
|
||||
expect(cipher.notes).toBe("MySuperSecureNote");
|
||||
}
|
||||
|
||||
describe("NordPass CSV Importer", () => {
|
||||
let importer: Importer;
|
||||
beforeEach(() => {
|
||||
importer = new Importer();
|
||||
});
|
||||
|
||||
it("should parse login records", async () => {
|
||||
const result = await importer.parse(loginData);
|
||||
|
||||
expect(result).not.toBeNull();
|
||||
expect(result.success).toBe(true);
|
||||
expect(result.ciphers.length).toBe(1);
|
||||
const cipher = result.ciphers[0];
|
||||
expectLogin(cipher);
|
||||
});
|
||||
|
||||
it("should parse credit card records", async () => {
|
||||
const result = await importer.parse(creditCardData);
|
||||
|
||||
expect(result).not.toBeNull();
|
||||
expect(result.success).toBe(true);
|
||||
expect(result.ciphers.length).toBe(1);
|
||||
const cipher = result.ciphers[0];
|
||||
expectCreditCard(cipher);
|
||||
});
|
||||
|
||||
it("should parse identity records", async () => {
|
||||
const result = await importer.parse(
|
||||
identityData.replace("#fullName", "MyFirstName MyMiddleName MyLastName")
|
||||
);
|
||||
|
||||
expect(result).not.toBeNull();
|
||||
expect(result.success).toBe(true);
|
||||
expect(result.ciphers.length).toBe(1);
|
||||
const cipher = result.ciphers[0];
|
||||
expectIdentity(cipher);
|
||||
});
|
||||
|
||||
namesTestData.forEach((data) => {
|
||||
it(data.title.replace("#fullName", data.fullName), async () => {
|
||||
const result = await importer.parse(identityData.replace("#fullName", data.fullName));
|
||||
|
||||
expect(result).not.toBeNull();
|
||||
expect(result.success).toBe(true);
|
||||
expect(result.ciphers.length).toBe(1);
|
||||
const cipher = result.ciphers[0];
|
||||
expect(cipher.identity.firstName).toBe(data.expected.firstName);
|
||||
expect(cipher.identity.middleName).toBe(data.expected.middleName);
|
||||
expect(cipher.identity.lastName).toBe(data.expected.lastName);
|
||||
});
|
||||
});
|
||||
|
||||
it("should parse secureNote records", async () => {
|
||||
const result = await importer.parse(secureNoteData);
|
||||
|
||||
expect(result).not.toBeNull();
|
||||
expect(result.success).toBe(true);
|
||||
expect(result.ciphers.length).toBe(1);
|
||||
const cipher = result.ciphers[0];
|
||||
expectSecureNote(cipher);
|
||||
});
|
||||
|
||||
it("should parse an item and create a folder", async () => {
|
||||
const result = await importer.parse(secureNoteData);
|
||||
|
||||
expect(result).not.toBeNull();
|
||||
expect(result.success).toBe(true);
|
||||
expect(result.folders.length).toBe(1);
|
||||
const folder = result.folders[0];
|
||||
expect(folder.name).toBe("notesFolder");
|
||||
});
|
||||
});
|
||||
@@ -1,527 +0,0 @@
|
||||
import { FieldType } from "@/jslib/common/src/enums/fieldType";
|
||||
import { OnePassword1PifImporter as Importer } from "@/jslib/common/src/importers/onepasswordImporters/onepassword1PifImporter";
|
||||
|
||||
const TestData: string =
|
||||
"***aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee***\n" +
|
||||
JSON.stringify({
|
||||
uuid: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
||||
updatedAt: 1486071244,
|
||||
securityLevel: "SL5",
|
||||
contentsHash: "aaaaaaaa",
|
||||
title: "Imported Entry",
|
||||
location: "https://www.google.com",
|
||||
secureContents: {
|
||||
fields: [
|
||||
{
|
||||
value: "user@test.net",
|
||||
id: "email-input",
|
||||
name: "email",
|
||||
type: "T",
|
||||
designation: "username",
|
||||
},
|
||||
{
|
||||
value: "myservicepassword",
|
||||
id: "password-input",
|
||||
name: "password",
|
||||
type: "P",
|
||||
designation: "password",
|
||||
},
|
||||
],
|
||||
sections: [
|
||||
{
|
||||
fields: [
|
||||
{
|
||||
k: "concealed",
|
||||
n: "AAAAAAAAAAAABBBBBBBBBBBCCCCCCCCC",
|
||||
v: "console-password-123",
|
||||
t: "console password",
|
||||
},
|
||||
],
|
||||
title: "Admin Console",
|
||||
name: "admin_console",
|
||||
},
|
||||
],
|
||||
passwordHistory: [
|
||||
{
|
||||
value: "old-password",
|
||||
time: 1447791421,
|
||||
},
|
||||
],
|
||||
},
|
||||
URLs: [
|
||||
{
|
||||
label: "website",
|
||||
url: "https://www.google.com",
|
||||
},
|
||||
],
|
||||
txTimestamp: 1508941334,
|
||||
createdAt: 1390426636,
|
||||
typeName: "webforms.WebForm",
|
||||
});
|
||||
|
||||
const WindowsOpVaultTestData = JSON.stringify({
|
||||
category: "001",
|
||||
created: 1544823719,
|
||||
hmac: "NtyBmTTPOb88HV3JUKPx1xl/vcMhac9kvCfe/NtszY0=",
|
||||
k: "**REMOVED LONG LINE FOR LINTER** -Kyle",
|
||||
tx: 1553395669,
|
||||
updated: 1553395669,
|
||||
uuid: "528AB076FB5F4FBF960884B8E01619AC",
|
||||
overview: {
|
||||
title: "Google",
|
||||
URLs: [
|
||||
{
|
||||
u: "google.com",
|
||||
},
|
||||
],
|
||||
url: "google.com",
|
||||
ps: 26,
|
||||
ainfo: "googluser",
|
||||
},
|
||||
details: {
|
||||
passwordHistory: [
|
||||
{
|
||||
value: "oldpass1",
|
||||
time: 1553394449,
|
||||
},
|
||||
{
|
||||
value: "oldpass2",
|
||||
time: 1553394457,
|
||||
},
|
||||
{
|
||||
value: "oldpass3",
|
||||
time: 1553394458,
|
||||
},
|
||||
{
|
||||
value: "oldpass4",
|
||||
time: 1553394459,
|
||||
},
|
||||
{
|
||||
value: "oldpass5",
|
||||
time: 1553394460,
|
||||
},
|
||||
{
|
||||
value: "oldpass6",
|
||||
time: 1553394461,
|
||||
},
|
||||
],
|
||||
fields: [
|
||||
{
|
||||
type: "T",
|
||||
id: "username",
|
||||
name: "username",
|
||||
value: "googluser",
|
||||
designation: "username",
|
||||
},
|
||||
{
|
||||
type: "P",
|
||||
id: "password",
|
||||
name: "password",
|
||||
value: "12345678901",
|
||||
designation: "password",
|
||||
},
|
||||
],
|
||||
notesPlain: "This is a note\r\n\r\nline1\r\nline2",
|
||||
sections: [
|
||||
{
|
||||
title: "test",
|
||||
name: "1214FD88CD30405D9EED14BEB4D61B60",
|
||||
fields: [
|
||||
{
|
||||
k: "string",
|
||||
n: "6CC3BD77482D4559A4B8BB2D360F821B",
|
||||
v: "fgfg",
|
||||
t: "fgggf",
|
||||
},
|
||||
{
|
||||
k: "concealed",
|
||||
n: "5CFE7BCAA1DF4578BBF7EB508959BFF3",
|
||||
v: "dfgdfgfdg",
|
||||
t: "pwfield",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const IdentityTestData = JSON.stringify({
|
||||
uuid: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
|
||||
updatedAt: 1553365894,
|
||||
securityLevel: "SL5",
|
||||
contentsHash: "eeeeeeee",
|
||||
title: "Test Identity",
|
||||
secureContents: {
|
||||
lastname: "Fritzenberger",
|
||||
zip: "223344",
|
||||
birthdate_dd: "11",
|
||||
homephone: "+49 333 222 111",
|
||||
company: "Web Inc.",
|
||||
firstname: "Frank",
|
||||
birthdate_mm: "3",
|
||||
country: "de",
|
||||
sex: "male",
|
||||
sections: [
|
||||
{
|
||||
fields: [
|
||||
{
|
||||
k: "string",
|
||||
inputTraits: {
|
||||
autocapitalization: "Words",
|
||||
},
|
||||
n: "firstname",
|
||||
v: "Frank",
|
||||
a: {
|
||||
guarded: "yes",
|
||||
},
|
||||
t: "first name",
|
||||
},
|
||||
{
|
||||
k: "string",
|
||||
inputTraits: {
|
||||
autocapitalization: "Words",
|
||||
},
|
||||
n: "initial",
|
||||
v: "MD",
|
||||
a: {
|
||||
guarded: "yes",
|
||||
},
|
||||
t: "initial",
|
||||
},
|
||||
{
|
||||
k: "string",
|
||||
inputTraits: {
|
||||
autocapitalization: "Words",
|
||||
},
|
||||
n: "lastname",
|
||||
v: "Fritzenberger",
|
||||
a: {
|
||||
guarded: "yes",
|
||||
},
|
||||
t: "last name",
|
||||
},
|
||||
{
|
||||
k: "menu",
|
||||
v: "male",
|
||||
n: "sex",
|
||||
a: {
|
||||
guarded: "yes",
|
||||
},
|
||||
t: "sex",
|
||||
},
|
||||
{
|
||||
k: "date",
|
||||
v: 1552305660,
|
||||
n: "birthdate",
|
||||
a: {
|
||||
guarded: "yes",
|
||||
},
|
||||
t: "birth date",
|
||||
},
|
||||
{
|
||||
k: "string",
|
||||
inputTraits: {
|
||||
autocapitalization: "Words",
|
||||
},
|
||||
n: "occupation",
|
||||
v: "Engineer",
|
||||
a: {
|
||||
guarded: "yes",
|
||||
},
|
||||
t: "occupation",
|
||||
},
|
||||
{
|
||||
k: "string",
|
||||
inputTraits: {
|
||||
autocapitalization: "Words",
|
||||
},
|
||||
n: "company",
|
||||
v: "Web Inc.",
|
||||
a: {
|
||||
guarded: "yes",
|
||||
},
|
||||
t: "company",
|
||||
},
|
||||
{
|
||||
k: "string",
|
||||
inputTraits: {
|
||||
autocapitalization: "Words",
|
||||
},
|
||||
n: "department",
|
||||
v: "IT",
|
||||
a: {
|
||||
guarded: "yes",
|
||||
},
|
||||
t: "department",
|
||||
},
|
||||
{
|
||||
k: "string",
|
||||
inputTraits: {
|
||||
autocapitalization: "Words",
|
||||
},
|
||||
n: "jobtitle",
|
||||
v: "Developer",
|
||||
a: {
|
||||
guarded: "yes",
|
||||
},
|
||||
t: "job title",
|
||||
},
|
||||
],
|
||||
title: "Identification",
|
||||
name: "name",
|
||||
},
|
||||
{
|
||||
fields: [
|
||||
{
|
||||
k: "address",
|
||||
inputTraits: {
|
||||
autocapitalization: "Sentences",
|
||||
},
|
||||
n: "address",
|
||||
v: {
|
||||
street: "Mainstreet 1",
|
||||
city: "Berlin",
|
||||
country: "de",
|
||||
zip: "223344",
|
||||
},
|
||||
a: {
|
||||
guarded: "yes",
|
||||
},
|
||||
t: "address",
|
||||
},
|
||||
{
|
||||
k: "phone",
|
||||
v: "+49 001 222 333 44",
|
||||
n: "defphone",
|
||||
a: {
|
||||
guarded: "yes",
|
||||
},
|
||||
t: "default phone",
|
||||
},
|
||||
{
|
||||
k: "phone",
|
||||
v: "+49 333 222 111",
|
||||
n: "homephone",
|
||||
a: {
|
||||
guarded: "yes",
|
||||
},
|
||||
t: "home",
|
||||
},
|
||||
{
|
||||
k: "phone",
|
||||
n: "cellphone",
|
||||
a: {
|
||||
guarded: "yes",
|
||||
},
|
||||
t: "mobile",
|
||||
},
|
||||
{
|
||||
k: "phone",
|
||||
n: "busphone",
|
||||
a: {
|
||||
guarded: "yes",
|
||||
},
|
||||
t: "business",
|
||||
},
|
||||
],
|
||||
title: "Address",
|
||||
name: "address",
|
||||
},
|
||||
{
|
||||
fields: [
|
||||
{
|
||||
k: "string",
|
||||
n: "username",
|
||||
a: {
|
||||
guarded: "yes",
|
||||
},
|
||||
t: "username",
|
||||
},
|
||||
{
|
||||
k: "string",
|
||||
n: "reminderq",
|
||||
t: "reminder question",
|
||||
},
|
||||
{
|
||||
k: "string",
|
||||
n: "remindera",
|
||||
t: "reminder answer",
|
||||
},
|
||||
{
|
||||
k: "string",
|
||||
inputTraits: {
|
||||
keyboard: "EmailAddress",
|
||||
},
|
||||
n: "email",
|
||||
v: "test@web.de",
|
||||
a: {
|
||||
guarded: "yes",
|
||||
},
|
||||
t: "email",
|
||||
},
|
||||
{
|
||||
k: "string",
|
||||
n: "website",
|
||||
inputTraits: {
|
||||
keyboard: "URL",
|
||||
},
|
||||
t: "website",
|
||||
},
|
||||
{
|
||||
k: "string",
|
||||
n: "icq",
|
||||
t: "ICQ",
|
||||
},
|
||||
{
|
||||
k: "string",
|
||||
n: "skype",
|
||||
t: "skype",
|
||||
},
|
||||
{
|
||||
k: "string",
|
||||
n: "aim",
|
||||
t: "AOL/AIM",
|
||||
},
|
||||
{
|
||||
k: "string",
|
||||
n: "yahoo",
|
||||
t: "Yahoo",
|
||||
},
|
||||
{
|
||||
k: "string",
|
||||
n: "msn",
|
||||
t: "MSN",
|
||||
},
|
||||
{
|
||||
k: "string",
|
||||
n: "forumsig",
|
||||
t: "forum signature",
|
||||
},
|
||||
],
|
||||
title: "Internet Details",
|
||||
name: "internet",
|
||||
},
|
||||
{
|
||||
title: "Related Items",
|
||||
name: "linked items",
|
||||
},
|
||||
],
|
||||
initial: "MD",
|
||||
address1: "Mainstreet 1",
|
||||
city: "Berlin",
|
||||
jobtitle: "Developer",
|
||||
occupation: "Engineer",
|
||||
department: "IT",
|
||||
email: "test@web.de",
|
||||
birthdate_yy: "2019",
|
||||
homephone_local: "+49 333 222 111",
|
||||
defphone_local: "+49 001 222 333 44",
|
||||
defphone: "+49 001 222 333 44",
|
||||
},
|
||||
txTimestamp: 1553365894,
|
||||
createdAt: 1553364679,
|
||||
typeName: "identities.Identity",
|
||||
});
|
||||
|
||||
describe("1Password 1Pif Importer", () => {
|
||||
it("should parse data", async () => {
|
||||
const importer = new Importer();
|
||||
const result = await importer.parse(TestData);
|
||||
expect(result != null).toBe(true);
|
||||
|
||||
const cipher = result.ciphers.shift();
|
||||
expect(cipher.login.username).toEqual("user@test.net");
|
||||
expect(cipher.login.password).toEqual("myservicepassword");
|
||||
expect(cipher.login.uris.length).toEqual(1);
|
||||
const uriView = cipher.login.uris.shift();
|
||||
expect(uriView.uri).toEqual("https://www.google.com");
|
||||
});
|
||||
|
||||
it('should create concealed field as "hidden" type', async () => {
|
||||
const importer = new Importer();
|
||||
const result = await importer.parse(TestData);
|
||||
expect(result != null).toBe(true);
|
||||
|
||||
const ciphers = result.ciphers;
|
||||
expect(ciphers.length).toEqual(1);
|
||||
|
||||
const cipher = ciphers.shift();
|
||||
const fields = cipher.fields;
|
||||
expect(fields.length).toEqual(1);
|
||||
|
||||
const field = fields.shift();
|
||||
expect(field.name).toEqual("console password");
|
||||
expect(field.value).toEqual("console-password-123");
|
||||
expect(field.type).toEqual(FieldType.Hidden);
|
||||
});
|
||||
|
||||
it("should create identity records", async () => {
|
||||
const importer = new Importer();
|
||||
const result = await importer.parse(IdentityTestData);
|
||||
expect(result != null).toBe(true);
|
||||
const cipher = result.ciphers.shift();
|
||||
expect(cipher.name).toEqual("Test Identity");
|
||||
|
||||
const identity = cipher.identity;
|
||||
expect(identity.firstName).toEqual("Frank");
|
||||
expect(identity.middleName).toEqual("MD");
|
||||
expect(identity.lastName).toEqual("Fritzenberger");
|
||||
expect(identity.company).toEqual("Web Inc.");
|
||||
expect(identity.address1).toEqual("Mainstreet 1");
|
||||
expect(identity.country).toEqual("DE");
|
||||
expect(identity.city).toEqual("Berlin");
|
||||
expect(identity.postalCode).toEqual("223344");
|
||||
expect(identity.phone).toEqual("+49 001 222 333 44");
|
||||
expect(identity.email).toEqual("test@web.de");
|
||||
|
||||
// remaining fields as custom fields
|
||||
expect(cipher.fields.length).toEqual(6);
|
||||
const fields = cipher.fields;
|
||||
expect(fields[0].name).toEqual("sex");
|
||||
expect(fields[0].value).toEqual("male");
|
||||
expect(fields[1].name).toEqual("birth date");
|
||||
expect(fields[1].value).toEqual("Mon, 11 Mar 2019 12:01:00 GMT");
|
||||
expect(fields[2].name).toEqual("occupation");
|
||||
expect(fields[2].value).toEqual("Engineer");
|
||||
expect(fields[3].name).toEqual("department");
|
||||
expect(fields[3].value).toEqual("IT");
|
||||
expect(fields[4].name).toEqual("job title");
|
||||
expect(fields[4].value).toEqual("Developer");
|
||||
expect(fields[5].name).toEqual("home");
|
||||
expect(fields[5].value).toEqual("+49 333 222 111");
|
||||
});
|
||||
|
||||
it("should create password history", async () => {
|
||||
const importer = new Importer();
|
||||
const result = await importer.parse(TestData);
|
||||
const cipher = result.ciphers.shift();
|
||||
|
||||
expect(cipher.passwordHistory.length).toEqual(1);
|
||||
const ph = cipher.passwordHistory.shift();
|
||||
expect(ph.password).toEqual("old-password");
|
||||
expect(ph.lastUsedDate.toISOString()).toEqual("2015-11-17T20:17:01.000Z");
|
||||
});
|
||||
|
||||
it("should create password history from windows opvault 1pif format", async () => {
|
||||
const importer = new Importer();
|
||||
const result = await importer.parse(WindowsOpVaultTestData);
|
||||
const cipher = result.ciphers.shift();
|
||||
|
||||
expect(cipher.passwordHistory.length).toEqual(5);
|
||||
let ph = cipher.passwordHistory.shift();
|
||||
expect(ph.password).toEqual("oldpass6");
|
||||
expect(ph.lastUsedDate.toISOString()).toEqual("2019-03-24T02:27:41.000Z");
|
||||
ph = cipher.passwordHistory.shift();
|
||||
expect(ph.password).toEqual("oldpass5");
|
||||
expect(ph.lastUsedDate.toISOString()).toEqual("2019-03-24T02:27:40.000Z");
|
||||
ph = cipher.passwordHistory.shift();
|
||||
expect(ph.password).toEqual("oldpass4");
|
||||
expect(ph.lastUsedDate.toISOString()).toEqual("2019-03-24T02:27:39.000Z");
|
||||
ph = cipher.passwordHistory.shift();
|
||||
expect(ph.password).toEqual("oldpass3");
|
||||
expect(ph.lastUsedDate.toISOString()).toEqual("2019-03-24T02:27:38.000Z");
|
||||
ph = cipher.passwordHistory.shift();
|
||||
expect(ph.password).toEqual("oldpass2");
|
||||
expect(ph.lastUsedDate.toISOString()).toEqual("2019-03-24T02:27:37.000Z");
|
||||
});
|
||||
});
|
||||
@@ -1,689 +0,0 @@
|
||||
import { CipherType } from "@/jslib/common/src/enums/cipherType";
|
||||
import { FieldType } from "@/jslib/common/src/enums/fieldType";
|
||||
import { SecureNoteType } from "@/jslib/common/src/enums/secureNoteType";
|
||||
import { OnePassword1PuxImporter as Importer } from "@/jslib/common/src/importers/onepasswordImporters/onepassword1PuxImporter";
|
||||
import { Utils } from "@/jslib/common/src/misc/utils";
|
||||
import { FieldView } from "@/jslib/common/src/models/view/fieldView";
|
||||
|
||||
import { APICredentialsData } from "./testData/onePassword1Pux/APICredentials";
|
||||
import { BankAccountData } from "./testData/onePassword1Pux/BankAccount";
|
||||
import { CreditCardData } from "./testData/onePassword1Pux/CreditCard";
|
||||
import { DatabaseData } from "./testData/onePassword1Pux/Database";
|
||||
import { DriversLicenseData } from "./testData/onePassword1Pux/DriversLicense";
|
||||
import { EmailAccountData } from "./testData/onePassword1Pux/EmailAccount";
|
||||
import { EmailFieldData } from "./testData/onePassword1Pux/Emailfield";
|
||||
import { EmailFieldOnIdentityData } from "./testData/onePassword1Pux/EmailfieldOnIdentity";
|
||||
import { EmailFieldOnIdentityPrefilledData } from "./testData/onePassword1Pux/EmailfieldOnIdentity_Prefilled";
|
||||
import { IdentityData } from "./testData/onePassword1Pux/IdentityData";
|
||||
import { LoginData } from "./testData/onePassword1Pux/LoginData";
|
||||
import { MedicalRecordData } from "./testData/onePassword1Pux/MedicalRecord";
|
||||
import { MembershipData } from "./testData/onePassword1Pux/Membership";
|
||||
import { OnePuxExampleFile } from "./testData/onePassword1Pux/Onepux_example";
|
||||
import { OutdoorLicenseData } from "./testData/onePassword1Pux/OutdoorLicense";
|
||||
import { PassportData } from "./testData/onePassword1Pux/Passport";
|
||||
import { PasswordData } from "./testData/onePassword1Pux/Password";
|
||||
import { RewardsProgramData } from "./testData/onePassword1Pux/RewardsProgram";
|
||||
import { SSNData } from "./testData/onePassword1Pux/SSN";
|
||||
import { SanitizedExport } from "./testData/onePassword1Pux/SanitizedExport";
|
||||
import { SecureNoteData } from "./testData/onePassword1Pux/SecureNote";
|
||||
import { ServerData } from "./testData/onePassword1Pux/Server";
|
||||
import { SoftwareLicenseData } from "./testData/onePassword1Pux/SoftwareLicense";
|
||||
import { WirelessRouterData } from "./testData/onePassword1Pux/WirelessRouter";
|
||||
|
||||
function validateCustomField(fields: FieldView[], fieldName: string, expectedValue: any) {
|
||||
expect(fields).toBeDefined();
|
||||
const customField = fields.find((f) => f.name === fieldName);
|
||||
expect(customField).toBeDefined();
|
||||
|
||||
expect(customField.value).toEqual(expectedValue);
|
||||
}
|
||||
|
||||
describe("1Password 1Pux Importer", () => {
|
||||
const OnePuxExampleFileJson = JSON.stringify(OnePuxExampleFile);
|
||||
const LoginDataJson = JSON.stringify(LoginData);
|
||||
const CreditCardDataJson = JSON.stringify(CreditCardData);
|
||||
const IdentityDataJson = JSON.stringify(IdentityData);
|
||||
const SecureNoteDataJson = JSON.stringify(SecureNoteData);
|
||||
const SanitizedExportJson = JSON.stringify(SanitizedExport);
|
||||
|
||||
it("should parse login data", async () => {
|
||||
const importer = new Importer();
|
||||
const result = await importer.parse(LoginDataJson);
|
||||
expect(result != null).toBe(true);
|
||||
|
||||
const cipher = result.ciphers.shift();
|
||||
|
||||
expect(cipher.type).toEqual(CipherType.Login);
|
||||
expect(cipher.name).toEqual("eToro");
|
||||
|
||||
expect(cipher.login.username).toEqual("username123123123@gmail.com");
|
||||
expect(cipher.login.password).toEqual("password!");
|
||||
expect(cipher.login.uris.length).toEqual(1);
|
||||
expect(cipher.login.uri).toEqual("https://www.fakesite.com");
|
||||
expect(cipher.login.totp).toEqual("otpseed777");
|
||||
|
||||
// remaining fields as custom fields
|
||||
expect(cipher.fields.length).toEqual(3);
|
||||
validateCustomField(cipher.fields, "terms", "false");
|
||||
validateCustomField(cipher.fields, "policies", "true");
|
||||
validateCustomField(cipher.fields, "cyqyggt2otns6tbbqtsl6w2ceu", "username123123");
|
||||
});
|
||||
|
||||
it("should parse notes", async () => {
|
||||
const importer = new Importer();
|
||||
const result = await importer.parse(OnePuxExampleFileJson);
|
||||
expect(result != null).toBe(true);
|
||||
|
||||
const cipher = result.ciphers.shift();
|
||||
expect(cipher.notes).toEqual("This is a note. *bold*! _italic_!");
|
||||
});
|
||||
|
||||
it("should set favourite if favIndex equals 1", async () => {
|
||||
const importer = new Importer();
|
||||
const result = await importer.parse(OnePuxExampleFileJson);
|
||||
expect(result != null).toBe(true);
|
||||
|
||||
const cipher = result.ciphers.shift();
|
||||
expect(cipher.favorite).toBe(true);
|
||||
});
|
||||
|
||||
it("should handle custom boolean fields", async () => {
|
||||
const importer = new Importer();
|
||||
const result = await importer.parse(LoginDataJson);
|
||||
expect(result != null).toBe(true);
|
||||
|
||||
const ciphers = result.ciphers;
|
||||
expect(ciphers.length).toEqual(1);
|
||||
|
||||
const cipher = ciphers.shift();
|
||||
expect(cipher.fields[0].name).toEqual("terms");
|
||||
expect(cipher.fields[0].value).toEqual("false");
|
||||
expect(cipher.fields[0].type).toBe(FieldType.Boolean);
|
||||
|
||||
expect(cipher.fields[1].name).toEqual("policies");
|
||||
expect(cipher.fields[1].value).toEqual("true");
|
||||
expect(cipher.fields[1].type).toBe(FieldType.Boolean);
|
||||
});
|
||||
|
||||
it("should add fields of type email as custom fields", async () => {
|
||||
const importer = new Importer();
|
||||
const EmailFieldDataJson = JSON.stringify(EmailFieldData);
|
||||
const result = await importer.parse(EmailFieldDataJson);
|
||||
expect(result != null).toBe(true);
|
||||
|
||||
const ciphers = result.ciphers;
|
||||
expect(ciphers.length).toEqual(1);
|
||||
const cipher = ciphers.shift();
|
||||
|
||||
expect(cipher.fields[0].name).toEqual("reg_email");
|
||||
expect(cipher.fields[0].value).toEqual("kriddler@nullvalue.test");
|
||||
expect(cipher.fields[0].type).toBe(FieldType.Text);
|
||||
|
||||
expect(cipher.fields[1].name).toEqual("provider");
|
||||
expect(cipher.fields[1].value).toEqual("myEmailProvider");
|
||||
expect(cipher.fields[1].type).toBe(FieldType.Text);
|
||||
});
|
||||
|
||||
it('should create concealed field as "hidden" type', async () => {
|
||||
const importer = new Importer();
|
||||
const result = await importer.parse(OnePuxExampleFileJson);
|
||||
expect(result != null).toBe(true);
|
||||
|
||||
const ciphers = result.ciphers;
|
||||
expect(ciphers.length).toEqual(1);
|
||||
|
||||
const cipher = ciphers.shift();
|
||||
const fields = cipher.fields;
|
||||
expect(fields.length).toEqual(1);
|
||||
|
||||
const field = fields.shift();
|
||||
expect(field.name).toEqual("PIN");
|
||||
expect(field.value).toEqual("12345");
|
||||
expect(field.type).toEqual(FieldType.Hidden);
|
||||
});
|
||||
|
||||
it("should create password history", async () => {
|
||||
const importer = new Importer();
|
||||
const result = await importer.parse(OnePuxExampleFileJson);
|
||||
const cipher = result.ciphers.shift();
|
||||
|
||||
expect(cipher.passwordHistory.length).toEqual(1);
|
||||
const ph = cipher.passwordHistory.shift();
|
||||
expect(ph.password).toEqual("12345password");
|
||||
expect(ph.lastUsedDate.toISOString()).toEqual("2016-03-18T17:32:35.000Z");
|
||||
});
|
||||
|
||||
it("should create credit card records", async () => {
|
||||
const importer = new Importer();
|
||||
const result = await importer.parse(CreditCardDataJson);
|
||||
expect(result != null).toBe(true);
|
||||
const cipher = result.ciphers.shift();
|
||||
expect(cipher.name).toEqual("Parent's Credit Card");
|
||||
expect(cipher.notes).toEqual("My parents' credit card.");
|
||||
|
||||
const card = cipher.card;
|
||||
expect(card.cardholderName).toEqual("Fred Engels");
|
||||
expect(card.number).toEqual("6011111111111117");
|
||||
expect(card.code).toEqual("1312");
|
||||
expect(card.brand).toEqual("Discover");
|
||||
expect(card.expMonth).toEqual("12");
|
||||
expect(card.expYear).toEqual("2099");
|
||||
|
||||
// remaining fields as custom fields
|
||||
expect(cipher.fields.length).toEqual(12);
|
||||
validateCustomField(cipher.fields, "txbzvwzpck7ejhfres3733rbpm", "card");
|
||||
validateCustomField(cipher.fields, "cashLimit", "$500");
|
||||
validateCustomField(cipher.fields, "creditLimit", "$1312");
|
||||
validateCustomField(cipher.fields, "validFrom", "200101");
|
||||
validateCustomField(cipher.fields, "bank", "Some bank");
|
||||
validateCustomField(cipher.fields, "phoneLocal", "123456");
|
||||
validateCustomField(cipher.fields, "phoneTollFree", "0800123456");
|
||||
validateCustomField(cipher.fields, "phoneIntl", "+49123456");
|
||||
validateCustomField(cipher.fields, "website", "somebank.com");
|
||||
validateCustomField(cipher.fields, "pin", "1234");
|
||||
validateCustomField(cipher.fields, "interest", "1%");
|
||||
validateCustomField(cipher.fields, "issuenumber", "123456");
|
||||
});
|
||||
|
||||
it("should create identity records", async () => {
|
||||
const importer = new Importer();
|
||||
const result = await importer.parse(IdentityDataJson);
|
||||
expect(result != null).toBe(true);
|
||||
const cipher = result.ciphers.shift();
|
||||
expect(cipher.name).toEqual("George Engels");
|
||||
|
||||
const identity = cipher.identity;
|
||||
expect(identity.firstName).toEqual("George");
|
||||
expect(identity.middleName).toEqual("S");
|
||||
expect(identity.lastName).toEqual("Engels");
|
||||
expect(identity.company).toEqual("Acme Inc.");
|
||||
expect(identity.address1).toEqual("1312 Main St.");
|
||||
expect(identity.country).toEqual("US");
|
||||
expect(identity.state).toEqual("California");
|
||||
expect(identity.city).toEqual("Atlantis");
|
||||
expect(identity.postalCode).toEqual("90210");
|
||||
expect(identity.phone).toEqual("4565555555");
|
||||
expect(identity.email).toEqual("gengels@nullvalue.test");
|
||||
expect(identity.username).toEqual("gengels");
|
||||
|
||||
// remaining fields as custom fields
|
||||
expect(cipher.fields.length).toEqual(17);
|
||||
validateCustomField(cipher.fields, "sex", "male");
|
||||
validateCustomField(cipher.fields, "birthdate", "Thu, 01 Jan 1981 12:01:00 GMT");
|
||||
validateCustomField(cipher.fields, "occupation", "Steel Worker");
|
||||
validateCustomField(cipher.fields, "department", "QA");
|
||||
validateCustomField(cipher.fields, "jobtitle", "Quality Assurance Manager");
|
||||
validateCustomField(cipher.fields, "homephone", "4575555555");
|
||||
validateCustomField(cipher.fields, "cellphone", "4585555555");
|
||||
validateCustomField(cipher.fields, "busphone", "4595555555");
|
||||
validateCustomField(cipher.fields, "reminderq", "Who's a super cool guy?");
|
||||
validateCustomField(cipher.fields, "remindera", "Me, buddy.");
|
||||
validateCustomField(cipher.fields, "website", "cv.gengels.nullvalue.test");
|
||||
validateCustomField(cipher.fields, "icq", "12345678");
|
||||
validateCustomField(cipher.fields, "skype", "skypeisbad1619");
|
||||
validateCustomField(cipher.fields, "aim", "aollol@lololol.aol.com");
|
||||
validateCustomField(cipher.fields, "yahoo", "sk8rboi13@yah00.com");
|
||||
validateCustomField(cipher.fields, "msn", "msnothankyou@msn&m&m.com");
|
||||
validateCustomField(cipher.fields, "forumsig", "super cool guy");
|
||||
});
|
||||
|
||||
it("emails fields on identity types should be added to the identity email field", async () => {
|
||||
const importer = new Importer();
|
||||
const EmailFieldOnIdentityDataJson = JSON.stringify(EmailFieldOnIdentityData);
|
||||
const result = await importer.parse(EmailFieldOnIdentityDataJson);
|
||||
expect(result != null).toBe(true);
|
||||
|
||||
const ciphers = result.ciphers;
|
||||
expect(ciphers.length).toEqual(1);
|
||||
const cipher = ciphers.shift();
|
||||
|
||||
const identity = cipher.identity;
|
||||
expect(identity.email).toEqual("gengels@nullvalue.test");
|
||||
|
||||
expect(cipher.fields[0].name).toEqual("provider");
|
||||
expect(cipher.fields[0].value).toEqual("myEmailProvider");
|
||||
expect(cipher.fields[0].type).toBe(FieldType.Text);
|
||||
});
|
||||
|
||||
it("emails fields on identity types should be added to custom fields if identity.email has been filled", async () => {
|
||||
const importer = new Importer();
|
||||
const EmailFieldOnIdentityPrefilledDataJson = JSON.stringify(EmailFieldOnIdentityPrefilledData);
|
||||
const result = await importer.parse(EmailFieldOnIdentityPrefilledDataJson);
|
||||
expect(result != null).toBe(true);
|
||||
|
||||
const ciphers = result.ciphers;
|
||||
expect(ciphers.length).toEqual(1);
|
||||
const cipher = ciphers.shift();
|
||||
|
||||
const identity = cipher.identity;
|
||||
expect(identity.email).toEqual("gengels@nullvalue.test");
|
||||
|
||||
expect(cipher.fields[0].name).toEqual("2nd_email");
|
||||
expect(cipher.fields[0].value).toEqual("kriddler@nullvalue.test");
|
||||
expect(cipher.fields[0].type).toBe(FieldType.Text);
|
||||
|
||||
expect(cipher.fields[1].name).toEqual("provider");
|
||||
expect(cipher.fields[1].value).toEqual("myEmailProvider");
|
||||
expect(cipher.fields[1].type).toBe(FieldType.Text);
|
||||
});
|
||||
|
||||
it("should parse category 005 - Password (Legacy)", async () => {
|
||||
const importer = new Importer();
|
||||
const jsonString = JSON.stringify(PasswordData);
|
||||
const result = await importer.parse(jsonString);
|
||||
expect(result != null).toBe(true);
|
||||
const cipher = result.ciphers.shift();
|
||||
expect(cipher.type).toEqual(CipherType.Login);
|
||||
expect(cipher.name).toEqual("SuperSecret Password");
|
||||
expect(cipher.notes).toEqual("SuperSecret Password Notes");
|
||||
|
||||
expect(cipher.login.password).toEqual("GBq[AGb]4*Si3tjwuab^");
|
||||
expect(cipher.login.uri).toEqual("https://n0t.y0ur.n0rm4l.w3bs1t3");
|
||||
});
|
||||
|
||||
it("should parse category 100 - SoftwareLicense", async () => {
|
||||
const importer = new Importer();
|
||||
const jsonString = JSON.stringify(SoftwareLicenseData);
|
||||
const result = await importer.parse(jsonString);
|
||||
expect(result != null).toBe(true);
|
||||
const cipher = result.ciphers.shift();
|
||||
expect(cipher.type).toEqual(CipherType.SecureNote);
|
||||
expect(cipher.name).toEqual("Limux Product Key");
|
||||
expect(cipher.notes).toEqual("My Software License");
|
||||
|
||||
expect(cipher.fields.length).toEqual(13);
|
||||
validateCustomField(cipher.fields, "product_version", "5.10.1000");
|
||||
validateCustomField(cipher.fields, "reg_code", "265453-13457355-847327");
|
||||
validateCustomField(cipher.fields, "reg_name", "Kay Riddler");
|
||||
validateCustomField(cipher.fields, "reg_email", "kriddler@nullvalue.test");
|
||||
validateCustomField(cipher.fields, "company", "Riddles and Jigsaw Puzzles GmbH");
|
||||
validateCustomField(
|
||||
cipher.fields,
|
||||
"download_link",
|
||||
"https://limuxcompany.nullvalue.test/5.10.1000/isos"
|
||||
);
|
||||
validateCustomField(cipher.fields, "publisher_name", "Limux Software and Hardware");
|
||||
validateCustomField(cipher.fields, "publisher_website", "https://limuxcompany.nullvalue.test/");
|
||||
validateCustomField(cipher.fields, "retail_price", "$999");
|
||||
validateCustomField(cipher.fields, "support_email", "support@nullvalue.test");
|
||||
validateCustomField(cipher.fields, "order_date", "Thu, 01 Apr 2021 12:01:00 GMT");
|
||||
validateCustomField(cipher.fields, "order_number", "594839");
|
||||
validateCustomField(cipher.fields, "order_total", "$1086.59");
|
||||
});
|
||||
|
||||
it("should parse category 101 - BankAccount", async () => {
|
||||
const importer = new Importer();
|
||||
const jsonString = JSON.stringify(BankAccountData);
|
||||
const result = await importer.parse(jsonString);
|
||||
expect(result != null).toBe(true);
|
||||
const cipher = result.ciphers.shift();
|
||||
expect(cipher.type).toEqual(CipherType.Card);
|
||||
expect(cipher.name).toEqual("Bank Account");
|
||||
expect(cipher.notes).toEqual("My Bank Account");
|
||||
|
||||
expect(cipher.card.cardholderName).toEqual("Cool Guy");
|
||||
|
||||
expect(cipher.fields.length).toEqual(9);
|
||||
validateCustomField(cipher.fields, "bankName", "Super Credit Union");
|
||||
validateCustomField(cipher.fields, "accountType", "checking");
|
||||
validateCustomField(cipher.fields, "routingNo", "111000999");
|
||||
validateCustomField(cipher.fields, "accountNo", "192837465918273645");
|
||||
validateCustomField(cipher.fields, "swift", "123456");
|
||||
validateCustomField(cipher.fields, "iban", "DE12 123456");
|
||||
validateCustomField(cipher.fields, "telephonePin", "5555");
|
||||
validateCustomField(cipher.fields, "branchPhone", "9399399933");
|
||||
validateCustomField(cipher.fields, "branchAddress", "1 Fifth Avenue");
|
||||
});
|
||||
|
||||
it("should parse category 102 - Database", async () => {
|
||||
const importer = new Importer();
|
||||
const jsonString = JSON.stringify(DatabaseData);
|
||||
const result = await importer.parse(jsonString);
|
||||
expect(result != null).toBe(true);
|
||||
const cipher = result.ciphers.shift();
|
||||
|
||||
expect(cipher.type).toEqual(CipherType.Login);
|
||||
expect(cipher.name).toEqual("Database");
|
||||
expect(cipher.notes).toEqual("My Database");
|
||||
|
||||
const login = cipher.login;
|
||||
expect(login.username).toEqual("cooldbuser");
|
||||
expect(login.password).toEqual("^+kTjhLaN7wVPAhGU)*J");
|
||||
|
||||
expect(cipher.fields.length).toEqual(7);
|
||||
validateCustomField(cipher.fields, "database_type", "postgresql");
|
||||
validateCustomField(cipher.fields, "hostname", "my.secret.db.server");
|
||||
validateCustomField(cipher.fields, "port", "1337");
|
||||
validateCustomField(cipher.fields, "database", "user_database");
|
||||
validateCustomField(cipher.fields, "sid", "ASDIUFU-283234");
|
||||
validateCustomField(cipher.fields, "alias", "cdbu");
|
||||
validateCustomField(cipher.fields, "options", "ssh");
|
||||
});
|
||||
|
||||
it("should parse category 103 - Drivers license", async () => {
|
||||
const importer = new Importer();
|
||||
const jsonString = JSON.stringify(DriversLicenseData);
|
||||
const result = await importer.parse(jsonString);
|
||||
expect(result != null).toBe(true);
|
||||
const cipher = result.ciphers.shift();
|
||||
expect(cipher.name).toEqual("Michael Scarn");
|
||||
expect(cipher.subTitle).toEqual("Michael Scarn");
|
||||
expect(cipher.notes).toEqual("My Driver's License");
|
||||
|
||||
const identity = cipher.identity;
|
||||
expect(identity.firstName).toEqual("Michael");
|
||||
expect(identity.middleName).toBeNull();
|
||||
expect(identity.lastName).toEqual("Scarn");
|
||||
expect(identity.address1).toEqual("2120 Mifflin Rd.");
|
||||
expect(identity.state).toEqual("Pennsylvania");
|
||||
expect(identity.country).toEqual("United States");
|
||||
expect(identity.licenseNumber).toEqual("12345678901");
|
||||
|
||||
expect(cipher.fields.length).toEqual(6);
|
||||
validateCustomField(cipher.fields, "birthdate", "Sun, 01 Jan 1978 12:01:00 GMT");
|
||||
validateCustomField(cipher.fields, "sex", "male");
|
||||
validateCustomField(cipher.fields, "height", "5'11\"");
|
||||
validateCustomField(cipher.fields, "class", "C");
|
||||
validateCustomField(cipher.fields, "conditions", "B");
|
||||
validateCustomField(cipher.fields, "expiry_date", "203012");
|
||||
});
|
||||
|
||||
it("should parse category 104 - Outdoor License", async () => {
|
||||
const importer = new Importer();
|
||||
const jsonString = JSON.stringify(OutdoorLicenseData);
|
||||
const result = await importer.parse(jsonString);
|
||||
expect(result != null).toBe(true);
|
||||
const cipher = result.ciphers.shift();
|
||||
|
||||
expect(cipher.type).toEqual(CipherType.Identity);
|
||||
expect(cipher.name).toEqual("Harvest License");
|
||||
expect(cipher.subTitle).toEqual("Cash Bandit");
|
||||
expect(cipher.notes).toEqual("My Outdoor License");
|
||||
|
||||
const identity = cipher.identity;
|
||||
expect(identity.firstName).toEqual("Cash");
|
||||
expect(identity.middleName).toBeNull();
|
||||
expect(identity.lastName).toEqual("Bandit");
|
||||
expect(identity.state).toEqual("Washington");
|
||||
expect(identity.country).toEqual("United States of America");
|
||||
|
||||
expect(cipher.fields.length).toEqual(4);
|
||||
validateCustomField(cipher.fields, "valid_from", "Thu, 01 Apr 2021 12:01:00 GMT");
|
||||
validateCustomField(cipher.fields, "expires", "Fri, 01 Apr 2044 12:01:00 GMT");
|
||||
validateCustomField(cipher.fields, "game", "Bananas,blueberries,corn");
|
||||
validateCustomField(cipher.fields, "quota", "100/each");
|
||||
});
|
||||
|
||||
it("should parse category 105 - Membership", async () => {
|
||||
const importer = new Importer();
|
||||
const jsonString = JSON.stringify(MembershipData);
|
||||
const result = await importer.parse(jsonString);
|
||||
expect(result != null).toBe(true);
|
||||
const cipher = result.ciphers.shift();
|
||||
|
||||
expect(cipher.type).toEqual(CipherType.Identity);
|
||||
expect(cipher.name).toEqual("Library Card");
|
||||
|
||||
const identity = cipher.identity;
|
||||
expect(identity.firstName).toEqual("George");
|
||||
expect(identity.middleName).toBeNull();
|
||||
expect(identity.lastName).toEqual("Engels");
|
||||
expect(identity.company).toEqual("National Public Library");
|
||||
expect(identity.phone).toEqual("9995555555");
|
||||
|
||||
expect(cipher.fields.length).toEqual(5);
|
||||
validateCustomField(cipher.fields, "website", "https://npl.nullvalue.gov.test");
|
||||
validateCustomField(cipher.fields, "member_since", "199901");
|
||||
validateCustomField(cipher.fields, "expiry_date", "203412");
|
||||
validateCustomField(cipher.fields, "membership_no", "64783862");
|
||||
validateCustomField(cipher.fields, "pin", "19191");
|
||||
});
|
||||
|
||||
it("should parse category 106 - Passport", async () => {
|
||||
const importer = new Importer();
|
||||
const jsonString = JSON.stringify(PassportData);
|
||||
const result = await importer.parse(jsonString);
|
||||
expect(result != null).toBe(true);
|
||||
const cipher = result.ciphers.shift();
|
||||
|
||||
expect(cipher.type).toEqual(CipherType.Identity);
|
||||
expect(cipher.name).toEqual("Mr. Globewide");
|
||||
|
||||
const identity = cipher.identity;
|
||||
expect(identity.firstName).toEqual("David");
|
||||
expect(identity.middleName).toBeNull();
|
||||
expect(identity.lastName).toEqual("Global");
|
||||
expect(identity.passportNumber).toEqual("76436847");
|
||||
|
||||
expect(cipher.fields.length).toEqual(8);
|
||||
validateCustomField(cipher.fields, "type", "US Passport");
|
||||
validateCustomField(cipher.fields, "sex", "female");
|
||||
validateCustomField(cipher.fields, "nationality", "International");
|
||||
validateCustomField(cipher.fields, "issuing_authority", "Department of State");
|
||||
validateCustomField(cipher.fields, "birthdate", "Fri, 01 Apr 1983 12:01:00 GMT");
|
||||
validateCustomField(cipher.fields, "birthplace", "A cave somewhere in Maine");
|
||||
validateCustomField(cipher.fields, "issue_date", "Wed, 01 Jan 2020 12:01:00 GMT");
|
||||
validateCustomField(cipher.fields, "expiry_date", "Sat, 01 Jan 2050 12:01:00 GMT");
|
||||
});
|
||||
|
||||
it("should parse category 107 - RewardsProgram", async () => {
|
||||
const importer = new Importer();
|
||||
const jsonString = JSON.stringify(RewardsProgramData);
|
||||
const result = await importer.parse(jsonString);
|
||||
expect(result != null).toBe(true);
|
||||
const cipher = result.ciphers.shift();
|
||||
|
||||
expect(cipher.type).toEqual(CipherType.Identity);
|
||||
expect(cipher.name).toEqual("Retail Reward Thing");
|
||||
|
||||
const identity = cipher.identity;
|
||||
expect(identity.firstName).toEqual("Chef");
|
||||
expect(identity.middleName).toBeNull();
|
||||
expect(identity.lastName).toEqual("Coldroom");
|
||||
expect(identity.company).toEqual("Super Cool Store Co.");
|
||||
|
||||
expect(cipher.fields.length).toEqual(7);
|
||||
validateCustomField(cipher.fields, "membership_no", "member-29813569");
|
||||
validateCustomField(cipher.fields, "pin", "99913");
|
||||
validateCustomField(cipher.fields, "additional_no", "additional member id");
|
||||
validateCustomField(cipher.fields, "member_since", "202101");
|
||||
validateCustomField(cipher.fields, "customer_service_phone", "123456");
|
||||
validateCustomField(cipher.fields, "reservations_phone", "123456");
|
||||
validateCustomField(cipher.fields, "website", "supercoolstore.com");
|
||||
});
|
||||
|
||||
it("should parse category 108 - SSN", async () => {
|
||||
const importer = new Importer();
|
||||
const jsonString = JSON.stringify(SSNData);
|
||||
const result = await importer.parse(jsonString);
|
||||
expect(result != null).toBe(true);
|
||||
const cipher = result.ciphers.shift();
|
||||
expect(cipher.name).toEqual("SSN");
|
||||
|
||||
const identity = cipher.identity;
|
||||
expect(identity.firstName).toEqual("Jack");
|
||||
expect(identity.middleName).toBeNull();
|
||||
expect(identity.lastName).toEqual("Judd");
|
||||
expect(identity.ssn).toEqual("131-216-1900");
|
||||
});
|
||||
|
||||
it("should parse category 109 - WirelessRouter", async () => {
|
||||
const importer = new Importer();
|
||||
const jsonString = JSON.stringify(WirelessRouterData);
|
||||
const result = await importer.parse(jsonString);
|
||||
expect(result != null).toBe(true);
|
||||
const cipher = result.ciphers.shift();
|
||||
|
||||
expect(cipher.type).toEqual(CipherType.Login);
|
||||
expect(cipher.name).toEqual("Wireless Router");
|
||||
expect(cipher.notes).toEqual("My Wifi Router Config");
|
||||
|
||||
expect(cipher.login.password).toEqual("BqatGTVQ9TCN72tLbjrsHqkb");
|
||||
|
||||
expect(cipher.fields.length).toEqual(7);
|
||||
validateCustomField(cipher.fields, "name", "pixel 2Xl");
|
||||
validateCustomField(cipher.fields, "server", "127.0.0.1");
|
||||
validateCustomField(cipher.fields, "airport_id", "some airportId");
|
||||
validateCustomField(cipher.fields, "network_name", "some network name");
|
||||
validateCustomField(cipher.fields, "wireless_security", "WPA");
|
||||
validateCustomField(cipher.fields, "wireless_password", "wifipassword");
|
||||
validateCustomField(cipher.fields, "disk_password", "diskpassword");
|
||||
});
|
||||
|
||||
it("should parse category 110 - Server", async () => {
|
||||
const importer = new Importer();
|
||||
const jsonString = JSON.stringify(ServerData);
|
||||
const result = await importer.parse(jsonString);
|
||||
expect(result != null).toBe(true);
|
||||
const cipher = result.ciphers.shift();
|
||||
|
||||
expect(cipher.type).toEqual(CipherType.Login);
|
||||
expect(cipher.name).toEqual("Super Cool Server");
|
||||
expect(cipher.notes).toEqual("My Server");
|
||||
|
||||
expect(cipher.login.username).toEqual("frankly-notsure");
|
||||
expect(cipher.login.password).toEqual("*&YHJI87yjy78u");
|
||||
expect(cipher.login.uri).toEqual("https://coolserver.nullvalue.test");
|
||||
|
||||
expect(cipher.fields.length).toEqual(7);
|
||||
validateCustomField(
|
||||
cipher.fields,
|
||||
"admin_console_url",
|
||||
"https://coolserver.nullvalue.test/admin"
|
||||
);
|
||||
validateCustomField(cipher.fields, "admin_console_username", "frankly-idontknowwhatimdoing");
|
||||
validateCustomField(cipher.fields, "admin_console_password", "^%RY&^YUiju8iUYHJI(U");
|
||||
validateCustomField(cipher.fields, "name", "Private Hosting Provider Inc.");
|
||||
validateCustomField(cipher.fields, "website", "https://phpi.nullvalue.test");
|
||||
validateCustomField(
|
||||
cipher.fields,
|
||||
"support_contact_url",
|
||||
"https://phpi.nullvalue.test/support"
|
||||
);
|
||||
validateCustomField(cipher.fields, "support_contact_phone", "8882569382");
|
||||
});
|
||||
|
||||
it("should parse category 111 - EmailAccount", async () => {
|
||||
const importer = new Importer();
|
||||
const jsonString = JSON.stringify(EmailAccountData);
|
||||
const result = await importer.parse(jsonString);
|
||||
expect(result != null).toBe(true);
|
||||
const cipher = result.ciphers.shift();
|
||||
|
||||
expect(cipher.type).toEqual(CipherType.SecureNote);
|
||||
expect(cipher.name).toEqual("Email Config");
|
||||
expect(cipher.notes).toEqual("My Email Config");
|
||||
|
||||
expect(cipher.fields.length).toEqual(17);
|
||||
validateCustomField(cipher.fields, "pop_type", "either");
|
||||
validateCustomField(cipher.fields, "pop_username", "someuser@nullvalue.test");
|
||||
validateCustomField(cipher.fields, "pop_server", "mailserver.nullvalue.test");
|
||||
validateCustomField(cipher.fields, "pop_port", "587");
|
||||
validateCustomField(cipher.fields, "pop_password", "u1jsf<UI*&YU&^T");
|
||||
validateCustomField(cipher.fields, "pop_security", "TLS");
|
||||
validateCustomField(cipher.fields, "pop_authentication", "kerberos_v5");
|
||||
validateCustomField(cipher.fields, "smtp_server", "mailserver.nullvalue.test");
|
||||
validateCustomField(cipher.fields, "smtp_port", "589");
|
||||
validateCustomField(cipher.fields, "smtp_username", "someuser@nullvalue.test");
|
||||
validateCustomField(cipher.fields, "smtp_password", "(*1674%^UIUJ*UI(IUI8u98uyy");
|
||||
validateCustomField(cipher.fields, "smtp_security", "TLS");
|
||||
validateCustomField(cipher.fields, "smtp_authentication", "password");
|
||||
validateCustomField(cipher.fields, "provider", "Telum");
|
||||
validateCustomField(cipher.fields, "provider_website", "https://telum.nullvalue.test");
|
||||
validateCustomField(cipher.fields, "phone_local", "2346666666");
|
||||
validateCustomField(cipher.fields, "phone_tollfree", "18005557777");
|
||||
});
|
||||
|
||||
it("should parse category 112 - API Credentials", async () => {
|
||||
const importer = new Importer();
|
||||
const jsonString = JSON.stringify(APICredentialsData);
|
||||
const result = await importer.parse(jsonString);
|
||||
expect(result != null).toBe(true);
|
||||
const cipher = result.ciphers.shift();
|
||||
|
||||
expect(cipher.type).toEqual(CipherType.Login);
|
||||
expect(cipher.name).toEqual("API Credential");
|
||||
expect(cipher.notes).toEqual("My API Credential");
|
||||
|
||||
expect(cipher.login.username).toEqual("apiuser@nullvalue.test");
|
||||
expect(cipher.login.password).toEqual("apiapiapiapiapiapiappy");
|
||||
expect(cipher.login.uri).toEqual("http://not.your.everyday.hostname");
|
||||
|
||||
expect(cipher.fields.length).toEqual(4);
|
||||
validateCustomField(cipher.fields, "type", "jwt");
|
||||
validateCustomField(cipher.fields, "filename", "filename.jwt");
|
||||
validateCustomField(cipher.fields, "validFrom", "Mon, 04 Apr 2011 12:01:00 GMT");
|
||||
validateCustomField(cipher.fields, "expires", "Tue, 01 Apr 2031 12:01:00 GMT");
|
||||
});
|
||||
|
||||
it("should create secure notes", async () => {
|
||||
const importer = new Importer();
|
||||
const result = await importer.parse(SecureNoteDataJson);
|
||||
expect(result != null).toBe(true);
|
||||
const cipher = result.ciphers.shift();
|
||||
|
||||
expect(cipher.name).toEqual("Secure Note #1");
|
||||
expect(cipher.notes).toEqual(
|
||||
"This is my secure note. \n\nLorem ipsum expecto patronum. \nThe quick brown fox jumped over the lazy dog."
|
||||
);
|
||||
expect(cipher.secureNote.type).toEqual(SecureNoteType.Generic);
|
||||
});
|
||||
|
||||
it("should parse category 113 - Medical Record", async () => {
|
||||
const importer = new Importer();
|
||||
const jsonString = JSON.stringify(MedicalRecordData);
|
||||
const result = await importer.parse(jsonString);
|
||||
expect(result != null).toBe(true);
|
||||
const cipher = result.ciphers.shift();
|
||||
expect(cipher.type).toEqual(CipherType.SecureNote);
|
||||
expect(cipher.name).toEqual("Some Health Record");
|
||||
expect(cipher.notes).toEqual("Some notes about my medical history");
|
||||
expect(cipher.secureNote.type).toEqual(SecureNoteType.Generic);
|
||||
|
||||
expect(cipher.fields.length).toEqual(8);
|
||||
validateCustomField(cipher.fields, "date", "Sat, 01 Jan 2022 12:01:00 GMT");
|
||||
validateCustomField(cipher.fields, "location", "some hospital/clinic");
|
||||
validateCustomField(cipher.fields, "healthcareprofessional", "Some Doctor");
|
||||
validateCustomField(cipher.fields, "patient", "Me");
|
||||
validateCustomField(cipher.fields, "reason", "unwell");
|
||||
validateCustomField(cipher.fields, "medication", "Insuline");
|
||||
validateCustomField(cipher.fields, "dosage", "1");
|
||||
validateCustomField(cipher.fields, "notes", "multiple times a day");
|
||||
});
|
||||
|
||||
it("should create folders", async () => {
|
||||
const importer = new Importer();
|
||||
const result = await importer.parse(SanitizedExportJson);
|
||||
expect(result != null).toBe(true);
|
||||
|
||||
const folders = result.folders;
|
||||
expect(folders.length).toBe(5);
|
||||
expect(folders[0].name).toBe("Movies");
|
||||
expect(folders[1].name).toBe("Finance");
|
||||
expect(folders[2].name).toBe("Travel");
|
||||
expect(folders[3].name).toBe("Education");
|
||||
expect(folders[4].name).toBe("Starter Kit");
|
||||
|
||||
// Check that ciphers have a folder assigned to them
|
||||
expect(result.ciphers.filter((c) => c.folderId === folders[0].id).length).toBeGreaterThan(0);
|
||||
expect(result.ciphers.filter((c) => c.folderId === folders[1].id).length).toBeGreaterThan(0);
|
||||
expect(result.ciphers.filter((c) => c.folderId === folders[2].id).length).toBeGreaterThan(0);
|
||||
expect(result.ciphers.filter((c) => c.folderId === folders[3].id).length).toBeGreaterThan(0);
|
||||
expect(result.ciphers.filter((c) => c.folderId === folders[4].id).length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
it("should create collections if part of an organization", async () => {
|
||||
const importer = new Importer();
|
||||
importer.organizationId = Utils.newGuid();
|
||||
const result = await importer.parse(SanitizedExportJson);
|
||||
expect(result != null).toBe(true);
|
||||
|
||||
const collections = result.collections;
|
||||
expect(collections.length).toBe(5);
|
||||
expect(collections[0].name).toBe("Movies");
|
||||
expect(collections[1].name).toBe("Finance");
|
||||
expect(collections[2].name).toBe("Travel");
|
||||
expect(collections[3].name).toBe("Education");
|
||||
expect(collections[4].name).toBe("Starter Kit");
|
||||
});
|
||||
});
|
||||
@@ -1,74 +0,0 @@
|
||||
import { CipherType } from "@/jslib/common/src/enums/cipherType";
|
||||
import { OnePasswordMacCsvImporter as Importer } from "@/jslib/common/src/importers/onepasswordImporters/onepasswordMacCsvImporter";
|
||||
import { CipherView } from "@/jslib/common/src/models/view/cipherView";
|
||||
|
||||
import { data as creditCardData } from "./testData/onePasswordCsv/creditCard.mac.csv";
|
||||
import { data as identityData } from "./testData/onePasswordCsv/identity.mac.csv";
|
||||
import { data as multiTypeData } from "./testData/onePasswordCsv/multipleItems.mac.csv";
|
||||
|
||||
function expectIdentity(cipher: CipherView) {
|
||||
expect(cipher.type).toBe(CipherType.Identity);
|
||||
|
||||
expect(cipher.identity).toEqual(
|
||||
expect.objectContaining({
|
||||
firstName: "first name",
|
||||
middleName: "mi",
|
||||
lastName: "last name",
|
||||
username: "userNam3",
|
||||
company: "bitwarden",
|
||||
phone: "8005555555",
|
||||
email: "email@bitwarden.com",
|
||||
})
|
||||
);
|
||||
|
||||
expect(cipher.notes).toContain("address\ncity state zip\nUnited States");
|
||||
}
|
||||
|
||||
function expectCreditCard(cipher: CipherView) {
|
||||
expect(cipher.type).toBe(CipherType.Card);
|
||||
|
||||
expect(cipher.card).toEqual(
|
||||
expect.objectContaining({
|
||||
number: "4111111111111111",
|
||||
code: "111",
|
||||
cardholderName: "test",
|
||||
expMonth: "1",
|
||||
expYear: "2030",
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
describe("1Password mac CSV Importer", () => {
|
||||
it("should parse identity records", async () => {
|
||||
const importer = new Importer();
|
||||
const result = await importer.parse(identityData);
|
||||
|
||||
expect(result).not.toBeNull();
|
||||
expect(result.success).toBe(true);
|
||||
expect(result.ciphers.length).toBe(1);
|
||||
const cipher = result.ciphers[0];
|
||||
expectIdentity(cipher);
|
||||
});
|
||||
|
||||
it("should parse credit card records", async () => {
|
||||
const importer = new Importer();
|
||||
const result = await importer.parse(creditCardData);
|
||||
|
||||
expect(result).not.toBeNull();
|
||||
expect(result.success).toBe(true);
|
||||
expect(result.ciphers.length).toBe(1);
|
||||
const cipher = result.ciphers[0];
|
||||
expectCreditCard(cipher);
|
||||
});
|
||||
|
||||
it("should parse csv's with multiple record type", async () => {
|
||||
const importer = new Importer();
|
||||
const result = await importer.parse(multiTypeData);
|
||||
|
||||
expect(result).not.toBeNull();
|
||||
expect(result.success).toBe(true);
|
||||
expect(result.ciphers.length).toBe(4);
|
||||
expectIdentity(result.ciphers[1]);
|
||||
expectCreditCard(result.ciphers[2]);
|
||||
});
|
||||
});
|
||||
@@ -1,87 +0,0 @@
|
||||
import { CipherType } from "@/jslib/common/src/enums/cipherType";
|
||||
import { FieldType } from "@/jslib/common/src/enums/fieldType";
|
||||
import { OnePasswordWinCsvImporter as Importer } from "@/jslib/common/src/importers/onepasswordImporters/onepasswordWinCsvImporter";
|
||||
import { CipherView } from "@/jslib/common/src/models/view/cipherView";
|
||||
import { FieldView } from "@/jslib/common/src/models/view/fieldView";
|
||||
|
||||
import { data as creditCardData } from "./testData/onePasswordCsv/creditCard.windows.csv";
|
||||
import { data as identityData } from "./testData/onePasswordCsv/identity.windows.csv";
|
||||
import { data as multiTypeData } from "./testData/onePasswordCsv/multipleItems.windows.csv";
|
||||
|
||||
function expectIdentity(cipher: CipherView) {
|
||||
expect(cipher.type).toBe(CipherType.Identity);
|
||||
|
||||
expect(cipher.identity).toEqual(
|
||||
expect.objectContaining({
|
||||
firstName: "first name",
|
||||
middleName: "mi",
|
||||
lastName: "last name",
|
||||
username: "userNam3",
|
||||
company: "bitwarden",
|
||||
phone: "8005555555",
|
||||
email: "email@bitwarden.com",
|
||||
})
|
||||
);
|
||||
|
||||
expect(cipher.fields).toEqual(
|
||||
expect.arrayContaining([
|
||||
Object.assign(new FieldView(), {
|
||||
type: FieldType.Text,
|
||||
name: "address",
|
||||
value: "address city state zip us",
|
||||
}),
|
||||
])
|
||||
);
|
||||
}
|
||||
|
||||
function expectCreditCard(cipher: CipherView) {
|
||||
expect(cipher.type).toBe(CipherType.Card);
|
||||
|
||||
expect(cipher.card).toEqual(
|
||||
expect.objectContaining({
|
||||
number: "4111111111111111",
|
||||
code: "111",
|
||||
cardholderName: "test",
|
||||
expMonth: "1",
|
||||
expYear: "1970",
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
describe("1Password windows CSV Importer", () => {
|
||||
let importer: Importer;
|
||||
beforeEach(() => {
|
||||
importer = new Importer();
|
||||
});
|
||||
|
||||
it("should parse identity records", async () => {
|
||||
const result = await importer.parse(identityData);
|
||||
|
||||
expect(result).not.toBeNull();
|
||||
expect(result.success).toBe(true);
|
||||
expect(result.ciphers.length).toBe(1);
|
||||
const cipher = result.ciphers[0];
|
||||
expectIdentity(cipher);
|
||||
});
|
||||
|
||||
it("should parse credit card records", async () => {
|
||||
const result = await importer.parse(creditCardData);
|
||||
|
||||
expect(result).not.toBeNull();
|
||||
expect(result.success).toBe(true);
|
||||
expect(result.ciphers.length).toBe(1);
|
||||
const cipher = result.ciphers[0];
|
||||
expectCreditCard(cipher);
|
||||
});
|
||||
|
||||
it("should parse csv's with multiple record types", async () => {
|
||||
const result = await importer.parse(multiTypeData);
|
||||
|
||||
expect(result).not.toBeNull();
|
||||
expect(result.success).toBe(true);
|
||||
expect(result.ciphers.length).toBe(4);
|
||||
|
||||
expectIdentity(result.ciphers[1]);
|
||||
expectCreditCard(result.ciphers[2]);
|
||||
});
|
||||
});
|
||||
@@ -1,74 +0,0 @@
|
||||
import { SafariCsvImporter as Importer } from "@/jslib/common/src/importers/safariCsvImporter";
|
||||
import { CipherView } from "@/jslib/common/src/models/view/cipherView";
|
||||
import { LoginUriView } from "@/jslib/common/src/models/view/loginUriView";
|
||||
import { LoginView } from "@/jslib/common/src/models/view/loginView";
|
||||
|
||||
import { data as oldSimplePasswordData } from "./testData/safariCsv/oldSimplePasswordData.csv";
|
||||
import { data as simplePasswordData } from "./testData/safariCsv/simplePasswordData.csv";
|
||||
|
||||
const CipherData = [
|
||||
{
|
||||
title: "should parse URLs in new CSV format",
|
||||
csv: simplePasswordData,
|
||||
expected: Object.assign(new CipherView(), {
|
||||
id: null,
|
||||
organizationId: null,
|
||||
folderId: null,
|
||||
name: "example.com (example_user)",
|
||||
login: Object.assign(new LoginView(), {
|
||||
username: "example_user",
|
||||
password: "example_p@ssword",
|
||||
uris: [
|
||||
Object.assign(new LoginUriView(), {
|
||||
uri: "https://example.com",
|
||||
}),
|
||||
],
|
||||
totp: "otpauth://totp/test?secret=examplesecret",
|
||||
}),
|
||||
notes: "Example note\nMore notes on new line",
|
||||
type: 1,
|
||||
}),
|
||||
},
|
||||
{
|
||||
title: "should parse URLs in old CSV format",
|
||||
csv: oldSimplePasswordData,
|
||||
expected: Object.assign(new CipherView(), {
|
||||
id: null,
|
||||
organizationId: null,
|
||||
folderId: null,
|
||||
name: "example.com (example_user)",
|
||||
login: Object.assign(new LoginView(), {
|
||||
username: "example_user",
|
||||
password: "example_p@ssword",
|
||||
uris: [
|
||||
Object.assign(new LoginUriView(), {
|
||||
uri: "https://example.com",
|
||||
}),
|
||||
],
|
||||
}),
|
||||
type: 1,
|
||||
}),
|
||||
},
|
||||
];
|
||||
|
||||
describe("Safari CSV Importer", () => {
|
||||
CipherData.forEach((data) => {
|
||||
it(data.title, async () => {
|
||||
const importer = new Importer();
|
||||
const result = await importer.parse(data.csv);
|
||||
expect(result != null).toBe(true);
|
||||
expect(result.ciphers.length).toBeGreaterThan(0);
|
||||
|
||||
const cipher = result.ciphers.shift();
|
||||
let property: keyof typeof data.expected;
|
||||
for (property in data.expected) {
|
||||
// eslint-disable-next-line
|
||||
if (data.expected.hasOwnProperty(property)) {
|
||||
// eslint-disable-next-line
|
||||
expect(cipher.hasOwnProperty(property)).toBe(true);
|
||||
expect(cipher[property]).toEqual(data.expected[property]);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1 +0,0 @@
|
||||
export const data = '{"encrypted":false,"folders":[],"items":[]}';
|
||||
@@ -1,9 +0,0 @@
|
||||
export const data = `{
|
||||
"encrypted": true,
|
||||
"passwordProtected": true,
|
||||
"salt": "Oy0xcgVRzxQ+9NpB5GLehw==",
|
||||
"kdfIterations": 100000,
|
||||
"kdfType": 0,
|
||||
"encKeyValidation_DO_NOT_EDIT": "2.sZs4Jc1HW9rhABzRRYR/gQ==|8kTDaDxafulnybpWoqVX8RAybhVRTr+dffNjms271Y7amQmIE1VSMwLbk+b2vxZb|IqOo6oXQtmv/Xb/GHDi42XG9c9ILePYtP5qq584VWcg=",
|
||||
"data": "2.D0AXAf7G/XIwq6EC7A0Suw==|4w+m0wHRo25y1T1Syh5wdAUyF8voqEy54waMEsbnK0Nzee959w54ru5D1NntvxZL4HFqkQLyR6jCFkn5g40f+MGJgihS/wvf4NcJJfLiiFo6MEDOQNBkxw7ZBGuHiKfVuBO5u36JgzQtZ8lyFaduGxFszuF5c+URiE9PDh9jY0//poVgHKwuLZuYFIW+f7h6T+shUWK0ya11lcHn/B/CA2xiI+YiKdNZreJrwN0yslpJ/f+MrOzagvftRjt0GNkwveCtwcYUw/zFvqvibUpKeHcRiXs8SaGoHJ5RTm69FbJ7C5tnLwoVT89Af156uvRAXV7yAC4oPcbU/3TGb6hqYosvi1QNyaqG3M9gxS6+AK0C4yWuNbMLDEr+MWiw0SWLVMKQEkCZ4oM+oTCx52otW3+2V9I8Pv3KmmhkvVvE4wBdweOJeRX53Tf5ySkmpIhCfzj6JMmxO+nmTXIhWnJChr4hPVh+ixv1GQK5thIPTCMXmAtXoTIFUx1KWjS6LjOdi2hKQueVI+XZjf0qnY2vTMxRg0ZsLBA2znQTx+DSEqumORb5T/lV73pWZiCNePSAE2msOm7tep+lm4O/VCViCfXjITAY196syhOK0XnhxJvPALchZY8sYRAfuw6hHoDiVr+JUieRoI7eUrhXBp+D6Py9TL/dS/rHe+C2Zhx+xwx2NfGt+xEp8ZAOOCxgZ0UTeSA/abm0Oz7tJIK1n26acQrgbr7rMeBymAX+5L5OWlwI1hGgEBfj6W0rrbSXf3VMfaFXZ5UsXi1VhzQmU3LyWENoDeImXFQj6zMbUSfcVwLsG5Fg8Ee/kO/wJPfG5BO51+/vFqQj6AkaMEcwg5xNrObHYfQ/DMhIn7YDM2zdzbNTdhnobGkz6YRKFPCgFe3EmIEPEpeh9S3eKE9C7MQsrR8jVSiseR/FipJLsN+W7iOwzeXdwxUFlC/0a98bTKvdrbMgNi6ZVXykHY/t2UyEGpxZGTHoZwhX01kiQrwzC4/+v/676ldxPluO9GY7MtrLveCDsiyBz15u43IGHayDEBNT0rqrOKLYmfzwCWoahRLZQrSmepe/FXqgPqRfyWc/Ro+w3sT9dXUkx3B5xxWgSyABowPV48yBUSJuefhKTpqgzkU+LzhNnWHjnxJzzQ2/|IhlRjnyhIoDM85qHX/bY2zaIU5YaRO/iFVTQDd3uFDo="
|
||||
}`;
|
||||
@@ -1,2 +0,0 @@
|
||||
export const credentialsData = `username,username2,username3,title,password,note,url,category,otpSecret
|
||||
jdoe,,,example.com,somePassword,some note for example.com,https://www.example.com,Entertainment,someTOTPSeed`;
|
||||
@@ -1,6 +0,0 @@
|
||||
export const identityData = `type,number,name,issue_date,expiration_date,place_of_issue,state
|
||||
card,123123123,John Doe,2022-1-30,2032-1-30,,
|
||||
passport,123123123,John Doe,2022-1-30,2032-1-30,somewhere in Germany,
|
||||
license,1234556,John Doe,2022-8-10,2022-10-10,,DC
|
||||
social_security,123123123,John Doe,,,,
|
||||
tax_number,123123123,,,,,`;
|
||||
@@ -1,7 +0,0 @@
|
||||
export const multiplePersonalInfoData = `type,title,first_name,middle_name,last_name,login,date_of_birth,place_of_birth,email,email_type,item_name,phone_number,address,country,state,city,zip,address_recipient,address_building,address_apartment,address_floor,address_door_code,job_title,url
|
||||
name,MR,John,,Doe,jdoe,2022-01-30,world,,,,,,,,,,,,,,,,
|
||||
email,,,,,,,,jdoe@example.com,personal,Johns email,,,,,,,,,,,,,
|
||||
number,,,,,,,,,,John's number,+49123123123,,,,,,,,,,,,
|
||||
address,,,,,,,,,,John's home address,,1 some street,de,DE-0-NW,some city,123123,John,1,1,1,123,,
|
||||
website,,,,,,,,,,Website,,,,,,,,,,,,,website.com
|
||||
name,Mrs,Jane,,Doe,jdoe,2022-01-30,earth,,,,,,,,,,,,,,,,`;
|
||||
@@ -1,3 +0,0 @@
|
||||
export const paymentsData = `type,account_name,account_holder,cc_number,code,expiration_month,expiration_year,routing_number,account_number,country,issuing_bank
|
||||
bank,John's savings account,John Doe,,,,,routingNumber,accountNumber,US,US-ALLY
|
||||
credit_card,John Doe,,41111111111111111,123,01,2023,,,US,`;
|
||||
@@ -1,6 +0,0 @@
|
||||
export const personalInfoData = `type,title,first_name,middle_name,last_name,login,date_of_birth,place_of_birth,email,email_type,item_name,phone_number,address,country,state,city,zip,address_recipient,address_building,address_apartment,address_floor,address_door_code,job_title,url
|
||||
name,MR,John,,Doe,jdoe,2022-01-30,world,,,,,,,,,,,,,,,,
|
||||
email,,,,,,,,jdoe@example.com,personal,Johns email,,,,,,,,,,,,,
|
||||
number,,,,,,,,,,John's number,+49123123123,,,,,,,,,,,,
|
||||
address,,,,,,,,,,John's home address,,1 some street,de,DE-0-NW,some city,123123,John,1,1,1,123,,
|
||||
website,,,,,,,,,,Website,,,,,,,,,,,,,website.com`;
|
||||
@@ -1,2 +0,0 @@
|
||||
export const secureNoteData = `title,note
|
||||
01,test`;
|
||||
@@ -1,4 +0,0 @@
|
||||
export const data = `"url","username","password","httpRealm","formActionOrigin","guid","timeCreated","timeLastUsed","timePasswordChanged"
|
||||
"chrome://FirefoxAccounts","bla-bla-foo-bar","{""version"":1,""accountData"":{""kSync"":""xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"",""kXCS"":""xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"",""kExtSync"":""xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"",""kExtKbHash"":""xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"",""scopedKeys"":{""https://identity.mozilla.com/apps/oldsync"":{""kid"":""xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",""k"":""xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"",""kty"":""xxx""},""sync:addon_storage"":{""kid"":""xxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"",""k"":""xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"",""kty"":""xxx""}}}}","Firefox Accounts credentials",,"{d61e37fa-2bc4-469a-bd66-41fd3b0005e0}","1612345678900","1612345678900","1612345678900"
|
||||
"https://example.com","foo","bar",,"","{d61e37fa-2bc4-469a-bd66-41fd3b0005e0}","1612345678900","1612345678900","1612345678900"
|
||||
`;
|
||||
@@ -1,2 +0,0 @@
|
||||
export const data = `"url","username","password","httpRealm","formActionOrigin","guid","timeCreated","timeLastUsed","timePasswordChanged"
|
||||
"https://example.com","foo","bar",,"","{d61e37fa-2bc4-469a-bd66-41fd3b0005e0}","1612345678900","1612345678900","1612345678900"`;
|
||||
@@ -1,90 +0,0 @@
|
||||
import { KeeperJsonExport } from "@/jslib/common/src/importers/keeperImporters/types/keeperJsonTypes";
|
||||
|
||||
export const testData: KeeperJsonExport = {
|
||||
shared_folders: [
|
||||
{
|
||||
path: "My Customer 1",
|
||||
manage_users: true,
|
||||
manage_records: true,
|
||||
can_edit: true,
|
||||
can_share: true,
|
||||
permissions: [
|
||||
{
|
||||
uid: "kVM96KGEoGxhskZoSTd_jw",
|
||||
manage_users: true,
|
||||
manage_records: true,
|
||||
},
|
||||
{
|
||||
name: "user@mycompany.com",
|
||||
manage_users: true,
|
||||
manage_records: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "Testing\\My Customer 2",
|
||||
manage_users: true,
|
||||
manage_records: true,
|
||||
can_edit: true,
|
||||
can_share: true,
|
||||
permissions: [
|
||||
{
|
||||
uid: "ih1CggiQ-3ENXcn4G0sl-g",
|
||||
manage_users: true,
|
||||
manage_records: true,
|
||||
},
|
||||
{
|
||||
name: "user@mycompany.com",
|
||||
manage_users: true,
|
||||
manage_records: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
records: [
|
||||
{
|
||||
title: "Bank Account 1",
|
||||
login: "customer1234",
|
||||
password: "4813fJDHF4239fdk",
|
||||
login_url: "https://chase.com",
|
||||
notes: "These are some notes.",
|
||||
custom_fields: {
|
||||
"Account Number": "123-456-789",
|
||||
},
|
||||
folders: [
|
||||
{
|
||||
folder: "Optional Private Folder 1",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Bank Account 2",
|
||||
login: "mybankusername",
|
||||
password: "w4k4k193f$^&@#*%2",
|
||||
login_url: "https://amex.com",
|
||||
notes: "Some great information here.",
|
||||
custom_fields: {
|
||||
"Security Group": "Public",
|
||||
"IP Address": "12.45.67.8",
|
||||
"TFC:Keeper":
|
||||
"otpauth://totp/Amazon:me@company.com?secret=JBSWY3DPEHPK3PXP&issuer=Amazon&algorithm=SHA1&digits=6&period=30",
|
||||
},
|
||||
folders: [
|
||||
{
|
||||
folder: "Optional Private Folder 1",
|
||||
},
|
||||
{
|
||||
shared_folder: "My Customer 1",
|
||||
can_edit: true,
|
||||
can_share: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Some Account",
|
||||
login: "someUserName",
|
||||
password: "w4k4k1wergf$^&@#*%2",
|
||||
login_url: "https://example.com",
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -1,3 +0,0 @@
|
||||
/* eslint-disable */
|
||||
export const userAccountData = `nickname,url,username,password,additionalInfo,twofaSecret,status,tags
|
||||
PasswordNickname,www.google.com,user.name@email.com,abc123,This is the additional information text.,someTOTPSeed,active,someTag`;
|
||||
@@ -1,3 +0,0 @@
|
||||
/* eslint-disable */
|
||||
export const userCreditCardData = `nickname,status,tags,cardNumber,cardName,exp_month,exp_year,cvv,additionalInfo
|
||||
Visa test card,active,someTag,4111111111111111,Joe User,04,24,222,This is the additional information field`;
|
||||
@@ -1,16 +0,0 @@
|
||||
/* eslint-disable */
|
||||
export const userIdCardData = `nickname,status,tags,idType,idNumber,idName,idIssuanceDate,idExpirationDate,idCountry,additionalInfo
|
||||
Joe User's nickname,active,someTag,Driver's License,123456,Joe M User,02/02/2022,02/02/2024,United States,Additional information
|
||||
Passport ID card,active,someTag,Passport,1234567,Joe M User,03/07/2022,03/07/2028,United States,Additional information field
|
||||
Social Security ID card,active,someTag,Social Security,123455678,Joe M User,03/07/2022,03/07/2028,United States,Additional information field text
|
||||
ID card type ID card,active,someTag,ID Card,1234566,Joe M User,03/07/2022,03/07/2028,United States,Additional Information field text
|
||||
Tax number ID card,active,someTag,Tax Number,12345678,Joe M User,03/07/2022,03/07/2028,United States,Additinoal information text field
|
||||
Bank account ID card,active,someTag,Bank Account,12344556677,Joe M User,03/07/2022,03/07/2028,United States,Additional text information here
|
||||
Insurance card ID card,active,someTag,Insurance Card,123456677,Joe M User,03/07/2022,03/07/2022,United States,Additional information text goes here
|
||||
Health card Id card,active,someTag,Health Card,1234670,Joe M User,03/07/2022,03/07/2028,United States,More info
|
||||
Membership ID card,active,someTag,Membership,12345709,Joe M User,03/07/2022,03/07/2028,United States,Add'l info
|
||||
Database ID card,active,someTag,Database,12345089u,Joe M User,03/07/2022,03/07/2028,United States,Addin't info
|
||||
Outdoor license ID card,active,someTag,Outdoor License,123890090,Joe M User,03/07/2022,03/07/2028,United States,Additional info
|
||||
Reward program Id card,active,someTag,Reward Program,12345890b,Joe M User,03/07/2022,03/07/2028,United States,1234890
|
||||
Software license ID card,active,someTag,Software License,1234567c,Joe M User,03/07/2022,03/07/2028,United States,"It seems like the fields don't change, which makes it pretty useless that they have so many ID card types."
|
||||
Tour visa ID card,active,someTag,Tour Visa,123456lkhj,Joe M User,03/07/2022,03/07/2028,United States,Additional Informaion text`;
|
||||
@@ -1,3 +0,0 @@
|
||||
/* eslint-disable */
|
||||
export const userIdentityData = `nickname,status,tags,firstName,middleName,lastName,email,firstAddressLine,secondAddressLine,title,gender,number,city,country,zipCode,additionalInfo
|
||||
Joe User's nickname,active,someTag,Joe,M,User,joe.user@email.com,1 Example House,Suite 300,Mr,Male,2223334444,Portland,United States,04101,Additional information field`;
|
||||
@@ -1,3 +0,0 @@
|
||||
/* eslint-disable */
|
||||
export const userNoteData = `nickname,status,content
|
||||
The title of a secure note,active,"The content of a secure note. Lorem ipsum, etc."`;
|
||||
@@ -1,3 +0,0 @@
|
||||
/* eslint-disable */
|
||||
export const userTwoFaData = `nickname,status,tags,authToken,additionalInfo
|
||||
2FA nickname,active,someTag,someTOTPSeed,"Additional information field content. "`;
|
||||
@@ -1,2 +0,0 @@
|
||||
export const data = `name,url,username,password,note,cardholdername,cardnumber,cvc,expirydate,zipcode,folder,full_name,phone_number,email,address1,address2,city,country,state
|
||||
SomeVisa,,,,,SomeHolder,4024007103939509,123,01 / 22,12345,,,,,,,,,`;
|
||||
@@ -1,2 +0,0 @@
|
||||
export const data = `name,url,username,password,note,cardholdername,cardnumber,cvc,expirydate,zipcode,folder,full_name,phone_number,email,address1,address2,city,country,state
|
||||
SomeTitle,,,,SomeNoteToMyIdentity,,,,,123456,,#fullName,123456789,hello@bitwarden.com,Test street 123,additional addressinfo,Cologne,Germany,North-Rhine-Westphalia`;
|
||||
@@ -1,2 +0,0 @@
|
||||
export const data = `name,url,username,password,note,cardholdername,cardnumber,cvc,expirydate,zipcode,folder,full_name,phone_number,email,address1,address2,city,country,state
|
||||
SomeVaultItemName,https://example.com,hello@bitwarden.com,someStrongPassword,Some note for the VaultItem,,,,,,SomeFolderForVaultItem,,,,,,,,`;
|
||||
@@ -1,3 +0,0 @@
|
||||
export const data = `name,url,username,password,note,cardholdername,cardnumber,cvc,expirydate,zipcode,folder,full_name,phone_number,email,address1,address2,city,country,state
|
||||
notesFolder,,,,,,,,,,,,,,,,,,
|
||||
MySuperSecureNoteTitle,,,,MySuperSecureNote,,,,,,notesFolder,,,,,,,,`;
|
||||
@@ -1,169 +0,0 @@
|
||||
import { ExportData } from "@/jslib/common/src/importers/onepasswordImporters/types/onepassword1PuxImporterTypes";
|
||||
|
||||
export const APICredentialsData: ExportData = {
|
||||
accounts: [
|
||||
{
|
||||
attrs: {
|
||||
accountName: "1Password Customer",
|
||||
name: "1Password Customer",
|
||||
avatar: "",
|
||||
email: "username123123123@gmail.com",
|
||||
uuid: "TRIZ3XV4JJFRXJ3BARILLTUA6E",
|
||||
domain: "https://my.1password.com/",
|
||||
},
|
||||
vaults: [
|
||||
{
|
||||
attrs: {
|
||||
uuid: "pqcgbqjxr4tng2hsqt5ffrgwju",
|
||||
desc: "Just test entries",
|
||||
avatar: "ke7i5rxnjrh3tj6uesstcosspu.png",
|
||||
name: "T's Test Vault",
|
||||
type: "U",
|
||||
},
|
||||
items: [
|
||||
{
|
||||
uuid: "6nqnjdqyk5mwvqbdgbdr47oabe",
|
||||
favIndex: 0,
|
||||
createdAt: 1619465969,
|
||||
updatedAt: 1619466052,
|
||||
trashed: false,
|
||||
categoryUuid: "112",
|
||||
details: {
|
||||
loginFields: [],
|
||||
notesPlain: "My API Credential",
|
||||
sections: [
|
||||
{
|
||||
title: "",
|
||||
fields: [
|
||||
{
|
||||
title: "username",
|
||||
id: "username",
|
||||
value: {
|
||||
string: "apiuser@nullvalue.test",
|
||||
},
|
||||
indexAtSource: 0,
|
||||
guarded: true,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "no",
|
||||
capitalization: "none",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "credential",
|
||||
id: "credential",
|
||||
value: {
|
||||
concealed: "apiapiapiapiapiapiappy",
|
||||
},
|
||||
indexAtSource: 1,
|
||||
guarded: true,
|
||||
multiline: false,
|
||||
dontGenerate: true,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "no",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "type",
|
||||
id: "type",
|
||||
value: {
|
||||
menu: "jwt",
|
||||
},
|
||||
indexAtSource: 2,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "filename",
|
||||
id: "filename",
|
||||
value: {
|
||||
string: "filename.jwt",
|
||||
},
|
||||
indexAtSource: 3,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "valid from",
|
||||
id: "validFrom",
|
||||
value: {
|
||||
date: 1301918460,
|
||||
},
|
||||
indexAtSource: 4,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "expires",
|
||||
id: "expires",
|
||||
value: {
|
||||
date: 1932811260,
|
||||
},
|
||||
indexAtSource: 5,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "hostname",
|
||||
id: "hostname",
|
||||
value: {
|
||||
string: "not.your.everyday.hostname",
|
||||
},
|
||||
indexAtSource: 6,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "uRL",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
passwordHistory: [],
|
||||
},
|
||||
overview: {
|
||||
subtitle: "",
|
||||
title: "API Credential",
|
||||
url: "",
|
||||
ps: 0,
|
||||
pbe: 0.0,
|
||||
pgrng: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -1,224 +0,0 @@
|
||||
import { ExportData } from "@/jslib/common/src/importers/onepasswordImporters/types/onepassword1PuxImporterTypes";
|
||||
|
||||
export const BankAccountData: ExportData = {
|
||||
accounts: [
|
||||
{
|
||||
attrs: {
|
||||
accountName: "1Password Customer",
|
||||
name: "1Password Customer",
|
||||
avatar: "",
|
||||
email: "username123123123@gmail.com",
|
||||
uuid: "TRIZ3XV4JJFRXJ3BARILLTUA6E",
|
||||
domain: "https://my.1password.com/",
|
||||
},
|
||||
vaults: [
|
||||
{
|
||||
attrs: {
|
||||
uuid: "pqcgbqjxr4tng2hsqt5ffrgwju",
|
||||
desc: "Just test entries",
|
||||
avatar: "ke7i5rxnjrh3tj6uesstcosspu.png",
|
||||
name: "T's Test Vault",
|
||||
type: "U",
|
||||
},
|
||||
items: [
|
||||
{
|
||||
uuid: "u2l4sjbencvsowwjuj3dfpt73q",
|
||||
favIndex: 0,
|
||||
createdAt: 1619466056,
|
||||
updatedAt: 1619466187,
|
||||
trashed: false,
|
||||
categoryUuid: "101",
|
||||
details: {
|
||||
loginFields: [],
|
||||
notesPlain: "My Bank Account",
|
||||
sections: [
|
||||
{
|
||||
title: "",
|
||||
fields: [
|
||||
{
|
||||
title: "bank name",
|
||||
id: "bankName",
|
||||
value: {
|
||||
string: "Super Credit Union",
|
||||
},
|
||||
indexAtSource: 0,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "name on account",
|
||||
id: "owner",
|
||||
value: {
|
||||
string: "Cool Guy",
|
||||
},
|
||||
indexAtSource: 1,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "type",
|
||||
id: "accountType",
|
||||
value: {
|
||||
menu: "checking",
|
||||
},
|
||||
indexAtSource: 2,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "routing number",
|
||||
id: "routingNo",
|
||||
value: {
|
||||
string: "111000999",
|
||||
},
|
||||
indexAtSource: 3,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "numbersAndPunctuation",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "account number",
|
||||
id: "accountNo",
|
||||
value: {
|
||||
string: "192837465918273645",
|
||||
},
|
||||
indexAtSource: 4,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "numbersAndPunctuation",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "SWIFT",
|
||||
id: "swift",
|
||||
value: {
|
||||
string: "123456",
|
||||
},
|
||||
indexAtSource: 5,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "numbersAndPunctuation",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "IBAN",
|
||||
id: "iban",
|
||||
value: {
|
||||
string: "DE12 123456",
|
||||
},
|
||||
indexAtSource: 6,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "numbersAndPunctuation",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "PIN",
|
||||
id: "telephonePin",
|
||||
value: {
|
||||
concealed: "5555",
|
||||
},
|
||||
indexAtSource: 7,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: true,
|
||||
inputTraits: {
|
||||
keyboard: "numberPad",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Branch Information",
|
||||
name: "branchInfo",
|
||||
fields: [
|
||||
{
|
||||
title: "phone",
|
||||
id: "branchPhone",
|
||||
value: {
|
||||
phone: "9399399933",
|
||||
},
|
||||
indexAtSource: 0,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "namePhonePad",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "address",
|
||||
id: "branchAddress",
|
||||
value: {
|
||||
string: "1 Fifth Avenue",
|
||||
},
|
||||
indexAtSource: 1,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "sentences",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
passwordHistory: [],
|
||||
},
|
||||
overview: {
|
||||
subtitle: "Super Credit Union",
|
||||
tags: ["Finance"],
|
||||
title: "Bank Account",
|
||||
url: "",
|
||||
ps: 0,
|
||||
pbe: 0.0,
|
||||
pgrng: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -1,343 +0,0 @@
|
||||
import { ExportData } from "@/jslib/common/src/importers/onepasswordImporters/types/onepassword1PuxImporterTypes";
|
||||
|
||||
export const CreditCardData: ExportData = {
|
||||
accounts: [
|
||||
{
|
||||
attrs: {
|
||||
accountName: "1Password Customer",
|
||||
name: "1Password Customer",
|
||||
avatar: "",
|
||||
email: "username123123123@gmail.com",
|
||||
uuid: "TRIZ3XV4JJFRXJ3BARILLTUA6E",
|
||||
domain: "https://my.1password.com/",
|
||||
},
|
||||
vaults: [
|
||||
{
|
||||
attrs: {
|
||||
uuid: "pqcgbqjxr4tng2hsqt5ffrgwju",
|
||||
desc: "Just test entries",
|
||||
avatar: "ke7i5rxnjrh3tj6uesstcosspu.png",
|
||||
name: "T's Test Vault",
|
||||
type: "U",
|
||||
},
|
||||
items: [
|
||||
{
|
||||
uuid: "vpxi2esuujz7nrbojp34rd5aja",
|
||||
favIndex: 0,
|
||||
createdAt: 1619465282,
|
||||
updatedAt: 1619465447,
|
||||
trashed: false,
|
||||
categoryUuid: "002",
|
||||
details: {
|
||||
loginFields: [],
|
||||
notesPlain: "My parents' credit card. ",
|
||||
sections: [
|
||||
{
|
||||
title: "",
|
||||
fields: [
|
||||
{
|
||||
title: "cardholder name",
|
||||
id: "cardholder",
|
||||
value: {
|
||||
string: "Fred Engels",
|
||||
},
|
||||
indexAtSource: 0,
|
||||
guarded: true,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "type",
|
||||
id: "type",
|
||||
value: {
|
||||
creditCardType: "discover",
|
||||
},
|
||||
indexAtSource: 1,
|
||||
guarded: true,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "number",
|
||||
id: "ccnum",
|
||||
value: {
|
||||
creditCardNumber: "6011111111111117",
|
||||
},
|
||||
indexAtSource: 2,
|
||||
guarded: true,
|
||||
clipboardFilter: "0123456789",
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "numberPad",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "verification number",
|
||||
id: "cvv",
|
||||
value: {
|
||||
concealed: "1312",
|
||||
},
|
||||
indexAtSource: 3,
|
||||
guarded: true,
|
||||
multiline: false,
|
||||
dontGenerate: true,
|
||||
inputTraits: {
|
||||
keyboard: "numberPad",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "expiry date",
|
||||
id: "expiry",
|
||||
value: {
|
||||
monthYear: 209912,
|
||||
},
|
||||
indexAtSource: 4,
|
||||
guarded: true,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "valid from",
|
||||
id: "validFrom",
|
||||
value: {
|
||||
monthYear: 200101,
|
||||
},
|
||||
indexAtSource: 5,
|
||||
guarded: true,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "",
|
||||
id: "txbzvwzpck7ejhfres3733rbpm",
|
||||
value: {
|
||||
string: "card",
|
||||
},
|
||||
indexAtSource: 6,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Contact Information",
|
||||
name: "contactInfo",
|
||||
fields: [
|
||||
{
|
||||
title: "issuing bank",
|
||||
id: "bank",
|
||||
value: {
|
||||
string: "Some bank",
|
||||
},
|
||||
indexAtSource: 0,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "phone (local)",
|
||||
id: "phoneLocal",
|
||||
value: {
|
||||
phone: "123456",
|
||||
},
|
||||
indexAtSource: 1,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "namePhonePad",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "phone (toll free)",
|
||||
id: "phoneTollFree",
|
||||
value: {
|
||||
phone: "0800123456",
|
||||
},
|
||||
indexAtSource: 2,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "namePhonePad",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "phone (intl)",
|
||||
id: "phoneIntl",
|
||||
value: {
|
||||
phone: "+49123456",
|
||||
},
|
||||
indexAtSource: 3,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "namePhonePad",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "website",
|
||||
id: "website",
|
||||
value: {
|
||||
url: "somebank.com",
|
||||
},
|
||||
indexAtSource: 4,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Additional Details",
|
||||
name: "details",
|
||||
fields: [
|
||||
{
|
||||
title: "PIN",
|
||||
id: "pin",
|
||||
value: {
|
||||
concealed: "1234",
|
||||
},
|
||||
indexAtSource: 0,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: true,
|
||||
inputTraits: {
|
||||
keyboard: "numberPad",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "credit limit",
|
||||
id: "creditLimit",
|
||||
value: {
|
||||
string: "$1312",
|
||||
},
|
||||
indexAtSource: 1,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "numbersAndPunctuation",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "cash withdrawal limit",
|
||||
id: "cashLimit",
|
||||
value: {
|
||||
string: "$500",
|
||||
},
|
||||
indexAtSource: 2,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "numbersAndPunctuation",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "interest rate",
|
||||
id: "interest",
|
||||
value: {
|
||||
string: "1%",
|
||||
},
|
||||
indexAtSource: 3,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "numbersAndPunctuation",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "issue number",
|
||||
id: "issuenumber",
|
||||
value: {
|
||||
string: "123456",
|
||||
},
|
||||
indexAtSource: 4,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "no",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
passwordHistory: [],
|
||||
},
|
||||
overview: {
|
||||
subtitle: "1234 **** 6789",
|
||||
tags: ["Finance"],
|
||||
title: "Parent's Credit Card",
|
||||
url: "",
|
||||
ps: 0,
|
||||
pbe: 0.0,
|
||||
pgrng: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -1,201 +0,0 @@
|
||||
import { ExportData } from "@/jslib/common/src/importers/onepasswordImporters/types/onepassword1PuxImporterTypes";
|
||||
|
||||
export const DatabaseData: ExportData = {
|
||||
accounts: [
|
||||
{
|
||||
attrs: {
|
||||
accountName: "1Password Customer",
|
||||
name: "1Password Customer",
|
||||
avatar: "",
|
||||
email: "username123123123@gmail.com",
|
||||
uuid: "TRIZ3XV4JJFRXJ3BARILLTUA6E",
|
||||
domain: "https://my.1password.com/",
|
||||
},
|
||||
vaults: [
|
||||
{
|
||||
attrs: {
|
||||
uuid: "pqcgbqjxr4tng2hsqt5ffrgwju",
|
||||
desc: "Just test entries",
|
||||
avatar: "ke7i5rxnjrh3tj6uesstcosspu.png",
|
||||
name: "T's Test Vault",
|
||||
type: "U",
|
||||
},
|
||||
items: [
|
||||
{
|
||||
uuid: "ospvepl3ex2y6hjwwqwyvtf2sy",
|
||||
favIndex: 0,
|
||||
createdAt: 1619466193,
|
||||
updatedAt: 1619466276,
|
||||
trashed: false,
|
||||
categoryUuid: "102",
|
||||
details: {
|
||||
loginFields: [],
|
||||
notesPlain: "My Database",
|
||||
sections: [
|
||||
{
|
||||
title: "",
|
||||
fields: [
|
||||
{
|
||||
title: "type",
|
||||
id: "database_type",
|
||||
value: {
|
||||
menu: "postgresql",
|
||||
},
|
||||
indexAtSource: 0,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "server",
|
||||
id: "hostname",
|
||||
value: {
|
||||
string: "my.secret.db.server",
|
||||
},
|
||||
indexAtSource: 1,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "uRL",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "port",
|
||||
id: "port",
|
||||
value: {
|
||||
string: "1337",
|
||||
},
|
||||
indexAtSource: 2,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "numberPad",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "database",
|
||||
id: "database",
|
||||
value: {
|
||||
string: "user_database",
|
||||
},
|
||||
indexAtSource: 3,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "no",
|
||||
capitalization: "none",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "username",
|
||||
id: "username",
|
||||
value: {
|
||||
string: "cooldbuser",
|
||||
},
|
||||
indexAtSource: 4,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "no",
|
||||
capitalization: "none",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "password",
|
||||
id: "password",
|
||||
value: {
|
||||
concealed: "^+kTjhLaN7wVPAhGU)*J",
|
||||
},
|
||||
indexAtSource: 5,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "SID",
|
||||
id: "sid",
|
||||
value: {
|
||||
string: "ASDIUFU-283234",
|
||||
},
|
||||
indexAtSource: 6,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "alias",
|
||||
id: "alias",
|
||||
value: {
|
||||
string: "cdbu",
|
||||
},
|
||||
indexAtSource: 7,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "connection options",
|
||||
id: "options",
|
||||
value: {
|
||||
string: "ssh",
|
||||
},
|
||||
indexAtSource: 8,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
passwordHistory: [],
|
||||
},
|
||||
overview: {
|
||||
subtitle: "my.secret.db.server",
|
||||
title: "Database",
|
||||
url: "",
|
||||
ps: 0,
|
||||
pbe: 0.0,
|
||||
pgrng: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -1,233 +0,0 @@
|
||||
import { ExportData } from "@/jslib/common/src/importers/onepasswordImporters/types/onepassword1PuxImporterTypes";
|
||||
|
||||
export const DriversLicenseData: ExportData = {
|
||||
accounts: [
|
||||
{
|
||||
attrs: {
|
||||
accountName: "1Password Customer",
|
||||
name: "1Password Customer",
|
||||
avatar: "",
|
||||
email: "username123123123@gmail.com",
|
||||
uuid: "TRIZ3XV4JJFRXJ3BARILLTUA6E",
|
||||
domain: "https://my.1password.com/",
|
||||
},
|
||||
vaults: [
|
||||
{
|
||||
attrs: {
|
||||
uuid: "pqcgbqjxr4tng2hsqt5ffrgwju",
|
||||
desc: "Just test entries",
|
||||
avatar: "ke7i5rxnjrh3tj6uesstcosspu.png",
|
||||
name: "T's Test Vault",
|
||||
type: "U",
|
||||
},
|
||||
items: [
|
||||
{
|
||||
uuid: "nntuge2g7s2wrlokyfhea354ay",
|
||||
favIndex: 0,
|
||||
createdAt: 1619466279,
|
||||
updatedAt: 1619466425,
|
||||
trashed: false,
|
||||
categoryUuid: "103",
|
||||
details: {
|
||||
loginFields: [],
|
||||
notesPlain: "My Driver's License",
|
||||
sections: [
|
||||
{
|
||||
title: "",
|
||||
fields: [
|
||||
{
|
||||
title: "full name",
|
||||
id: "fullname",
|
||||
value: {
|
||||
string: "Michael Scarn",
|
||||
},
|
||||
indexAtSource: 0,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "address",
|
||||
id: "address",
|
||||
value: {
|
||||
string: "2120 Mifflin Rd.",
|
||||
},
|
||||
indexAtSource: 1,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "sentences",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "date of birth",
|
||||
id: "birthdate",
|
||||
value: {
|
||||
date: 252504060,
|
||||
},
|
||||
indexAtSource: 2,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "sex",
|
||||
id: "sex",
|
||||
value: {
|
||||
gender: "male",
|
||||
},
|
||||
indexAtSource: 3,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "height",
|
||||
id: "height",
|
||||
value: {
|
||||
string: "5'11\"",
|
||||
},
|
||||
indexAtSource: 4,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "number",
|
||||
id: "number",
|
||||
value: {
|
||||
string: "12345678901",
|
||||
},
|
||||
indexAtSource: 5,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "license class",
|
||||
id: "class",
|
||||
value: {
|
||||
string: "C",
|
||||
},
|
||||
indexAtSource: 6,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "conditions / restrictions",
|
||||
id: "conditions",
|
||||
value: {
|
||||
string: "B",
|
||||
},
|
||||
indexAtSource: 7,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "state",
|
||||
id: "state",
|
||||
value: {
|
||||
string: "Pennsylvania",
|
||||
},
|
||||
indexAtSource: 8,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "country",
|
||||
id: "country",
|
||||
value: {
|
||||
string: "United States",
|
||||
},
|
||||
indexAtSource: 9,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "expiry date",
|
||||
id: "expiry_date",
|
||||
value: {
|
||||
monthYear: 203012,
|
||||
},
|
||||
indexAtSource: 10,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
passwordHistory: [],
|
||||
},
|
||||
overview: {
|
||||
subtitle: "12345678901",
|
||||
title: "Michael Scarn",
|
||||
url: "",
|
||||
ps: 0,
|
||||
pbe: 0.0,
|
||||
pgrng: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -1,341 +0,0 @@
|
||||
import { ExportData } from "@/jslib/common/src/importers/onepasswordImporters/types/onepassword1PuxImporterTypes";
|
||||
|
||||
export const EmailAccountData: ExportData = {
|
||||
accounts: [
|
||||
{
|
||||
attrs: {
|
||||
accountName: "1Password Customer",
|
||||
name: "1Password Customer",
|
||||
avatar: "",
|
||||
email: "username123123123@gmail.com",
|
||||
uuid: "TRIZ3XV4JJFRXJ3BARILLTUA6E",
|
||||
domain: "https://my.1password.com/",
|
||||
},
|
||||
vaults: [
|
||||
{
|
||||
attrs: {
|
||||
uuid: "pqcgbqjxr4tng2hsqt5ffrgwju",
|
||||
desc: "Just test entries",
|
||||
avatar: "ke7i5rxnjrh3tj6uesstcosspu.png",
|
||||
name: "T's Test Vault",
|
||||
type: "U",
|
||||
},
|
||||
items: [
|
||||
{
|
||||
uuid: "p3hohdgwpt4u2ra2fc3tvzomsm",
|
||||
favIndex: 0,
|
||||
createdAt: 1619466428,
|
||||
updatedAt: 1619466585,
|
||||
trashed: false,
|
||||
categoryUuid: "111",
|
||||
details: {
|
||||
loginFields: [],
|
||||
notesPlain: "My Email Config",
|
||||
sections: [
|
||||
{
|
||||
title: "",
|
||||
fields: [
|
||||
{
|
||||
title: "type",
|
||||
id: "pop_type",
|
||||
value: {
|
||||
menu: "either",
|
||||
},
|
||||
indexAtSource: 0,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "username",
|
||||
id: "pop_username",
|
||||
value: {
|
||||
string: "someuser@nullvalue.test",
|
||||
},
|
||||
indexAtSource: 1,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "no",
|
||||
capitalization: "none",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "server",
|
||||
id: "pop_server",
|
||||
value: {
|
||||
string: "mailserver.nullvalue.test",
|
||||
},
|
||||
indexAtSource: 2,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "uRL",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "port number",
|
||||
id: "pop_port",
|
||||
value: {
|
||||
string: "587",
|
||||
},
|
||||
indexAtSource: 3,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "numberPad",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "password",
|
||||
id: "pop_password",
|
||||
value: {
|
||||
concealed: "u1jsf<UI*&YU&^T",
|
||||
},
|
||||
indexAtSource: 4,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "security",
|
||||
id: "pop_security",
|
||||
value: {
|
||||
menu: "TLS",
|
||||
},
|
||||
indexAtSource: 5,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "auth method",
|
||||
id: "pop_authentication",
|
||||
value: {
|
||||
menu: "kerberos_v5",
|
||||
},
|
||||
indexAtSource: 6,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "SMTP",
|
||||
name: "SMTP",
|
||||
fields: [
|
||||
{
|
||||
title: "SMTP server",
|
||||
id: "smtp_server",
|
||||
value: {
|
||||
string: "mailserver.nullvalue.test",
|
||||
},
|
||||
indexAtSource: 0,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "uRL",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "port number",
|
||||
id: "smtp_port",
|
||||
value: {
|
||||
string: "589",
|
||||
},
|
||||
indexAtSource: 1,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "numberPad",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "username",
|
||||
id: "smtp_username",
|
||||
value: {
|
||||
string: "someuser@nullvalue.test",
|
||||
},
|
||||
indexAtSource: 2,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "no",
|
||||
capitalization: "none",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "password",
|
||||
id: "smtp_password",
|
||||
value: {
|
||||
concealed: "(*1674%^UIUJ*UI(IUI8u98uyy",
|
||||
},
|
||||
indexAtSource: 3,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "security",
|
||||
id: "smtp_security",
|
||||
value: {
|
||||
menu: "TLS",
|
||||
},
|
||||
indexAtSource: 4,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "auth method",
|
||||
id: "smtp_authentication",
|
||||
value: {
|
||||
menu: "password",
|
||||
},
|
||||
indexAtSource: 5,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Contact Information",
|
||||
name: "Contact Information",
|
||||
fields: [
|
||||
{
|
||||
title: "provider",
|
||||
id: "provider",
|
||||
value: {
|
||||
string: "Telum",
|
||||
},
|
||||
indexAtSource: 0,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "provider's website",
|
||||
id: "provider_website",
|
||||
value: {
|
||||
string: "https://telum.nullvalue.test",
|
||||
},
|
||||
indexAtSource: 1,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "uRL",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "phone (local)",
|
||||
id: "phone_local",
|
||||
value: {
|
||||
string: "2346666666",
|
||||
},
|
||||
indexAtSource: 2,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "namePhonePad",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "phone (toll free)",
|
||||
id: "phone_tollfree",
|
||||
value: {
|
||||
string: "18005557777",
|
||||
},
|
||||
indexAtSource: 3,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "namePhonePad",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
passwordHistory: [],
|
||||
},
|
||||
overview: {
|
||||
subtitle: "someuser@nullvalue.test",
|
||||
title: "Email Config",
|
||||
url: "",
|
||||
ps: 0,
|
||||
pbe: 0.0,
|
||||
pgrng: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -1,91 +0,0 @@
|
||||
import { ExportData } from "@/jslib/common/src/importers/onepasswordImporters/types/onepassword1PuxImporterTypes";
|
||||
|
||||
export const EmailFieldData: ExportData = {
|
||||
accounts: [
|
||||
{
|
||||
attrs: {
|
||||
accountName: "1Password Customer",
|
||||
name: "1Password Customer",
|
||||
avatar: "",
|
||||
email: "username123123123@gmail.com",
|
||||
uuid: "TRIZ3XV4JJFRXJ3BARILLTUA6E",
|
||||
domain: "https://my.1password.com/",
|
||||
},
|
||||
vaults: [
|
||||
{
|
||||
attrs: {
|
||||
uuid: "pqcgbqjxr4tng2hsqt5ffrgwju",
|
||||
desc: "Just test entries",
|
||||
avatar: "ke7i5rxnjrh3tj6uesstcosspu.png",
|
||||
name: "T's Test Vault",
|
||||
type: "U",
|
||||
},
|
||||
items: [
|
||||
{
|
||||
uuid: "47hvppiuwbanbza7bq6jpdjfxu",
|
||||
favIndex: 1,
|
||||
createdAt: 1619467985,
|
||||
updatedAt: 1619468230,
|
||||
trashed: false,
|
||||
categoryUuid: "100",
|
||||
details: {
|
||||
loginFields: [],
|
||||
notesPlain: "My Software License",
|
||||
sections: [
|
||||
{
|
||||
title: "",
|
||||
fields: [],
|
||||
},
|
||||
{
|
||||
title: "Customer",
|
||||
name: "customer",
|
||||
fields: [
|
||||
{
|
||||
title: "registered email",
|
||||
id: "reg_email",
|
||||
value: {
|
||||
email: {
|
||||
email_address: "kriddler@nullvalue.test",
|
||||
provider: "myEmailProvider",
|
||||
},
|
||||
},
|
||||
indexAtSource: 1,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "emailAddress",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Publisher",
|
||||
name: "publisher",
|
||||
fields: [],
|
||||
},
|
||||
{
|
||||
title: "Order",
|
||||
name: "order",
|
||||
fields: [],
|
||||
},
|
||||
],
|
||||
passwordHistory: [],
|
||||
},
|
||||
overview: {
|
||||
subtitle: "5.10.1000",
|
||||
title: "Limux Product Key",
|
||||
url: "",
|
||||
ps: 0,
|
||||
pbe: 0.0,
|
||||
pgrng: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -1,87 +0,0 @@
|
||||
import { ExportData } from "@/jslib/common/src/importers/onepasswordImporters/types/onepassword1PuxImporterTypes";
|
||||
|
||||
export const EmailFieldOnIdentityData: ExportData = {
|
||||
accounts: [
|
||||
{
|
||||
attrs: {
|
||||
accountName: "1Password Customer",
|
||||
name: "1Password Customer",
|
||||
avatar: "",
|
||||
email: "username123123123@gmail.com",
|
||||
uuid: "TRIZ3XV4JJFRXJ3BARILLTUA6E",
|
||||
domain: "https://my.1password.com/",
|
||||
},
|
||||
vaults: [
|
||||
{
|
||||
attrs: {
|
||||
uuid: "pqcgbqjxr4tng2hsqt5ffrgwju",
|
||||
desc: "Just test entries",
|
||||
avatar: "ke7i5rxnjrh3tj6uesstcosspu.png",
|
||||
name: "T's Test Vault",
|
||||
type: "U",
|
||||
},
|
||||
items: [
|
||||
{
|
||||
uuid: "45mjttbbq3owgij2uis55pfrlq",
|
||||
favIndex: 0,
|
||||
createdAt: 1619465450,
|
||||
updatedAt: 1619465789,
|
||||
trashed: false,
|
||||
categoryUuid: "004",
|
||||
details: {
|
||||
loginFields: [],
|
||||
notesPlain: "",
|
||||
sections: [
|
||||
{
|
||||
title: "Identification",
|
||||
name: "name",
|
||||
fields: [],
|
||||
},
|
||||
{
|
||||
title: "Address",
|
||||
name: "address",
|
||||
fields: [],
|
||||
},
|
||||
{
|
||||
title: "Internet Details",
|
||||
name: "internet",
|
||||
fields: [
|
||||
{
|
||||
title: "E-mail",
|
||||
id: "E-mail",
|
||||
value: {
|
||||
email: {
|
||||
email_address: "gengels@nullvalue.test",
|
||||
provider: "myEmailProvider",
|
||||
},
|
||||
},
|
||||
indexAtSource: 4,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "emailAddress",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
passwordHistory: [],
|
||||
},
|
||||
overview: {
|
||||
subtitle: "George Engels",
|
||||
title: "George Engels",
|
||||
url: "",
|
||||
ps: 0,
|
||||
pbe: 0.0,
|
||||
pgrng: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -1,103 +0,0 @@
|
||||
import { ExportData } from "@/jslib/common/src/importers/onepasswordImporters/types/onepassword1PuxImporterTypes";
|
||||
|
||||
export const EmailFieldOnIdentityPrefilledData: ExportData = {
|
||||
accounts: [
|
||||
{
|
||||
attrs: {
|
||||
accountName: "1Password Customer",
|
||||
name: "1Password Customer",
|
||||
avatar: "",
|
||||
email: "username123123123@gmail.com",
|
||||
uuid: "TRIZ3XV4JJFRXJ3BARILLTUA6E",
|
||||
domain: "https://my.1password.com/",
|
||||
},
|
||||
vaults: [
|
||||
{
|
||||
attrs: {
|
||||
uuid: "pqcgbqjxr4tng2hsqt5ffrgwju",
|
||||
desc: "Just test entries",
|
||||
avatar: "ke7i5rxnjrh3tj6uesstcosspu.png",
|
||||
name: "T's Test Vault",
|
||||
type: "U",
|
||||
},
|
||||
items: [
|
||||
{
|
||||
uuid: "45mjttbbq3owgij2uis55pfrlq",
|
||||
favIndex: 0,
|
||||
createdAt: 1619465450,
|
||||
updatedAt: 1619465789,
|
||||
trashed: false,
|
||||
categoryUuid: "004",
|
||||
details: {
|
||||
loginFields: [],
|
||||
notesPlain: "",
|
||||
sections: [
|
||||
{
|
||||
title: "Identification",
|
||||
name: "name",
|
||||
fields: [],
|
||||
},
|
||||
{
|
||||
title: "Address",
|
||||
name: "address",
|
||||
fields: [],
|
||||
},
|
||||
{
|
||||
title: "Internet Details",
|
||||
name: "internet",
|
||||
fields: [
|
||||
{
|
||||
title: "email",
|
||||
id: "email",
|
||||
value: {
|
||||
string: "gengels@nullvalue.test",
|
||||
},
|
||||
indexAtSource: 4,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "emailAddress",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "2nd email",
|
||||
id: "2nd_email",
|
||||
value: {
|
||||
email: {
|
||||
email_address: "kriddler@nullvalue.test",
|
||||
provider: "myEmailProvider",
|
||||
},
|
||||
},
|
||||
indexAtSource: 1,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "emailAddress",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
passwordHistory: [],
|
||||
},
|
||||
overview: {
|
||||
subtitle: "George Engels",
|
||||
title: "George Engels",
|
||||
url: "",
|
||||
ps: 0,
|
||||
pbe: 0.0,
|
||||
pgrng: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -1,476 +0,0 @@
|
||||
import { ExportData } from "@/jslib/common/src/importers/onepasswordImporters/types/onepassword1PuxImporterTypes";
|
||||
|
||||
export const IdentityData: ExportData = {
|
||||
accounts: [
|
||||
{
|
||||
attrs: {
|
||||
accountName: "1Password Customer",
|
||||
name: "1Password Customer",
|
||||
avatar: "",
|
||||
email: "username123123123@gmail.com",
|
||||
uuid: "TRIZ3XV4JJFRXJ3BARILLTUA6E",
|
||||
domain: "https://my.1password.com/",
|
||||
},
|
||||
vaults: [
|
||||
{
|
||||
attrs: {
|
||||
uuid: "pqcgbqjxr4tng2hsqt5ffrgwju",
|
||||
desc: "Just test entries",
|
||||
avatar: "ke7i5rxnjrh3tj6uesstcosspu.png",
|
||||
name: "T's Test Vault",
|
||||
type: "U",
|
||||
},
|
||||
items: [
|
||||
{
|
||||
uuid: "45mjttbbq3owgij2uis55pfrlq",
|
||||
favIndex: 0,
|
||||
createdAt: 1619465450,
|
||||
updatedAt: 1619465789,
|
||||
trashed: false,
|
||||
categoryUuid: "004",
|
||||
details: {
|
||||
loginFields: [],
|
||||
notesPlain: "",
|
||||
sections: [
|
||||
{
|
||||
title: "Identification",
|
||||
name: "name",
|
||||
fields: [
|
||||
{
|
||||
title: "first name",
|
||||
id: "firstname",
|
||||
value: {
|
||||
string: "George",
|
||||
},
|
||||
indexAtSource: 0,
|
||||
guarded: true,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "initial",
|
||||
id: "initial",
|
||||
value: {
|
||||
string: "S",
|
||||
},
|
||||
indexAtSource: 1,
|
||||
guarded: true,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "last name",
|
||||
id: "lastname",
|
||||
value: {
|
||||
string: "Engels",
|
||||
},
|
||||
indexAtSource: 2,
|
||||
guarded: true,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "sex",
|
||||
id: "sex",
|
||||
value: {
|
||||
menu: "male",
|
||||
},
|
||||
indexAtSource: 3,
|
||||
guarded: true,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "birth date",
|
||||
id: "birthdate",
|
||||
value: {
|
||||
date: 347198460,
|
||||
},
|
||||
indexAtSource: 4,
|
||||
guarded: true,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "occupation",
|
||||
id: "occupation",
|
||||
value: {
|
||||
string: "Steel Worker",
|
||||
},
|
||||
indexAtSource: 5,
|
||||
guarded: true,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "company",
|
||||
id: "company",
|
||||
value: {
|
||||
string: "Acme Inc.",
|
||||
},
|
||||
indexAtSource: 6,
|
||||
guarded: true,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "department",
|
||||
id: "department",
|
||||
value: {
|
||||
string: "QA",
|
||||
},
|
||||
indexAtSource: 7,
|
||||
guarded: true,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "job title",
|
||||
id: "jobtitle",
|
||||
value: {
|
||||
string: "Quality Assurance Manager",
|
||||
},
|
||||
indexAtSource: 8,
|
||||
guarded: true,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Address",
|
||||
name: "address",
|
||||
fields: [
|
||||
{
|
||||
title: "address",
|
||||
id: "address",
|
||||
value: {
|
||||
address: {
|
||||
street: "1312 Main St.",
|
||||
city: "Atlantis",
|
||||
country: "us",
|
||||
zip: "90210",
|
||||
state: "California",
|
||||
},
|
||||
},
|
||||
indexAtSource: 0,
|
||||
guarded: true,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "sentences",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "default phone",
|
||||
id: "defphone",
|
||||
value: {
|
||||
phone: "4565555555",
|
||||
},
|
||||
indexAtSource: 1,
|
||||
guarded: true,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "home",
|
||||
id: "homephone",
|
||||
value: {
|
||||
phone: "4575555555",
|
||||
},
|
||||
indexAtSource: 2,
|
||||
guarded: true,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "cell",
|
||||
id: "cellphone",
|
||||
value: {
|
||||
phone: "4585555555",
|
||||
},
|
||||
indexAtSource: 3,
|
||||
guarded: true,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "business",
|
||||
id: "busphone",
|
||||
value: {
|
||||
phone: "4595555555",
|
||||
},
|
||||
indexAtSource: 4,
|
||||
guarded: true,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Internet Details",
|
||||
name: "internet",
|
||||
fields: [
|
||||
{
|
||||
title: "username",
|
||||
id: "username",
|
||||
value: {
|
||||
string: "gengels",
|
||||
},
|
||||
indexAtSource: 0,
|
||||
guarded: true,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "reminder question",
|
||||
id: "reminderq",
|
||||
value: {
|
||||
string: "Who's a super cool guy?",
|
||||
},
|
||||
indexAtSource: 1,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "reminder answer",
|
||||
id: "remindera",
|
||||
value: {
|
||||
string: "Me, buddy.",
|
||||
},
|
||||
indexAtSource: 2,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "email",
|
||||
id: "email",
|
||||
value: {
|
||||
string: "gengels@nullvalue.test",
|
||||
},
|
||||
indexAtSource: 3,
|
||||
guarded: true,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "emailAddress",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "website",
|
||||
id: "website",
|
||||
value: {
|
||||
string: "cv.gengels.nullvalue.test",
|
||||
},
|
||||
indexAtSource: 4,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "uRL",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "ICQ",
|
||||
id: "icq",
|
||||
value: {
|
||||
string: "12345678",
|
||||
},
|
||||
indexAtSource: 5,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "skype",
|
||||
id: "skype",
|
||||
value: {
|
||||
string: "skypeisbad1619",
|
||||
},
|
||||
indexAtSource: 6,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "AOL/AIM",
|
||||
id: "aim",
|
||||
value: {
|
||||
string: "aollol@lololol.aol.com",
|
||||
},
|
||||
indexAtSource: 7,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "Yahoo",
|
||||
id: "yahoo",
|
||||
value: {
|
||||
string: "sk8rboi13@yah00.com",
|
||||
},
|
||||
indexAtSource: 8,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "MSN",
|
||||
id: "msn",
|
||||
value: {
|
||||
string: "msnothankyou@msn&m&m.com",
|
||||
},
|
||||
indexAtSource: 9,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "forum signature",
|
||||
id: "forumsig",
|
||||
value: {
|
||||
string: "super cool guy",
|
||||
},
|
||||
indexAtSource: 10,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
passwordHistory: [],
|
||||
},
|
||||
overview: {
|
||||
subtitle: "George Engels",
|
||||
title: "George Engels",
|
||||
url: "",
|
||||
ps: 0,
|
||||
pbe: 0.0,
|
||||
pgrng: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -1,135 +0,0 @@
|
||||
import { ExportData } from "@/jslib/common/src/importers/onepasswordImporters/types/onepassword1PuxImporterTypes";
|
||||
|
||||
export const LoginData: ExportData = {
|
||||
accounts: [
|
||||
{
|
||||
attrs: {
|
||||
accountName: "Wendy Appleseed",
|
||||
name: "Wendy Appleseed",
|
||||
avatar: "profile-pic.png",
|
||||
email: "wendy.c.appleseed@gmail.com",
|
||||
uuid: "D4RI47B7BJDT25C2LWA7LEJLHZ",
|
||||
domain: "https://my.1password.com/",
|
||||
},
|
||||
vaults: [
|
||||
{
|
||||
attrs: {
|
||||
uuid: "rr3lr6c2opoggvrete23q72ahi",
|
||||
desc: "",
|
||||
avatar: "pic.png",
|
||||
name: "Personal",
|
||||
type: "P",
|
||||
},
|
||||
items: [
|
||||
{
|
||||
uuid: "2b3hr6p5hinr7prtrj65bwmxqu",
|
||||
favIndex: 0,
|
||||
createdAt: 1635522833,
|
||||
updatedAt: 1635522872,
|
||||
trashed: false,
|
||||
categoryUuid: "001",
|
||||
details: {
|
||||
loginFields: [
|
||||
{
|
||||
value: "username123123123@gmail.com",
|
||||
id: "",
|
||||
name: "email",
|
||||
fieldType: "E",
|
||||
designation: "username",
|
||||
},
|
||||
{
|
||||
value: "password!",
|
||||
id: "",
|
||||
name: "password",
|
||||
fieldType: "P",
|
||||
designation: "password",
|
||||
},
|
||||
{
|
||||
value: "",
|
||||
id: "terms",
|
||||
name: "terms",
|
||||
fieldType: "C",
|
||||
},
|
||||
{
|
||||
value: "✓",
|
||||
id: "policies",
|
||||
name: "policies",
|
||||
fieldType: "C",
|
||||
},
|
||||
],
|
||||
sections: [
|
||||
{
|
||||
title: "Saved on www.fakesite.com",
|
||||
name: "Section_mlvk6wzoifml4rbs4c3rfu4e2a",
|
||||
fields: [
|
||||
{
|
||||
title: "Create an account",
|
||||
id: "cyqyggt2otns6tbbqtsl6w2ceu",
|
||||
value: {
|
||||
string: "username123123",
|
||||
},
|
||||
indexAtSource: 0,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "one-time password",
|
||||
id: "TOTP_564mvwqapphpsjetnnuovmuxum",
|
||||
value: {
|
||||
totp: "otpseed777",
|
||||
},
|
||||
indexAtSource: 0,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
passwordHistory: [
|
||||
{
|
||||
value: "123uio123oiu123uiopassword",
|
||||
time: 1635522872,
|
||||
},
|
||||
{
|
||||
value: "123uio123oiu123uiopassword123",
|
||||
time: 1635522854,
|
||||
},
|
||||
{
|
||||
value: "123uio123oiu123uiopassword123123",
|
||||
time: 1635522848,
|
||||
},
|
||||
],
|
||||
},
|
||||
overview: {
|
||||
subtitle: "username123123@gmail.com",
|
||||
urls: [
|
||||
{
|
||||
label: "website",
|
||||
url: "https://www.fakesite.com",
|
||||
},
|
||||
],
|
||||
title: "eToro",
|
||||
url: "https://www.fakesite.com",
|
||||
ps: 54,
|
||||
pbe: 0.0,
|
||||
pgrng: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -1,198 +0,0 @@
|
||||
import { ExportData } from "@/jslib/common/src/importers/onepasswordImporters/types/onepassword1PuxImporterTypes";
|
||||
|
||||
export const MedicalRecordData: ExportData = {
|
||||
accounts: [
|
||||
{
|
||||
attrs: {
|
||||
accountName: "1Password Customer",
|
||||
name: "1Password Customer",
|
||||
avatar: "",
|
||||
email: "username123123123@gmail.com",
|
||||
uuid: "TRIZ3XV4JJFRXJ3BARILLTUA6E",
|
||||
domain: "https://my.1password.com/",
|
||||
},
|
||||
vaults: [
|
||||
{
|
||||
attrs: {
|
||||
uuid: "pqcgbqjxr4tng2hsqt5ffrgwju",
|
||||
desc: "Just test entries",
|
||||
avatar: "ke7i5rxnjrh3tj6uesstcosspu.png",
|
||||
name: "T's Test Vault",
|
||||
type: "U",
|
||||
},
|
||||
items: [
|
||||
{
|
||||
uuid: "42mj5boh5rxq7uqjrmkslmhosu",
|
||||
favIndex: 0,
|
||||
createdAt: 1641220207,
|
||||
updatedAt: 1641220326,
|
||||
trashed: false,
|
||||
categoryUuid: "113",
|
||||
details: {
|
||||
loginFields: [],
|
||||
notesPlain: "Some notes about my medical history",
|
||||
sections: [
|
||||
{
|
||||
title: "",
|
||||
fields: [
|
||||
{
|
||||
title: "date",
|
||||
id: "date",
|
||||
value: {
|
||||
date: 1641038460,
|
||||
},
|
||||
indexAtSource: 0,
|
||||
guarded: true,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "location",
|
||||
id: "location",
|
||||
value: {
|
||||
string: "some hospital/clinic",
|
||||
},
|
||||
indexAtSource: 1,
|
||||
guarded: true,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
placeholder: "locationplaceholder",
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "healthcare professional",
|
||||
id: "healthcareprofessional",
|
||||
value: {
|
||||
string: "Some Doctor",
|
||||
},
|
||||
indexAtSource: 2,
|
||||
guarded: true,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
placeholder: "nameplaceholder",
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "patient",
|
||||
id: "patient",
|
||||
value: {
|
||||
string: "Me",
|
||||
},
|
||||
indexAtSource: 3,
|
||||
guarded: true,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
placeholder: "nameplaceholder",
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "reason for visit",
|
||||
id: "reason",
|
||||
value: {
|
||||
string: "unwell",
|
||||
},
|
||||
indexAtSource: 4,
|
||||
guarded: true,
|
||||
multiline: true,
|
||||
dontGenerate: false,
|
||||
placeholder: "reasonplaceholder",
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "sentences",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "medication",
|
||||
name: "medication",
|
||||
fields: [
|
||||
{
|
||||
title: "medication",
|
||||
id: "medication",
|
||||
value: {
|
||||
string: "Insuline",
|
||||
},
|
||||
indexAtSource: 0,
|
||||
guarded: true,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
placeholder: "medicationplaceholder",
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "dosage",
|
||||
id: "dosage",
|
||||
value: {
|
||||
string: "1",
|
||||
},
|
||||
indexAtSource: 1,
|
||||
guarded: true,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
placeholder: "dosageplaceholder",
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "medication notes",
|
||||
id: "notes",
|
||||
value: {
|
||||
string: "multiple times a day",
|
||||
},
|
||||
indexAtSource: 2,
|
||||
guarded: true,
|
||||
multiline: true,
|
||||
dontGenerate: false,
|
||||
placeholder: "notesplaceholder",
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "sentences",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
passwordHistory: [],
|
||||
},
|
||||
overview: {
|
||||
subtitle: "2022-01-01",
|
||||
title: "Some Health Record",
|
||||
url: "",
|
||||
ps: 0,
|
||||
pbe: 0.0,
|
||||
pgrng: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -1,186 +0,0 @@
|
||||
import { ExportData } from "@/jslib/common/src/importers/onepasswordImporters/types/onepassword1PuxImporterTypes";
|
||||
|
||||
export const MembershipData: ExportData = {
|
||||
accounts: [
|
||||
{
|
||||
attrs: {
|
||||
accountName: "1Password Customer",
|
||||
name: "1Password Customer",
|
||||
avatar: "",
|
||||
email: "username123123123@gmail.com",
|
||||
uuid: "TRIZ3XV4JJFRXJ3BARILLTUA6E",
|
||||
domain: "https://my.1password.com/",
|
||||
},
|
||||
vaults: [
|
||||
{
|
||||
attrs: {
|
||||
uuid: "pqcgbqjxr4tng2hsqt5ffrgwju",
|
||||
desc: "Just test entries",
|
||||
avatar: "ke7i5rxnjrh3tj6uesstcosspu.png",
|
||||
name: "T's Test Vault",
|
||||
type: "U",
|
||||
},
|
||||
items: [
|
||||
{
|
||||
uuid: "ofdp2szoty2ujk6yv5ebn4wjr4",
|
||||
favIndex: 1,
|
||||
createdAt: 1619467269,
|
||||
updatedAt: 1619467368,
|
||||
trashed: false,
|
||||
categoryUuid: "105",
|
||||
details: {
|
||||
loginFields: [],
|
||||
notesPlain: "My Library Card",
|
||||
sections: [
|
||||
{
|
||||
title: "",
|
||||
fields: [
|
||||
{
|
||||
title: "group",
|
||||
id: "org_name",
|
||||
value: {
|
||||
string: "National Public Library",
|
||||
},
|
||||
indexAtSource: 0,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "website",
|
||||
id: "website",
|
||||
value: {
|
||||
url: "https://npl.nullvalue.gov.test",
|
||||
},
|
||||
indexAtSource: 1,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "telephone",
|
||||
id: "phone",
|
||||
value: {
|
||||
phone: "9995555555",
|
||||
},
|
||||
indexAtSource: 2,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "member name",
|
||||
id: "member_name",
|
||||
value: {
|
||||
string: "George Engels",
|
||||
},
|
||||
indexAtSource: 3,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "member since",
|
||||
id: "member_since",
|
||||
value: {
|
||||
monthYear: 199901,
|
||||
},
|
||||
indexAtSource: 4,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "expiry date",
|
||||
id: "expiry_date",
|
||||
value: {
|
||||
monthYear: 203412,
|
||||
},
|
||||
indexAtSource: 5,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "member ID",
|
||||
id: "membership_no",
|
||||
value: {
|
||||
string: "64783862",
|
||||
},
|
||||
indexAtSource: 6,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "namePhonePad",
|
||||
correction: "no",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "PIN",
|
||||
id: "pin",
|
||||
value: {
|
||||
concealed: "19191",
|
||||
},
|
||||
indexAtSource: 7,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "numberPad",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
passwordHistory: [],
|
||||
},
|
||||
overview: {
|
||||
subtitle: "George Engels",
|
||||
tags: ["Education"],
|
||||
title: "Library Card",
|
||||
url: "",
|
||||
ps: 0,
|
||||
pbe: 0.0,
|
||||
pgrng: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -1,93 +0,0 @@
|
||||
import { ExportData } from "@/jslib/common/src/importers/onepasswordImporters/types/onepassword1PuxImporterTypes";
|
||||
|
||||
export const OnePuxExampleFile: ExportData = {
|
||||
accounts: [
|
||||
{
|
||||
attrs: {
|
||||
accountName: "Wendy Appleseed",
|
||||
name: "Wendy Appleseed",
|
||||
avatar: "profile-pic.png",
|
||||
email: "wendy.c.appleseed@gmail.com",
|
||||
uuid: "D4RI47B7BJDT25C2LWA7LEJLHZ",
|
||||
domain: "https://my.1password.com/",
|
||||
},
|
||||
vaults: [
|
||||
{
|
||||
attrs: {
|
||||
uuid: "rr3lr6c2opoggvrete23q72ahi",
|
||||
desc: "",
|
||||
avatar: "pic.png",
|
||||
name: "Personal",
|
||||
type: "P",
|
||||
},
|
||||
items: [
|
||||
{
|
||||
uuid: "fkruyzrldvizuqlnavfj3gltfe",
|
||||
favIndex: 1,
|
||||
createdAt: 1614298956,
|
||||
updatedAt: 1635346445,
|
||||
trashed: false,
|
||||
categoryUuid: "001",
|
||||
details: {
|
||||
loginFields: [
|
||||
{
|
||||
value: "most-secure-password-ever!",
|
||||
id: "",
|
||||
name: "password",
|
||||
fieldType: "P",
|
||||
designation: "password",
|
||||
},
|
||||
],
|
||||
notesPlain: "This is a note. *bold*! _italic_!",
|
||||
sections: [
|
||||
{
|
||||
title: "Security",
|
||||
name: "Section_oazxddhvftfknycbbmh5ntwfa4",
|
||||
fields: [
|
||||
{
|
||||
title: "PIN",
|
||||
id: "CCEF647B399604E8F6Q6C8C3W31AFD407",
|
||||
value: {
|
||||
concealed: "12345",
|
||||
},
|
||||
indexAtSource: 0,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
passwordHistory: [
|
||||
{
|
||||
value: "12345password",
|
||||
time: 1458322355,
|
||||
},
|
||||
],
|
||||
},
|
||||
overview: {
|
||||
subtitle: "",
|
||||
urls: [
|
||||
{
|
||||
label: "",
|
||||
url: "https://www.dropbox.com/",
|
||||
},
|
||||
],
|
||||
title: "Dropbox",
|
||||
url: "https://www.dropbox.com/",
|
||||
ps: 100,
|
||||
pbe: 86.13621,
|
||||
pgrng: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -1,169 +0,0 @@
|
||||
import { ExportData } from "@/jslib/common/src/importers/onepasswordImporters/types/onepassword1PuxImporterTypes";
|
||||
|
||||
export const OutdoorLicenseData: ExportData = {
|
||||
accounts: [
|
||||
{
|
||||
attrs: {
|
||||
accountName: "1Password Customer",
|
||||
name: "1Password Customer",
|
||||
avatar: "",
|
||||
email: "username123123123@gmail.com",
|
||||
uuid: "TRIZ3XV4JJFRXJ3BARILLTUA6E",
|
||||
domain: "https://my.1password.com/",
|
||||
},
|
||||
vaults: [
|
||||
{
|
||||
attrs: {
|
||||
uuid: "pqcgbqjxr4tng2hsqt5ffrgwju",
|
||||
desc: "Just test entries",
|
||||
avatar: "ke7i5rxnjrh3tj6uesstcosspu.png",
|
||||
name: "T's Test Vault",
|
||||
type: "U",
|
||||
},
|
||||
items: [
|
||||
{
|
||||
uuid: "6fb73t5lk7vc52h3osw3ccmguy",
|
||||
favIndex: 0,
|
||||
createdAt: 1619467374,
|
||||
updatedAt: 1619467492,
|
||||
trashed: false,
|
||||
categoryUuid: "104",
|
||||
details: {
|
||||
loginFields: [],
|
||||
notesPlain: "My Outdoor License",
|
||||
sections: [
|
||||
{
|
||||
title: "",
|
||||
fields: [
|
||||
{
|
||||
title: "full name",
|
||||
id: "name",
|
||||
value: {
|
||||
string: "Cash Bandit",
|
||||
},
|
||||
indexAtSource: 0,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "valid from",
|
||||
id: "valid_from",
|
||||
value: {
|
||||
date: 1617278460,
|
||||
},
|
||||
indexAtSource: 1,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "expires",
|
||||
id: "expires",
|
||||
value: {
|
||||
date: 2343124860,
|
||||
},
|
||||
indexAtSource: 2,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "approved wildlife",
|
||||
id: "game",
|
||||
value: {
|
||||
string: "Bananas,blueberries,corn",
|
||||
},
|
||||
indexAtSource: 3,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "maximum quota",
|
||||
id: "quota",
|
||||
value: {
|
||||
string: "100/each",
|
||||
},
|
||||
indexAtSource: 4,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "state",
|
||||
id: "state",
|
||||
value: {
|
||||
string: "Washington",
|
||||
},
|
||||
indexAtSource: 5,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "country",
|
||||
id: "country",
|
||||
value: {
|
||||
string: "United States of America",
|
||||
},
|
||||
indexAtSource: 6,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
passwordHistory: [],
|
||||
},
|
||||
overview: {
|
||||
subtitle: "Cash Bandit",
|
||||
title: "Harvest License",
|
||||
url: "",
|
||||
ps: 0,
|
||||
pbe: 0.0,
|
||||
pgrng: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -1,234 +0,0 @@
|
||||
import { ExportData } from "@/jslib/common/src/importers/onepasswordImporters/types/onepassword1PuxImporterTypes";
|
||||
|
||||
export const PassportData: ExportData = {
|
||||
accounts: [
|
||||
{
|
||||
attrs: {
|
||||
accountName: "1Password Customer",
|
||||
name: "1Password Customer",
|
||||
avatar: "",
|
||||
email: "username123123123@gmail.com",
|
||||
uuid: "TRIZ3XV4JJFRXJ3BARILLTUA6E",
|
||||
domain: "https://my.1password.com/",
|
||||
},
|
||||
vaults: [
|
||||
{
|
||||
attrs: {
|
||||
uuid: "pqcgbqjxr4tng2hsqt5ffrgwju",
|
||||
desc: "Just test entries",
|
||||
avatar: "ke7i5rxnjrh3tj6uesstcosspu.png",
|
||||
name: "T's Test Vault",
|
||||
type: "U",
|
||||
},
|
||||
items: [
|
||||
{
|
||||
uuid: "hffila4ew2e3krfzp2tkdkdmea",
|
||||
favIndex: 0,
|
||||
createdAt: 1619467498,
|
||||
updatedAt: 1619467655,
|
||||
trashed: false,
|
||||
categoryUuid: "106",
|
||||
details: {
|
||||
loginFields: [],
|
||||
notesPlain: "My Passport",
|
||||
sections: [
|
||||
{
|
||||
title: "",
|
||||
fields: [
|
||||
{
|
||||
title: "type",
|
||||
id: "type",
|
||||
value: {
|
||||
string: "US Passport",
|
||||
},
|
||||
indexAtSource: 0,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "allCharacters",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "issuing country",
|
||||
id: "issuing_country",
|
||||
value: {
|
||||
string: "United States of America",
|
||||
},
|
||||
indexAtSource: 1,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "number",
|
||||
id: "number",
|
||||
value: {
|
||||
string: "76436847",
|
||||
},
|
||||
indexAtSource: 2,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "namePhonePad",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "full name",
|
||||
id: "fullname",
|
||||
value: {
|
||||
string: "David Global",
|
||||
},
|
||||
indexAtSource: 3,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "sex",
|
||||
id: "sex",
|
||||
value: {
|
||||
gender: "female",
|
||||
},
|
||||
indexAtSource: 4,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "nationality",
|
||||
id: "nationality",
|
||||
value: {
|
||||
string: "International",
|
||||
},
|
||||
indexAtSource: 5,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "issuing authority",
|
||||
id: "issuing_authority",
|
||||
value: {
|
||||
string: "Department of State",
|
||||
},
|
||||
indexAtSource: 6,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "date of birth",
|
||||
id: "birthdate",
|
||||
value: {
|
||||
date: 418046460,
|
||||
},
|
||||
indexAtSource: 7,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "place of birth",
|
||||
id: "birthplace",
|
||||
value: {
|
||||
string: "A cave somewhere in Maine",
|
||||
},
|
||||
indexAtSource: 8,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "issued on",
|
||||
id: "issue_date",
|
||||
value: {
|
||||
date: 1577880060,
|
||||
},
|
||||
indexAtSource: 9,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "expiry date",
|
||||
id: "expiry_date",
|
||||
value: {
|
||||
date: 2524651260,
|
||||
},
|
||||
indexAtSource: 10,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
passwordHistory: [],
|
||||
},
|
||||
overview: {
|
||||
subtitle: "76436847",
|
||||
tags: ["Travel"],
|
||||
title: "Mr. Globewide",
|
||||
url: "",
|
||||
ps: 0,
|
||||
pbe: 0.0,
|
||||
pgrng: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -1,58 +0,0 @@
|
||||
import { ExportData } from "@/jslib/common/src/importers/onepasswordImporters/types/onepassword1PuxImporterTypes";
|
||||
|
||||
export const PasswordData: ExportData = {
|
||||
accounts: [
|
||||
{
|
||||
attrs: {
|
||||
accountName: "1Password Customer",
|
||||
name: "1Password Customer",
|
||||
avatar: "",
|
||||
email: "username123123123@gmail.com",
|
||||
uuid: "TRIZ3XV4JJFRXJ3BARILLTUA6E",
|
||||
domain: "https://my.1password.com/",
|
||||
},
|
||||
vaults: [
|
||||
{
|
||||
attrs: {
|
||||
uuid: "pqcgbqjxr4tng2hsqt5ffrgwju",
|
||||
desc: "Just test entries",
|
||||
avatar: "ke7i5rxnjrh3tj6uesstcosspu.png",
|
||||
name: "T's Test Vault",
|
||||
type: "U",
|
||||
},
|
||||
items: [
|
||||
{
|
||||
uuid: "qpdsrgpngzud3x3rbfvyrz3ane",
|
||||
favIndex: 0,
|
||||
createdAt: 1619465796,
|
||||
updatedAt: 1619465869,
|
||||
trashed: false,
|
||||
categoryUuid: "005",
|
||||
details: {
|
||||
loginFields: [],
|
||||
notesPlain: "SuperSecret Password Notes",
|
||||
sections: [],
|
||||
passwordHistory: [],
|
||||
password: "GBq[AGb]4*Si3tjwuab^",
|
||||
},
|
||||
overview: {
|
||||
subtitle: "April 26, 2021 2:36 PM",
|
||||
urls: [
|
||||
{
|
||||
label: "website",
|
||||
url: "https://n0t.y0ur.n0rm4l.w3bs1t3",
|
||||
},
|
||||
],
|
||||
title: "SuperSecret Password",
|
||||
url: "https://n0t.y0ur.n0rm4l.w3bs1t3",
|
||||
ps: 100,
|
||||
pbe: 127.500786,
|
||||
pgrng: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -1,209 +0,0 @@
|
||||
import { ExportData } from "@/jslib/common/src/importers/onepasswordImporters/types/onepassword1PuxImporterTypes";
|
||||
|
||||
export const RewardsProgramData: ExportData = {
|
||||
accounts: [
|
||||
{
|
||||
attrs: {
|
||||
accountName: "1Password Customer",
|
||||
name: "1Password Customer",
|
||||
avatar: "",
|
||||
email: "username123123123@gmail.com",
|
||||
uuid: "TRIZ3XV4JJFRXJ3BARILLTUA6E",
|
||||
domain: "https://my.1password.com/",
|
||||
},
|
||||
vaults: [
|
||||
{
|
||||
attrs: {
|
||||
uuid: "pqcgbqjxr4tng2hsqt5ffrgwju",
|
||||
desc: "Just test entries",
|
||||
avatar: "ke7i5rxnjrh3tj6uesstcosspu.png",
|
||||
name: "T's Test Vault",
|
||||
type: "U",
|
||||
},
|
||||
items: [
|
||||
{
|
||||
uuid: "3bmrdcml3tngvsr6zdlvd2xo4i",
|
||||
favIndex: 0,
|
||||
createdAt: 1619467659,
|
||||
updatedAt: 1619467765,
|
||||
trashed: false,
|
||||
categoryUuid: "107",
|
||||
details: {
|
||||
loginFields: [],
|
||||
notesPlain: "My Reward Card",
|
||||
sections: [
|
||||
{
|
||||
title: "",
|
||||
fields: [
|
||||
{
|
||||
title: "company name",
|
||||
id: "company_name",
|
||||
value: {
|
||||
string: "Super Cool Store Co.",
|
||||
},
|
||||
indexAtSource: 0,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "member name",
|
||||
id: "member_name",
|
||||
value: {
|
||||
string: "Chef Coldroom",
|
||||
},
|
||||
indexAtSource: 1,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "member ID",
|
||||
id: "membership_no",
|
||||
value: {
|
||||
string: "member-29813569",
|
||||
},
|
||||
indexAtSource: 2,
|
||||
guarded: false,
|
||||
clipboardFilter:
|
||||
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "no",
|
||||
capitalization: "none",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "PIN",
|
||||
id: "pin",
|
||||
value: {
|
||||
concealed: "99913",
|
||||
},
|
||||
indexAtSource: 3,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "numberPad",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "More Information",
|
||||
name: "extra",
|
||||
fields: [
|
||||
{
|
||||
title: "member ID (additional)",
|
||||
id: "additional_no",
|
||||
value: {
|
||||
string: "additional member id",
|
||||
},
|
||||
indexAtSource: 0,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "no",
|
||||
capitalization: "none",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "member since",
|
||||
id: "member_since",
|
||||
value: {
|
||||
monthYear: 202101,
|
||||
},
|
||||
indexAtSource: 1,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "customer service phone",
|
||||
id: "customer_service_phone",
|
||||
value: {
|
||||
phone: "123456",
|
||||
},
|
||||
indexAtSource: 2,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "namePhonePad",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "phone for reservations",
|
||||
id: "reservations_phone",
|
||||
value: {
|
||||
phone: "123456",
|
||||
},
|
||||
indexAtSource: 3,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "namePhonePad",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "website",
|
||||
id: "website",
|
||||
value: {
|
||||
url: "supercoolstore.com",
|
||||
},
|
||||
indexAtSource: 4,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
passwordHistory: [],
|
||||
},
|
||||
overview: {
|
||||
subtitle: "Super Cool Store Co.",
|
||||
title: "Retail Reward Thing",
|
||||
url: "",
|
||||
ps: 0,
|
||||
pbe: 0.0,
|
||||
pgrng: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -1,89 +0,0 @@
|
||||
import { ExportData } from "@/jslib/common/src/importers/onepasswordImporters/types/onepassword1PuxImporterTypes";
|
||||
|
||||
export const SSNData: ExportData = {
|
||||
accounts: [
|
||||
{
|
||||
attrs: {
|
||||
accountName: "1Password Customer",
|
||||
name: "1Password Customer",
|
||||
avatar: "",
|
||||
email: "username123123123@gmail.com",
|
||||
uuid: "TRIZ3XV4JJFRXJ3BARILLTUA6E",
|
||||
domain: "https://my.1password.com/",
|
||||
},
|
||||
vaults: [
|
||||
{
|
||||
attrs: {
|
||||
uuid: "pqcgbqjxr4tng2hsqt5ffrgwju",
|
||||
desc: "Just test entries",
|
||||
avatar: "ke7i5rxnjrh3tj6uesstcosspu.png",
|
||||
name: "T's Test Vault",
|
||||
type: "U",
|
||||
},
|
||||
items: [
|
||||
{
|
||||
uuid: "vi2biozc7sjnhr5sejk74nz26i",
|
||||
favIndex: 1,
|
||||
createdAt: 1619467910,
|
||||
updatedAt: 1619467982,
|
||||
trashed: false,
|
||||
categoryUuid: "108",
|
||||
details: {
|
||||
loginFields: [],
|
||||
notesPlain: "My SSN",
|
||||
sections: [
|
||||
{
|
||||
title: "",
|
||||
fields: [
|
||||
{
|
||||
title: "name",
|
||||
id: "name",
|
||||
value: {
|
||||
string: "Jack Judd",
|
||||
},
|
||||
indexAtSource: 0,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: false,
|
||||
inputTraits: {
|
||||
keyboard: "default",
|
||||
correction: "default",
|
||||
capitalization: "words",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "number",
|
||||
id: "number",
|
||||
value: {
|
||||
concealed: "131-216-1900",
|
||||
},
|
||||
indexAtSource: 1,
|
||||
guarded: false,
|
||||
multiline: false,
|
||||
dontGenerate: true,
|
||||
inputTraits: {
|
||||
keyboard: "numbersAndPunctuation",
|
||||
correction: "default",
|
||||
capitalization: "default",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
passwordHistory: [],
|
||||
},
|
||||
overview: {
|
||||
subtitle: "Jack Judd",
|
||||
title: "SSN",
|
||||
url: "",
|
||||
ps: 0,
|
||||
pbe: 0.0,
|
||||
pgrng: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user