Skip to content

Commit

Permalink
deps: tuf-js@1.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar committed May 17, 2023
1 parent f6a0884 commit afb936c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 7 deletions.
1 change: 1 addition & 0 deletions DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,7 @@ graph LR;
tar-->minizlib;
tar-->mkdirp;
tar-->yallist;
tuf-js-->debug;
tuf-js-->make-fetch-happen;
tuf-js-->tufjs-models["@tufjs/models"];
tufjs-models-->minimatch;
Expand Down
3 changes: 3 additions & 0 deletions node_modules/tuf-js/dist/fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DefaultFetcher = exports.BaseFetcher = void 0;
const debug_1 = __importDefault(require("debug"));
const fs_1 = __importDefault(require("fs"));
const make_fetch_happen_1 = __importDefault(require("make-fetch-happen"));
const util_1 = __importDefault(require("util"));
const error_1 = require("./error");
const tmpfile_1 = require("./utils/tmpfile");
const log = (0, debug_1.default)('tuf:fetch');
class BaseFetcher {
// Download file from given URL. The file is downloaded to a temporary
// location and then passed to the given handler. The handler is responsible
Expand Down Expand Up @@ -58,6 +60,7 @@ class DefaultFetcher extends BaseFetcher {
this.retries = options.retries;
}
async fetch(url) {
log('GET %s', url);
const response = await (0, make_fetch_happen_1.default)(url, {
timeout: this.timeout,
retry: this.retries,
Expand Down
8 changes: 8 additions & 0 deletions node_modules/tuf-js/dist/updater.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Updater = void 0;
const models_1 = require("@tufjs/models");
const debug_1 = __importDefault(require("debug"));
const fs = __importStar(require("fs"));
const path = __importStar(require("path"));
const config_1 = require("./config");
const error_1 = require("./error");
const fetcher_1 = require("./fetcher");
const store_1 = require("./store");
const url = __importStar(require("./utils/url"));
const log = (0, debug_1.default)('tuf:cache');
class Updater {
constructor(options) {
const { metadataDir, metadataBaseUrl, targetDir, targetBaseUrl, fetcher, config, } = options;
Expand Down Expand Up @@ -86,6 +91,7 @@ class Updater {
// Verify hashes and length of downloaded file
await targetInfo.verify(fs.createReadStream(fileName));
// Copy file to target path
log('WRITE %s', targetPath);
fs.copyFileSync(fileName, targetPath);
});
return targetPath;
Expand All @@ -107,6 +113,7 @@ class Updater {
}
loadLocalMetadata(fileName) {
const filePath = path.join(this.dir, `${fileName}.json`);
log('READ %s', filePath);
return fs.readFileSync(filePath);
}
// Sequentially load and persist on local disk every newer root metadata
Expand Down Expand Up @@ -300,6 +307,7 @@ class Updater {
async persistMetadata(metaDataName, bytesData) {
try {
const filePath = path.join(this.dir, `${metaDataName}.json`);
log('WRITE %s', filePath);
fs.writeFileSync(filePath, bytesData.toString('utf8'));
}
catch (error) {
Expand Down
10 changes: 6 additions & 4 deletions node_modules/tuf-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tuf-js",
"version": "1.1.5",
"version": "1.1.6",
"description": "JavaScript implementation of The Update Framework (TUF)",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -29,14 +29,16 @@
"homepage": "https://github.com/theupdateframework/tuf-js/tree/main/packages/client#readme",
"devDependencies": {
"@tufjs/repo-mock": "1.3.1",
"@types/debug": "^4.1.7",
"@types/make-fetch-happen": "^10.0.1",
"@types/node": "^18.16.3",
"@types/node": "^20.1.1",
"nock": "^13.3.1",
"typescript": "^5.0.4"
},
"dependencies": {
"make-fetch-happen": "^11.1.0",
"@tufjs/models": "1.0.4"
"@tufjs/models": "1.0.4",
"debug": "^4.3.4",
"make-fetch-happen": "^11.1.0"
},
"engines": {
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
Expand Down
7 changes: 4 additions & 3 deletions package-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -14518,12 +14518,13 @@
}
},
"node_modules/tuf-js": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/tuf-js/-/tuf-js-1.1.5.tgz",
"integrity": "sha512-inqodgxdsmuxrtQVbu6tPNgRKWD1Boy3VB6GO7KczJZpAHiTukwhSzXUSzvDcw5pE2Jo8ua+e1ykpHv7VdPVlQ==",
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/tuf-js/-/tuf-js-1.1.6.tgz",
"integrity": "sha512-CXwFVIsXGbVY4vFiWF7TJKWmlKJAT8TWkH4RmiohJRcDJInix++F0dznDmoVbtJNzZ8yLprKUG4YrDIhv3nBMg==",
"inBundle": true,
"dependencies": {
"@tufjs/models": "1.0.4",
"debug": "^4.3.4",
"make-fetch-happen": "^11.1.0"
},
"engines": {
Expand Down

0 comments on commit afb936c

Please sign in to comment.