Skip to content

Commit

Permalink
chore: consistency core dependencies (verdaccio#2878)
Browse files Browse the repository at this point in the history
* chore: group patch minor updates

* chore: use node 16 instead 14

* fix types

* fix types
  • Loading branch information
juanpicado authored Jan 9, 2022
1 parent 59435a9 commit 9b8d0bb
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 76 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@types/lodash": "4.14.178",
"@types/mime": "2.0.3",
"@types/minimatch": "3.0.5",
"@types/node": "14.6.0",
"@types/node": "16.11.19",
"@types/request": "2.48.8",
"@types/semver": "7.3.9",
"@types/supertest": "2.0.11",
Expand Down Expand Up @@ -89,7 +89,7 @@
"kleur": "3.0.3",
"lint-staged": "11.2.6",
"nock": "12.0.3",
"node-fetch": "3.0.0-beta.6-exportfix",
"node-fetch": "cjs",
"nodemon": "2.0.15",
"npm-run-all": "4.1.5",
"prettier": "2.3.2",
Expand Down
11 changes: 6 additions & 5 deletions packages/auth/src/legacy-token.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
HexBase64BinaryEncoding,
Utf8AsciiBinaryEncoding,
BinaryToTextEncoding,
CharacterEncoding,
createCipheriv,
createDecipheriv,
randomBytes,
Expand All @@ -12,8 +12,8 @@ import { TOKEN_VALID_LENGTH } from '@verdaccio/config';
const debug = buildDebug('verdaccio:auth:token:legacy');

export const defaultAlgorithm = process.env.VERDACCIO_LEGACY_ALGORITHM || 'aes-256-ctr';
const inputEncoding: Utf8AsciiBinaryEncoding = 'utf8';
const outputEncoding: HexBase64BinaryEncoding = 'hex';
const inputEncoding: CharacterEncoding = 'utf8';
const outputEncoding: BinaryToTextEncoding = 'hex';
// For AES, this is always 16
const IV_LENGTH = 16;
// Must be 256 bits (32 characters)
Expand Down Expand Up @@ -56,7 +56,8 @@ export function aesDecrypt(value: string, key: string): string | void {
const secretKey = VERDACCIO_LEGACY_ENCRYPTION_KEY || key;
// decipher the string
const decipher = createDecipheriv(defaultAlgorithm, secretKey, IV);
let decrypted = decipher.update(encryptedText, outputEncoding, inputEncoding);
// FIXME: fix type here should allow Buffer
let decrypted = decipher.update(encryptedText as any, outputEncoding, inputEncoding);
decrypted += decipher.final(inputEncoding);
debug('token decrypted successfully');
return decrypted.toString();
Expand Down
2 changes: 1 addition & 1 deletion packages/core/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"build": "exit 0"
},
"devDependencies": {
"@types/node": "14.6.0",
"@types/node": "16.11.19",
"tsd": "0.19.1"
},
"funding": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/audit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"express": "4.17.2",
"body-parser": "1.19.1",
"https-proxy-agent": "5.0.0",
"node-fetch": "3.0.0-beta.6-exportfix"
"node-fetch": "cjs"
},
"devDependencies": {
"@verdaccio/types": "workspace:11.0.0-6-next.10",
Expand Down
2 changes: 1 addition & 1 deletion packages/tools/benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"devDependencies": {
"autocannon": "7.5.1",
"node-fetch": "3.0.0-beta.6-exportfix",
"node-fetch": "cjs",
"ts-node": "10.4.0"
}
}
84 changes: 18 additions & 66 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9b8d0bb

Please sign in to comment.