Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency cross-fetch to v3.1.5 [SECURITY] #168

Merged
merged 38 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
410472a
Update dependency cross-fetch to v3.1.5 [SECURITY]
renovate[bot] Mar 20, 2024
02d976f
test failing but good progress
aaronmgdr Mar 20, 2024
3b1a200
ge vs code debugger working again
aaronmgdr Mar 20, 2024
f2c8a53
move dev-utils from monorepo back into this repo.
aaronmgdr Mar 20, 2024
f1cd8d1
upgrade to final 1.x web3 release ever
aaronmgdr Mar 20, 2024
f6b8df7
its highly recommended to use example.com for examples and tests as i…
aaronmgdr Mar 20, 2024
1698f69
add patches
aaronmgdr Mar 20, 2024
d2f6cae
Update dependency cross-fetch to v3.1.5 [SECURITY]
renovate[bot] Mar 20, 2024
850a01d
test failing but good progress
aaronmgdr Mar 20, 2024
5d07a59
ge vs code debugger working again
aaronmgdr Mar 20, 2024
2082fd4
move dev-utils from monorepo back into this repo.
aaronmgdr Mar 20, 2024
fe6dc6c
upgrade to final 1.x web3 release ever
aaronmgdr Mar 20, 2024
abe2774
its highly recommended to use example.com for examples and tests as i…
aaronmgdr Mar 20, 2024
b31aad0
add patches
aaronmgdr Mar 20, 2024
14f40ff
add dev-utils to the repo. it makes more sense that it lives here as …
aaronmgdr Mar 20, 2024
d159db4
Merge branch 'renovate/npm-cross-fetch-vulnerability' of https://gith…
aaronmgdr Mar 20, 2024
3ef65b6
shouldnt this work?
aaronmgdr Mar 20, 2024
aeceac8
dev utils now has the same config as cli as far as i can tell but sti…
aaronmgdr Mar 21, 2024
ac81b5d
hmm still not working
aaronmgdr Mar 21, 2024
0e71aea
praise the answer was in the execution command
aaronmgdr Mar 21, 2024
697c221
note that it might be nessessary to upgrade your web3 version as well
aaronmgdr Mar 21, 2024
38f9db9
Update dependency cross-fetch to v3.1.5 [SECURITY]
renovate[bot] Mar 20, 2024
fd1e88a
test failing but good progress
aaronmgdr Mar 20, 2024
85d7d0f
ge vs code debugger working again
aaronmgdr Mar 20, 2024
15ff22f
move dev-utils from monorepo back into this repo.
aaronmgdr Mar 20, 2024
3e3069c
upgrade to final 1.x web3 release ever
aaronmgdr Mar 20, 2024
ad25055
its highly recommended to use example.com for examples and tests as i…
aaronmgdr Mar 20, 2024
08d7acb
add patches
aaronmgdr Mar 20, 2024
643f95c
add dev-utils to the repo. it makes more sense that it lives here as …
aaronmgdr Mar 20, 2024
8ada9c5
shouldnt this work?
aaronmgdr Mar 20, 2024
df99d8b
dev utils now has the same config as cli as far as i can tell but sti…
aaronmgdr Mar 21, 2024
411163d
hmm still not working
aaronmgdr Mar 21, 2024
69c6cf7
praise the answer was in the execution command
aaronmgdr Mar 21, 2024
6ccee75
note that it might be nessessary to upgrade your web3 version as well
aaronmgdr Mar 21, 2024
d53147b
commit the docs
aaronmgdr Mar 21, 2024
a0c8ef6
testing the web3 http provider receives the headers is sufficient
aaronmgdr Mar 21, 2024
0558c02
better api key is passed correctly test
aaronmgdr Mar 21, 2024
f7675ad
unneeded modification
aaronmgdr Mar 21, 2024
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
5 changes: 5 additions & 0 deletions .changeset/brave-spies-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@celo/dev-utils': patch
---

Bump web3 to 1.10.4
8 changes: 8 additions & 0 deletions .changeset/friendly-penguins-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@celo/network-utils': patch
'@celo/contractkit': patch
'@celo/explorer': patch
'@celo/celocli': patch
---

Bump Cross Fetch to fix security vulnerability
19 changes: 19 additions & 0 deletions .changeset/lemon-doors-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
'@celo/wallet-hsm-azure': patch
'@celo/wallet-hsm-aws': patch
'@celo/wallet-hsm-gcp': patch
'@celo/wallet-ledger': patch
'@celo/wallet-remote': patch
'@celo/wallet-local': patch
'@celo/wallet-base': patch
'@celo/wallet-hsm': patch
'@celo/wallet-rpc': patch
'@celo/transactions-uri': patch
'@celo/network-utils': patch
'@celo/contractkit': patch
'@celo/connect': patch
'@celo/utils': patch
'@celo/celocli': patch
---

