Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
12e43fa
* Replace all usages of the bitcoinjs-lib crypto export with node.js …
zone117x Sep 5, 2019
cf36da5
Specify the import used from the triplesec dependency, note a TODO ab…
zone117x Sep 6, 2019
59f3498
Import only what is used from the `bip39` module. Note direct usage o…
zone117x Sep 6, 2019
51b8d11
Update toolchain: typescript, webpack, babel, linters, etc
zone117x Sep 6, 2019
22f5ea6
Enable stricter linter rules with typechecking capabilities
zone117x Sep 6, 2019
f5a1b83
Improve very slow build process with "run-parallel npm command" util,…
zone117x Sep 9, 2019
981ba66
Merge branch 'develop' into feature/crypto-isolation
zone117x Oct 2, 2019
b26c4a7
Lint and type error fixes
zone117x Oct 2, 2019
da846e0
Replace all hash and hmac digest calls with promise based module (wra…
zone117x Oct 2, 2019
de6deb1
Refactor aes cipher usage into isolated module with async signatures
zone117x Oct 3, 2019
b43e5d3
Refactor pbkd2 usage into isolated module with async signatures
zone117x Oct 3, 2019
e5c7e8d
WebCrypto implementation of sha2 functions, detected during runtime.
zone117x Oct 4, 2019
0f8e1d0
Move ripemd160-min to separate lib
zone117x Oct 4, 2019
9db6fe9
WebCrypto implementation for hmac
zone117x Oct 4, 2019
eef0c6f
Use tslib for reduced compilation output size
zone117x Oct 4, 2019
ea4de12
WebCrypto implementation for AES cipher
zone117x Oct 4, 2019
757f10a
Update ripemd160 hash usage
zone117x Oct 4, 2019
ca08175
* WebCrypto implementation for pbkdf2.
zone117x Oct 4, 2019
5a2b2bf
* Exclude node crypto from webpack dist bundle.
zone117x Oct 4, 2019
2d7f481
Make triplesec an external dependency
zone117x Oct 4, 2019
8dede3c
Make cheerio (used only in profile server validation) an external dep…
zone117x Oct 4, 2019
518ca14
Disable babel esmodule transforms -- webpack performs better tree sha…
zone117x Oct 14, 2019
f4b2e71
Add tsconfig for unit test src
zone117x Oct 15, 2019
044f64e
Move cheerio into devDependecy -- consumer apps using profile validat…
zone117x Oct 15, 2019
5ba9759
Merge branch 'develop' into feature/crypto-isolation
zone117x Oct 15, 2019
85d7d36
Update to jsontokens v3 which has no dependencies on node.js crypto f…
zone117x Oct 16, 2019
99ab0d6
Do not require triplesec type dependency
zone117x Oct 17, 2019
52e2b88
Merge branch 'develop' into feature/w3c-crypto
zone117x Oct 21, 2019
b2bcc07
Add unit tests for precise pbkdf2 derivation result validation using …
zone117x Oct 21, 2019
884f7fc
Fix implicit-any type errors in unit test src
zone117x Nov 4, 2019
eb5789d
Fix `@types/bn.js` export causing issues with consumer libs
zone117x Nov 5, 2019
5d38e8e
Replace `shx rm` with `rimraf`, add typechecking to unit testing script
zone117x Nov 5, 2019
4f99129
Minor package updates
zone117x Nov 5, 2019
0e0a60c
TODO note in `bn.ts`
zone117x Nov 5, 2019
cd0dbfc
TODO note in `bn.ts` #2
zone117x Nov 5, 2019
db7b5d0
Use `jsontokens` prelease npm package rather than github repo
zone117x Nov 5, 2019
5e9f4d3
Minor perf opt -- remove redundant bip39 operations
zone117x Nov 5, 2019
c0fe76b
Fix git dependency in package-lock.json
zone117x Nov 5, 2019
aafae4f
Add "files" to package.json - attempt to fix yarn git install
zone117x Nov 5, 2019
9b756ae
Revert "Add "files" to package.json - attempt to fix yarn git install"
zone117x Nov 5, 2019
9cf6973
Expand supported types for helpers in `keys.ts`
zone117x Nov 5, 2019
11738f0
Use proper const for base58Check address encoding
zone117x Nov 5, 2019
4aac988
Export `getLegacyAppNode` at module level
zone117x Nov 6, 2019
129319d
Set version to alpha
zone117x Nov 6, 2019
75ed18a
Public @types/randombytes
zone117x Nov 6, 2019
90390ba
Version bump
zone117x Nov 6, 2019
ea0d13d
Move EC key operations out of general `utils.ts` and into `keys.ts`
zone117x Nov 6, 2019
15b5d8f
Correct comment description for `decryptMnemonic`
zone117x Nov 6, 2019
0b8bd4b
Remove `proofType` field from social validation return function
zone117x Nov 6, 2019
0a608b6
Test falling back to the browserify pbkdf2 lib for older browsers tha…
zone117x Nov 13, 2019
f96ddd8
W3C hmac param fix for Edge browser
zone117x Nov 13, 2019
004b98a
Unit tests for pbkdf2 methods
zone117x Nov 13, 2019
e146541
Switch all encryption modules usage of `TypedArray` to `Buffer` for n…
zone117x Nov 13, 2019
c274090
Use Node `crypto` module for ripemd160 if available
zone117x Nov 13, 2019
d213ed8
Faster async pbkdf2 polyfill for Edge browser
zone117x Nov 13, 2019
79c0009
Faster async pbkdf2 polyfill for Edge browser (using W3C hmac)
zone117x Nov 13, 2019
0926420
Integrate minimal pbkdf2 partial WebCrypto polyfill needed for browse…
zone117x Nov 14, 2019
51cc81a
Remove currently unused larger partial pbkdf2 polyfill implementation
zone117x Nov 14, 2019
6329645
Restore synchronous versions of functions that only depended on sha25…
zone117x Nov 18, 2019
f12846a
Linting fixes, revert TransactionSigner interface changes
zone117x Nov 18, 2019
d81c83f
DRY social proof services
zone117x Nov 18, 2019
2d84cf2
More unit test async/await linting fixes
zone117x Nov 18, 2019
b2ade3c
Operation tests linting fixes
zone117x Nov 18, 2019
7a1855c
Update release notes list of async function changes
zone117x Nov 18, 2019
d62be9d
Unit tests for aes-cbc encrypt and decrypt functions for both Node.js…
zone117x Nov 18, 2019
dd754eb
Unit tests for ripemd160 hash fallback
zone117x Nov 18, 2019
f662643
Sha125 and sha512 unit tests for WebCrypto, Node.js crypto, and js po…
zone117x Nov 18, 2019
e543b92
HmacSha256 unit tests
zone117x Nov 18, 2019
ddc7e01
Update changelog
zone117x Nov 18, 2019
0e02d8c
Fix bugs with auth validation in environments without global `URL` an…
zone117x Nov 19, 2019
a3bf24f
Refactor some promise-chain functions into cleaner async/await code w…
zone117x Nov 19, 2019
d7924c2
Fix bug with CDN / dist file build
zone117x Dec 4, 2019
783ccaa
Update `jsontokens` lib from beta version to stable
zone117x Dec 17, 2019
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
84 changes: 70 additions & 14 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
module.exports = {
"extends": [
"eslint:recommended",
"airbnb-base",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
"project": "./tsconfig.json",
"tsconfigRootDir": __dirname
},
"plugins": [
"import",
"@typescript-eslint"
],
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts"]
"@typescript-eslint/parser": [ ".ts" ]
},
"import/resolver": { "typescript": {} }
},
Expand All @@ -24,17 +31,15 @@ module.exports = {
"rules": {
"no-tabs": 0,
"no-restricted-globals": 0,
"import/prefer-default-export": 0,
"no-buffer-constructor": 0,
"no-mixed-operators": 0,
"no-plusplus": 0,
"no-bitwise": 0,
"prefer-promise-reject-errors": 0,
"class-methods-use-this": 0,
"import/no-cycle": 0,
"prefer-destructuring": 0,
"no-prototype-builtins": 0,
"comma-dangle": ["error", "never"],
"comma-dangle": "off",
"quotes": [2, "single"],
"eol-last": 2,
"no-debugger": 1,
Expand All @@ -55,11 +60,16 @@ module.exports = {
"object-curly-newline": "off",
"arrow-parens": "off",
"function-paren-newline": 0,
"max-classes-per-file": "off",
"prefer-object-spread": "off",
"no-multiple-empty-lines": "off",
"no-shadow": "off",
"no-use-before-define": "off",
"@typescript-eslint/indent": [2, 2, {
"FunctionDeclaration": { "parameters": "first" },
"FunctionExpression": { "parameters": "first" },
"no-return-await": "off",
"no-useless-constructor": "off",
"indent": [2, 2, {
"FunctionDeclaration" : { "parameters": "first" },
"FunctionExpression" : { "parameters": "first" },
"ObjectExpression": "first",
"ArrayExpression": "first",
"ImportDeclaration": "first",
Expand All @@ -74,15 +84,61 @@ module.exports = {
"@typescript-eslint/no-angle-bracket-type-assertion": "off",
"@typescript-eslint/prefer-interface": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-unused-vars": "off",

// TODO: enable this when reasonable
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/consistent-type-assertions": "off",
"@typescript-eslint/prefer-regexp-exec": "off",
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-misused-promises": "error",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/require-await": "error",
"@typescript-eslint/await-thenable": "error",


// TODO: enable this when reasonable
// TODO: enable these when reasonable
"@typescript-eslint/promise-function-async": "off",
"@typescript-eslint/prefer-includes": "off",
"@typescript-eslint/prefer-string-starts-ends-with": "off",
// ---


"import/no-unresolved": "error",
"import/named": "error",
"import/prefer-default-export": "off",

// TODO: enable these when reasonable -- these can help module dependencies be easier to bundle w/ tree-shaking.
"import/no-cycle": "off",
// ---

"import/no-self-import": "error",
"import/no-useless-path-segments": ["error", { noUselessIndex: true }],
"import/no-unused-modules": ["error", { "missingExports": true }],
"import/export": "error",
"import/no-extraneous-dependencies": "error",
"import/no-duplicates": "error",
"import/no-unassigned-import": "error",
"import/order": "error",

"import/no-nodejs-modules": ["error", { "allow": [

]}],

// ---- Enforce some blockstack.js specific rules ----

"no-restricted-globals": ["error", {
"name": "fetch",
"message": "Use `privateFetch` instead."
}
],

"no-restricted-modules": ["error", {
"name": "crypto",
"message": "Use a specific module from `./src/encryption/` "
}
]

// TODO: enable when this is fixed https://github.com/benmosher/eslint-plugin-import/issues/1282
"import/named": "off"
// ----
}
}
19 changes: 10 additions & 9 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "unitTests",
"args": ["${workspaceFolder}/tests/unitTests/src/index.ts"],
"runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"],
"outputCapture": "std"
}
]
{
"type": "node",
"request": "launch",
"name": "Tests",
"runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"],
"args": ["${workspaceFolder}/tests/unitTests/src/index.ts"],
"env": { "TS_NODE_PROJECT": "${workspaceFolder}/tests/unitTests/src/tsconfig.json" },
"console": "integratedTerminal"
}
]
}
8 changes: 0 additions & 8 deletions .vscode/settings.json

This file was deleted.

6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `getFile` now throws error on 404 instead of returning null.
- `getFile`, `putFile`, `deleteFile`, `listfiles` now include error info upon failure.
- `getFile` can now decrypt using a custom private key
- Several cryptographic operations now use the native Web Crypto APIs when available. This primarily
increases the performance of file encryption and decryption, and account seed phrase encryption and
decryption.
- The following functions now returns Promises: `handleSignedEncryptedContents`, `makeAuthResponse`,
`encryptECIES`, `decryptECIES`, `encryptPrivateKey`, `decryptPrivateKey`, `encryptContent`,
`decryptContent`, `aes256CbcEncrypt`, `aes256CbcDecrypt`, `hmacSha256`.

## [19.4.0] - 2019-09-03
### Changed
Expand Down
7 changes: 5 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ module.exports = function (api) {
// Babel config for web browser lib dist with wide-spread browser support.
let opts = {
presets: [
"@babel/preset-env",
"@babel/preset-typescript"
["@babel/preset-env", {
"targets": {
"esmodules": true
}
}]
],
plugins: [
"@babel/proposal-class-properties",
Expand Down
Loading