From 8eb8520dd3cfa4b7a526578d5f020c31cdbee97c Mon Sep 17 00:00:00 2001 From: Gus Narea Date: Thu, 5 Sep 2024 19:54:34 +0100 Subject: [PATCH 1/2] fix(deps): Upgrade dohdec to v6 See: https://github.com/hildjj/dohdec/pull/38 This replaces my fork. --- package-lock.json | 109 +++++++++++++++++++++++++++++++--------------- package.json | 2 +- 2 files changed, 74 insertions(+), 37 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2c570f1d..aca96138 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,7 @@ "@types/jest": "^29.5.11", "@typescript-eslint/parser": "^5.61.0", "del-cli": "^5.1.0", - "dohdec": "https://gitpkg.now.sh/hildjj/dohdec/pkg/dohdec?acd49694a83825a461bdff55e4a4a63ca7a4bbef", + "dohdec": "^6.0.0", "eslint": "^8.56.0", "jest": "^29.7.0", "jest-date-mock": "^1.0.8", @@ -6260,9 +6260,9 @@ } }, "node_modules/dns-packet": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.4.0.tgz", - "integrity": "sha512-EgqGeaBB8hLiHLZtp/IbaDQTL8pZ0+IvwzSHA6d7VyMDM+B9hgddEMa9xjK5oYnw0ci0JQ6g2XCD7/f6cafU6g==", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.6.1.tgz", + "integrity": "sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw==", "dev": true, "dependencies": { "@leichtgewicht/ip-codec": "^2.0.1" @@ -6284,20 +6284,19 @@ } }, "node_modules/dohdec": { - "version": "5.0.3", - "resolved": "https://gitpkg.now.sh/hildjj/dohdec/pkg/dohdec?acd49694a83825a461bdff55e4a4a63ca7a4bbef", - "integrity": "sha512-2FTe2EXSwtbWmnCR+x1iDTkQUCvIYMGNkvO5t6GYjo653eybJ4J9WQhAK1NBscnHksjkYQlryEJ5KFZYe84N0g==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/dohdec/-/dohdec-6.0.0.tgz", + "integrity": "sha512-UNWRVBZiUoS4/vyBqXe8nhi9Th1z8ndbaI2NkIJjqQJ/lrkazaZDStfc+QU1UmO2O9tGazg8u7smtTsVghD9jg==", "dev": true, - "license": "MPL-2.0", "dependencies": { "crypto-random-string": "^5.0.0", - "dns-packet": "^5.4.0", + "dns-packet": "^5.6.1", "got": "^11.8.2", - "ip": "^1.1.8", - "nofilter": "^3.1.0" + "ip-address": "9.0.5", + "nofilter": "^5.0.0" }, "engines": { - "node": ">=14.20" + "node": ">=18" } }, "node_modules/dom-accessibility-api": { @@ -8653,10 +8652,23 @@ "node": ">= 0.4" } }, - "node_modules/ip": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz", - "integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==", + "node_modules/ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "dev": true, + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/ip-address/node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", "dev": true }, "node_modules/is-arguments": { @@ -10239,6 +10251,12 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", + "dev": true + }, "node_modules/jsdoc-type-pratt-parser": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-3.1.0.tgz", @@ -11492,12 +11510,12 @@ "dev": true }, "node_modules/nofilter": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/nofilter/-/nofilter-3.1.0.tgz", - "integrity": "sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nofilter/-/nofilter-5.0.0.tgz", + "integrity": "sha512-t5PiB0P6M+dzmlnRC9RG/4+dhWaCA3a1D7aoQHjWdmy9Swz8F1VyKVIIE9WylG1ZZGVFHKLnzJytuIb/k+WnKw==", "dev": true, "engines": { - "node": ">=12.19" + "node": ">=18" } }, "node_modules/normalize-package-data": { @@ -19861,9 +19879,9 @@ } }, "dns-packet": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.4.0.tgz", - "integrity": "sha512-EgqGeaBB8hLiHLZtp/IbaDQTL8pZ0+IvwzSHA6d7VyMDM+B9hgddEMa9xjK5oYnw0ci0JQ6g2XCD7/f6cafU6g==", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.6.1.tgz", + "integrity": "sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw==", "dev": true, "requires": { "@leichtgewicht/ip-codec": "^2.0.1" @@ -19879,15 +19897,16 @@ } }, "dohdec": { - "version": "https://gitpkg.now.sh/hildjj/dohdec/pkg/dohdec?acd49694a83825a461bdff55e4a4a63ca7a4bbef", - "integrity": "sha512-2FTe2EXSwtbWmnCR+x1iDTkQUCvIYMGNkvO5t6GYjo653eybJ4J9WQhAK1NBscnHksjkYQlryEJ5KFZYe84N0g==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/dohdec/-/dohdec-6.0.0.tgz", + "integrity": "sha512-UNWRVBZiUoS4/vyBqXe8nhi9Th1z8ndbaI2NkIJjqQJ/lrkazaZDStfc+QU1UmO2O9tGazg8u7smtTsVghD9jg==", "dev": true, "requires": { "crypto-random-string": "^5.0.0", - "dns-packet": "^5.4.0", + "dns-packet": "^5.6.1", "got": "^11.8.2", - "ip": "^1.1.8", - "nofilter": "^3.1.0" + "ip-address": "9.0.5", + "nofilter": "^5.0.0" } }, "dom-accessibility-api": { @@ -21607,11 +21626,23 @@ "side-channel": "^1.0.4" } }, - "ip": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz", - "integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==", - "dev": true + "ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "dev": true, + "requires": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "dependencies": { + "sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", + "dev": true + } + } }, "is-arguments": { "version": "1.1.1", @@ -22775,6 +22806,12 @@ "argparse": "^2.0.1" } }, + "jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", + "dev": true + }, "jsdoc-type-pratt-parser": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-3.1.0.tgz", @@ -23629,9 +23666,9 @@ "dev": true }, "nofilter": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/nofilter/-/nofilter-3.1.0.tgz", - "integrity": "sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nofilter/-/nofilter-5.0.0.tgz", + "integrity": "sha512-t5PiB0P6M+dzmlnRC9RG/4+dhWaCA3a1D7aoQHjWdmy9Swz8F1VyKVIIE9WylG1ZZGVFHKLnzJytuIb/k+WnKw==", "dev": true }, "normalize-package-data": { diff --git a/package.json b/package.json index 84662ce8..54b79dd0 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "@types/jest": "^29.5.11", "@typescript-eslint/parser": "^5.61.0", "del-cli": "^5.1.0", - "dohdec": "https://gitpkg.now.sh/hildjj/dohdec/pkg/dohdec?acd49694a83825a461bdff55e4a4a63ca7a4bbef", + "dohdec": "^6.0.0", "eslint": "^8.56.0", "jest": "^29.7.0", "jest-date-mock": "^1.0.8", From 5f0551a40e9e80fa25fd5054670d627536c2ef44 Mon Sep 17 00:00:00 2001 From: Gus Narea Date: Fri, 6 Sep 2024 13:36:25 +0100 Subject: [PATCH 2/2] fix --- package-lock.json | 14 +++++++------- package.json | 2 +- src/integration_tests/retrieval.test.ts | 24 ++++++++++++------------ 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/package-lock.json b/package-lock.json index aca96138..e6a852eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,7 @@ "@types/jest": "^29.5.11", "@typescript-eslint/parser": "^5.61.0", "del-cli": "^5.1.0", - "dohdec": "^6.0.0", + "dohdec": "^6.0.1", "eslint": "^8.56.0", "jest": "^29.7.0", "jest-date-mock": "^1.0.8", @@ -6284,9 +6284,9 @@ } }, "node_modules/dohdec": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/dohdec/-/dohdec-6.0.0.tgz", - "integrity": "sha512-UNWRVBZiUoS4/vyBqXe8nhi9Th1z8ndbaI2NkIJjqQJ/lrkazaZDStfc+QU1UmO2O9tGazg8u7smtTsVghD9jg==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/dohdec/-/dohdec-6.0.1.tgz", + "integrity": "sha512-ducnSUkW1VJmxpWO1YkYYdWuFcav9wreDP5Fj0dkwwBDZgara8qzSVKTDTNoLEx5usPHHr+crIjMG41nElMfpQ==", "dev": true, "dependencies": { "crypto-random-string": "^5.0.0", @@ -19897,9 +19897,9 @@ } }, "dohdec": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/dohdec/-/dohdec-6.0.0.tgz", - "integrity": "sha512-UNWRVBZiUoS4/vyBqXe8nhi9Th1z8ndbaI2NkIJjqQJ/lrkazaZDStfc+QU1UmO2O9tGazg8u7smtTsVghD9jg==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/dohdec/-/dohdec-6.0.1.tgz", + "integrity": "sha512-ducnSUkW1VJmxpWO1YkYYdWuFcav9wreDP5Fj0dkwwBDZgara8qzSVKTDTNoLEx5usPHHr+crIjMG41nElMfpQ==", "dev": true, "requires": { "crypto-random-string": "^5.0.0", diff --git a/package.json b/package.json index 54b79dd0..557344e4 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "@types/jest": "^29.5.11", "@typescript-eslint/parser": "^5.61.0", "del-cli": "^5.1.0", - "dohdec": "^6.0.0", + "dohdec": "^6.0.1", "eslint": "^8.56.0", "jest": "^29.7.0", "jest-date-mock": "^1.0.8", diff --git a/src/integration_tests/retrieval.test.ts b/src/integration_tests/retrieval.test.ts index e8f442af..41c4ba54 100644 --- a/src/integration_tests/retrieval.test.ts +++ b/src/integration_tests/retrieval.test.ts @@ -1,4 +1,5 @@ import { DNSoverHTTPS } from 'dohdec'; +import type { DOH_LookupOptions as DohLookupOptions } from 'dohdec/types/doh.js'; import type { Resolver } from '../lib/Resolver.js'; import { Question } from '../lib/utils/dns/Question.js'; @@ -27,18 +28,17 @@ async function retryUponFailure( } } -const RESOLVER: Resolver = async (question) => - (await retryUponFailure( - async () => - DOH_CLIENT.lookup(question.name, { - rrtype: question.getTypeName(), - json: false, - decode: false, - dnssec: true, // Retrieve RRSig records - dnssecCheckingDisabled: true, - }), - 3, - )) as Promise; +const RESOLVER: Resolver = async (question) => { + const options: DohLookupOptions = { + rrtype: question.getTypeName(), + json: false, + decode: false, + dnssec: true, // Retrieve RRSig records + dnssecCheckingDisabled: true, + }; + const lookUp = async () => DOH_CLIENT.lookup(question.name, options) as Promise; + return retryUponFailure(lookUp, 3); +}; test('Positive response in valid DNSSEC zone should be SECURE', async () => { const question = new Question('dnssec-deployment.org.', 'A');