Bump web3-\* to 1.10.4 -- Some consumers may be forced to upgrade their web3 instance to the same version
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ packages/sdk/identity/*
packages/sdk/encrypted-backup/*
packages/protocol/*
packages/celotool/*
packages/dev-utils/*
packages/metadata-crawler/*
packages/helm-charts/*
# temp json file for deploy-sdks script
Expand Down
36 changes: 2 additions & 34 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,38 +1,6 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug PhoneNumberPrivacy Combiner Tests",
"type": "node",
"request": "launch",
"runtimeArgs": [
"--inspect-brk",
"${workspaceRoot}/node_modules/.bin/jest",
"--rootDir",
"${workspaceFolder}/packages/phone-number-privacy",
"--runInBand",
"${workspaceFolder}/packages/phone-number-privacy/combiner/test/**",
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"port": 9229
},
{
"name": "Debug PhoneNumberPrivacy Signer Tests",
"type": "node",
"request": "launch",
"runtimeArgs": [
"--inspect-brk",
"${workspaceRoot}/node_modules/.bin/jest",
"--rootDir",
"${workspaceFolder}/packages/phone-number-privacy/signer",
"--runInBand",
"${workspaceFolder}/packages/phone-number-privacy/signer/test/**",
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"port": 9229
},
{
"name": "Debug ContractKit Tests",
"type": "node",
Expand All @@ -41,9 +9,9 @@
"--inspect-brk",
"${workspaceRoot}/node_modules/.bin/jest",
"--rootDir",
"${workspaceFolder}/packages/contractkit",
"${workspaceFolder}/packages/sdk/contractkit",
"--runInBand",
"${workspaceFolder}/packages/contractkit/src/**/*.test.ts",
"${workspaceFolder}/packages/sdk/contractkit/src/**/*.test.ts",
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
Expand Down
13 changes: 6 additions & 7 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"node": ">=16"
},
"scripts": {
"clean": "tsc -b . --clean",
"clean": "yarn run --top-level tsc -b . --clean",
"dev": "yarn build && ts-node ./bin/dev.js",
"build": "tsc -b .",
"build": "yarn run --top-level tsc -b .",
"docs": "./generate_docs.sh",
"lint": "yarn run --top-level eslint -c .eslintrc.js ",
"prepublish": "",
Expand Down Expand Up @@ -61,20 +61,20 @@
"bip32": "3.1.0",
"chalk": "^2.4.2",
"command-exists": "^1.2.9",
"cross-fetch": "3.0.6",
"cross-fetch": "3.1.5",
"debug": "^4.1.1",
"ethers": "5",
"fs-extra": "^8.1.0",
"humanize-duration": "^3.29.0",
"path": "^0.12.7",
"prompts": "^2.0.1",
"randombytes": "^2.0.1",
"web3": "1.10.0",
"web3-utils": "^1.10.0"
"web3": "1.10.4",
"web3-utils": "^1.10.4"
},
"devDependencies": {
"@celo/celo-devchain": "^7.0.0",
"@celo/dev-utils": "0.0.1-beta.1",
"@celo/dev-utils": "0.0.2",
"@celo/typescript": "workspace:^",
"@types/debug": "^4.1.4",
"@types/fs-extra": "^8.0.0",
Expand All @@ -83,7 +83,6 @@
"@types/ledgerhq__hw-transport-node-hid": "^4.22.2",
"@types/node": "^18.7.16",
"@types/prompts": "^1.1.1",
"@types/web3": "^1.0.18",
"jest": "^29.0.2",
"oclif": "^4.3.4",
"prettier": "1.19.1",
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/commands/account/authorize.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import Authorize from './authorize'
import Register from './register'

process.env.NO_SYNCCHECK = 'true'

testWithGanache('account:authorize cmd', (web3: Web3) => {
test('can authorize vote signer', async () => {
const accounts = await web3.eth.getAccounts()
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/account/claim-domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default class ClaimDomain extends ClaimCommand {
}
static args = ClaimCommand.args
static examples = [
'claim-domain ~/metadata.json --domain test.com --from 0x47e172F6CfB6c7D01C1574fa3E2Be7CC73269D95',
'claim-domain ~/metadata.json --domain example.com --from 0x47e172F6CfB6c7D01C1574fa3E2Be7CC73269D95',
]
self = ClaimDomain
async run() {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/account/claim-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default class ClaimStorage extends ClaimCommand {
}
static args = ClaimCommand.args
static examples = [
'claim-storage ~/metadata.json --url http://test.com/myurl --from 0x47e172F6CfB6c7D01C1574fa3E2Be7CC73269D95',
'claim-storage ~/metadata.json --url http://example.com/myurl --from 0x47e172F6CfB6c7D01C1574fa3E2Be7CC73269D95',
]
self = ClaimStorage

Expand Down
12 changes: 9 additions & 3 deletions packages/cli/src/commands/account/claims.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ testWithGanache('account metadata cmds', (web3: Web3) => {

test('account:claim-domain cmd', async () => {
generateEmptyMetadataFile()
const domain = 'test.com'
const domain = 'example.com'
await testLocally(ClaimDomain, ['--from', account, '--domain', domain, emptyFilePath])
const metadata = await readFile()
const claim = metadata.findClaim(ClaimTypes.DOMAIN)
Expand Down Expand Up @@ -84,7 +84,7 @@ testWithGanache('account metadata cmds', (web3: Web3) => {
'--from',
account,
'--url',
'https://test.com',
'https://example.com',
])
})

Expand All @@ -97,7 +97,13 @@ testWithGanache('account metadata cmds', (web3: Web3) => {

it('cannot register metadata', async () => {
await expect(
testLocally(RegisterMetadata, ['--force', '--from', account, '--url', 'https://test.com'])
testLocally(RegisterMetadata, [
'--force',
'--from',
account,
'--url',
'https://example.com',
])
).rejects.toThrow("Some checks didn't pass!")
})
})
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/releasecelo/set-account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class SetAccount extends ReleaseGoldBaseCommand {
static examples = [
'set-account --contract 0x5719118266779B58D0f9519383A4A27aA7b829E5 --property name --value mywallet',
'set-account --contract 0x5719118266779B58D0f9519383A4A27aA7b829E5 --property dataEncryptionKey --value 0x041bb96e35f9f4b71ca8de561fff55a249ddf9d13ab582bdd09a09e75da68ae4cd0ab7038030f41b237498b4d76387ae878dc8d98fd6f6db2c15362d1a3bf11216',
'set-account --contract 0x5719118266779B58D0f9519383A4A27aA7b829E5 --property metaURL --value www.test.com',
'set-account --contract 0x5719118266779B58D0f9519383A4A27aA7b829E5 --property metaURL --value www.example.com',
]

async run() {
Expand Down
3 changes: 3 additions & 0 deletions packages/dev-utils/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: '../../.eslintrc.js',
}
1 change: 1 addition & 0 deletions packages/dev-utils/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lib
3 changes: 3 additions & 0 deletions packages/dev-utils/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# packages/dev-utils

This is a `utils` package that is meant to be used as a devDependency. It's primary use case is to reuse the ganache setup currently present in `cli` and `contractkit`. Due to the way jest uses globalSetup, depending packages will still need to define their own setup/teardown files.
3 changes: 3 additions & 0 deletions packages/dev-utils/eslint.tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "./tsconfig.json"
}
39 changes: 39 additions & 0 deletions packages/dev-utils/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "@celo/dev-utils",
"version": "0.0.2",
"description": "util package for celo packages that should only be a devDependency",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"author": "Celo",
"license": "Apache-2.0",
"homepage": "https://github.com/celo-org/celo-monorepo/tree/master/packages/dev-utils",
"repository": "https://github.com/celo-org/celo-monorepo/tree/master/packages/dev-utils",
"keywords": [
"celo"
],
"files": [
"lib/*"
],
"scripts": {
"build": "yarn run --top-level tsc -b .",
"lint": "yarn run --top-level eslint -c .eslintrc.js ",
"prepack": "yarn build"
},
"dependencies": {
"bignumber.js": "^9.0.0",
"fs-extra": "^8.1.0",
"ganache": "npm:@celo/ganache@7.8.0-unofficial.0",
"targz": "^1.0.1",
"tmp": "^0.1.0",
"web3": "1.10.4",
"web3-core-helpers": "1.10.4"
},
"devDependencies": {
"@tsconfig/recommended": "^1.0.3",
"@types/fs-extra": "^8.1.0",
"@types/targz": "1.0.0"
},
"engines": {
"node": ">=18.14.2"
}
}
9 changes: 9 additions & 0 deletions packages/dev-utils/src/describeEach.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export interface TestCase {
label: string
}

export function describeEach<T extends TestCase>(testCases: T[], fn: (testCase: T) => void) {
for (const testCase of testCases) {
describe(testCase.label, () => fn(testCase))
}
}
Loading
Loading