Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Add Vault class #222

Draft
wants to merge 34 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
ca3b0b7
feat: add `Vault` class
danroc Apr 19, 2023
31759e8
chore: add `uuid` dependency
danroc Apr 19, 2023
c79f1eb
chore: add `Vault` to `index.ts`
danroc Apr 19, 2023
d433362
chore: upgrade jest version
danroc Apr 19, 2023
34731eb
chore: bump dependencies
danroc Apr 19, 2023
8bb1690
refactor: simplify `Vault` API
danroc Apr 19, 2023
65892b0
chore: fix linting warning
danroc Apr 19, 2023
df1eafc
test: add unit test to `deriveWrappingKey` function
danroc Apr 19, 2023
b192f1c
test: add unit tests
danroc Apr 20, 2023
edf6272
feat: add method to verify password
danroc Apr 20, 2023
8d9add9
chore: add base64 functions and small code refactors
danroc Apr 20, 2023
3957c05
refactor: move `ensureNotNull()` to getter methods
danroc Apr 21, 2023
25e899e
chore: remove TODOs
danroc Apr 21, 2023
4f032c6
test: add more negative tests
danroc Apr 21, 2023
55b749a
chore: add a few comments
danroc Apr 21, 2023
242302e
feat: add `rekey` and `changePassword` methods
danroc Apr 24, 2023
8902205
feat: add methods to serialize and deserialize a vault
danroc Apr 25, 2023
18e2921
refactor: factorize encode/decode state methods
danroc Apr 25, 2023
f5b01be
fix: prevent a vault from being initialized twice
danroc Apr 25, 2023
7ef0c7e
chore: add constructor documentation
danroc Apr 25, 2023
80ce672
refactor: make `init` private and replace it by unlock
danroc Apr 25, 2023
66533ec
chore: add vault format version
danroc Apr 26, 2023
97eb09c
chore: import crypto module (wip)
danroc Apr 26, 2023
71d886b
chore: don't test with node 14
danroc Apr 26, 2023
4fe9585
chore: increase tests timeout value
danroc Apr 27, 2023
4c9c358
feat: validate vault state
danroc Apr 27, 2023
81e11c6
feat: check other vault properties
danroc Apr 27, 2023
cdb73d3
fix: don't use deprecated functions (sonarlint)
danroc May 25, 2023
aa65f31
chore: stop error message from polluting console
danroc May 25, 2023
9d4a0db
chore: rename `uuidv4` variable to `uuid`
danroc May 25, 2023
410917f
chore: remove unnecessary linter-ignore comment
danroc May 25, 2023
51fcc41
chore: simplify function
danroc May 25, 2023
e3bf15b
fix: make wrapping key not extractable
danroc May 25, 2023
896adb0
chore: rename master key handler variable name
danroc May 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- prepare
strategy:
matrix:
node-version: [14.x, 16.x, 18.x, 19.x]
node-version: [16.x, 18.x, 19.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -49,7 +49,7 @@ jobs:
- prepare
strategy:
matrix:
node-version: [14.x, 16.x, 18.x, 19.x]
node-version: [16.x, 18.x, 19.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
- prepare
strategy:
matrix:
node-version: [14.x, 16.x, 18.x, 19.x]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this break node14? In either case: Separate change.

node-version: [16.x, 18.x, 19.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ module.exports = {
restoreMocks: true,
testEnvironment: 'node',
testRegex: ['\\.test\\.(ts|js)$'],
testTimeout: 2500,
testTimeout: 5000,
};
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,13 @@
"@metamask/eth-hd-keyring": "^6.0.0",
"@metamask/eth-sig-util": "5.0.2",
"@metamask/eth-simple-keyring": "^5.0.0",
"@metamask/utils": "^5.0.0",
"obs-store": "^4.0.3"
"@metamask/utils": "^5.0.1",
"@types/node": "^18.16.1",
"@types/uuid": "^9.0.1",
"ajv": "^8.12.0",
"ajv-formats": "^2.1.1",
"obs-store": "^4.0.3",
"uuid": "^9.0.0"
},
"devDependencies": {
"@lavamoat/allow-scripts": "^2.1.0",
Expand All @@ -62,7 +67,7 @@
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.2.1",
"ethereumjs-wallet": "^1.0.1",
"jest": "^29.0.0",
"jest": "^29.5.0",
"prettier": "^2.8.1",
"prettier-plugin-packagejson": "^2.3.0",
"sinon": "^15.0.1",
Expand Down
Loading