Skip to content

Commit 5786b89

Browse files
committed
deps: npm update
1 parent e21be4c commit 5786b89

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+1924
-1719
lines changed

DEPENDENCIES.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ graph LR;
105105
npm-->libnpmversion;
106106
npm-->make-fetch-happen;
107107
npm-->nopt;
108+
npm-->normalize-package-data;
108109
npm-->npm-audit-report;
109110
npm-->npm-install-checks;
110111
npm-->npm-package-arg;
@@ -516,6 +517,7 @@ graph LR;
516517
npm-->nock;
517518
npm-->node-gyp;
518519
npm-->nopt;
520+
npm-->normalize-package-data;
519521
npm-->npm-audit-report;
520522
npm-->npm-install-checks;
521523
npm-->npm-package-arg;
@@ -764,7 +766,8 @@ graph LR;
764766
tar-->mkdirp;
765767
tar-->yallist;
766768
tuf-js-->make-fetch-happen;
767-
tuf-js-->minimatch;
769+
tuf-js-->tufjs-models["@tufjs/models"];
770+
tufjs-models-->minimatch;
768771
unique-filename-->unique-slug;
769772
unique-slug-->imurmurhash;
770773
validate-npm-package-license-->spdx-correct;

node_modules/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
!/@tootallnate/
3333
/@tootallnate/*
3434
!/@tootallnate/once
35+
!/@tufjs/
36+
/@tufjs/*
37+
!/@tufjs/models
3538
!/abbrev
3639
!/abort-controller
3740
!/agent-base

node_modules/@tufjs/models/LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 GitHub and the TUF Contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

node_modules/tuf-js/dist/models/base.d.ts node_modules/@tufjs/models/dist/base.d.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { JSONObject, JSONValue } from '../utils/types';
21
import { Signature } from './signature';
2+
import { JSONObject, JSONValue } from './utils';
33
export interface Signable {
44
signatures: Record<string, Signature>;
55
signed: Signed;
@@ -10,6 +10,13 @@ export interface SignedOptions {
1010
expires?: string;
1111
unrecognizedFields?: Record<string, JSONValue>;
1212
}
13+
export declare enum MetadataKind {
14+
Root = "root",
15+
Timestamp = "timestamp",
16+
Snapshot = "snapshot",
17+
Targets = "targets"
18+
}
19+
export declare function isMetadataKind(value: unknown): value is MetadataKind;
1320
/***
1421
* A base class for the signed part of TUF metadata.
1522
*

node_modules/tuf-js/dist/models/base.js node_modules/@tufjs/models/dist/base.js

+15-3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
33
return (mod && mod.__esModule) ? mod : { "default": mod };
44
};
55
Object.defineProperty(exports, "__esModule", { value: true });
6-
exports.Signed = void 0;
6+
exports.Signed = exports.isMetadataKind = exports.MetadataKind = void 0;
77
const util_1 = __importDefault(require("util"));
8-
const error_1 = require("../error");
9-
const utils_1 = require("../utils");
8+
const error_1 = require("./error");
9+
const utils_1 = require("./utils");
1010
const SPECIFICATION_VERSION = ['1', '0', '31'];
11+
var MetadataKind;
12+
(function (MetadataKind) {
13+
MetadataKind["Root"] = "root";
14+
MetadataKind["Timestamp"] = "timestamp";
15+
MetadataKind["Snapshot"] = "snapshot";
16+
MetadataKind["Targets"] = "targets";
17+
})(MetadataKind = exports.MetadataKind || (exports.MetadataKind = {}));
18+
function isMetadataKind(value) {
19+
return (typeof value === 'string' &&
20+
Object.values(MetadataKind).includes(value));
21+
}
22+
exports.isMetadataKind = isMetadataKind;
1123
/***
1224
* A base class for the signed part of TUF metadata.
1325
*

node_modules/tuf-js/dist/models/delegations.d.ts node_modules/@tufjs/models/dist/delegations.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { JSONObject, JSONValue } from '../utils/types';
21
import { Key } from './key';
32
import { DelegatedRole, SuccinctRoles } from './role';
3+
import { JSONObject, JSONValue } from './utils';
44
type DelegatedRoleMap = Record<string, DelegatedRole>;
55
type KeyMap = Record<string, Key>;
66
interface DelegationsOptions {

node_modules/tuf-js/dist/models/delegations.js node_modules/@tufjs/models/dist/delegations.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
55
Object.defineProperty(exports, "__esModule", { value: true });
66
exports.Delegations = void 0;
77
const util_1 = __importDefault(require("util"));
8-
const error_1 = require("../error");
9-
const guard_1 = require("../utils/guard");
8+
const error_1 = require("./error");
109
const key_1 = require("./key");
1110
const role_1 = require("./role");
11+
const utils_1 = require("./utils");
1212
/**
1313
* A container object storing information about all delegations.
1414
*
@@ -67,7 +67,7 @@ class Delegations {
6767
static fromJSON(data) {
6868
const { keys, roles, succinct_roles, ...unrecognizedFields } = data;
6969
let succinctRoles;
70-
if ((0, guard_1.isObject)(succinct_roles)) {
70+
if (utils_1.guard.isObject(succinct_roles)) {
7171
succinctRoles = role_1.SuccinctRoles.fromJSON(succinct_roles);
7272
}
7373
return new Delegations({
@@ -89,7 +89,7 @@ function rolesToJSON(roles) {
8989
return Object.values(roles).map((role) => role.toJSON());
9090
}
9191
function keysFromJSON(data) {
92-
if (!(0, guard_1.isObjectRecord)(data)) {
92+
if (!utils_1.guard.isObjectRecord(data)) {
9393
throw new TypeError('keys is malformed');
9494
}
9595
return Object.entries(data).reduce((acc, [keyID, keyData]) => ({
@@ -99,8 +99,8 @@ function keysFromJSON(data) {
9999
}
100100
function rolesFromJSON(data) {
101101
let roleMap;
102-
if ((0, guard_1.isDefined)(data)) {
103-
if (!(0, guard_1.isObjectArray)(data)) {
102+
if (utils_1.guard.isDefined(data)) {
103+
if (!utils_1.guard.isObjectArray(data)) {
104104
throw new TypeError('roles is malformed');
105105
}
106106
roleMap = data.reduce((acc, role) => {
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export declare class ValueError extends Error {
2+
}
3+
export declare class RepositoryError extends Error {
4+
}
5+
export declare class UnsignedMetadataError extends RepositoryError {
6+
}
7+
export declare class LengthOrHashMismatchError extends RepositoryError {
8+
}
9+
export declare class CryptoError extends Error {
10+
}
11+
export declare class UnsupportedAlgorithmError extends CryptoError {
12+
}
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
3+
exports.UnsupportedAlgorithmError = exports.CryptoError = exports.LengthOrHashMismatchError = exports.UnsignedMetadataError = exports.RepositoryError = exports.ValueError = void 0;
4+
// An error about insufficient values
5+
class ValueError extends Error {
6+
}
7+
exports.ValueError = ValueError;
8+
// An error with a repository's state, such as a missing file.
9+
// It covers all exceptions that come from the repository side when
10+
// looking from the perspective of users of metadata API or ngclient.
11+
class RepositoryError extends Error {
12+
}
13+
exports.RepositoryError = RepositoryError;
14+
// An error about metadata object with insufficient threshold of signatures.
15+
class UnsignedMetadataError extends RepositoryError {
16+
}
17+
exports.UnsignedMetadataError = UnsignedMetadataError;
18+
// An error while checking the length and hash values of an object.
19+
class LengthOrHashMismatchError extends RepositoryError {
20+
}
21+
exports.LengthOrHashMismatchError = LengthOrHashMismatchError;
22+
class CryptoError extends Error {
23+
}
24+
exports.CryptoError = CryptoError;
25+
class UnsupportedAlgorithmError extends CryptoError {
26+
}
27+
exports.UnsupportedAlgorithmError = UnsupportedAlgorithmError;

node_modules/tuf-js/dist/models/file.d.ts node_modules/@tufjs/models/dist/file.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// <reference types="node" />
22
/// <reference types="node" />
33
import { Readable } from 'stream';
4-
import { JSONObject, JSONValue } from '../utils/types';
4+
import { JSONObject, JSONValue } from './utils';
55
interface MetaFileOptions {
66
version: number;
77
length?: number;

node_modules/tuf-js/dist/models/file.js node_modules/@tufjs/models/dist/file.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
66
exports.TargetFile = exports.MetaFile = void 0;
77
const crypto_1 = __importDefault(require("crypto"));
88
const util_1 = __importDefault(require("util"));
9-
const error_1 = require("../error");
10-
const guard_1 = require("../utils/guard");
9+
const error_1 = require("./error");
10+
const utils_1 = require("./utils");
1111
// A container with information about a particular metadata file.
1212
//
1313
// This class is used for Timestamp and Snapshot metadata.
@@ -75,10 +75,10 @@ class MetaFile {
7575
if (typeof version !== 'number') {
7676
throw new TypeError('version must be a number');
7777
}
78-
if ((0, guard_1.isDefined)(length) && typeof length !== 'number') {
78+
if (utils_1.guard.isDefined(length) && typeof length !== 'number') {
7979
throw new TypeError('length must be a number');
8080
}
81-
if ((0, guard_1.isDefined)(hashes) && !(0, guard_1.isStringRecord)(hashes)) {
81+
if (utils_1.guard.isDefined(hashes) && !utils_1.guard.isStringRecord(hashes)) {
8282
throw new TypeError('hashes must be string keys and values');
8383
}
8484
return new MetaFile({
@@ -163,7 +163,7 @@ class TargetFile {
163163
if (typeof length !== 'number') {
164164
throw new TypeError('length must be a number');
165165
}
166-
if (!(0, guard_1.isStringRecord)(hashes)) {
166+
if (!utils_1.guard.isStringRecord(hashes)) {
167167
throw new TypeError('hashes must have string keys and values');
168168
}
169169
return new TargetFile({
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export { MetadataKind } from './base';
2+
export { ValueError } from './error';
3+
export { MetaFile, TargetFile } from './file';
4+
export { Key } from './key';
5+
export { Metadata } from './metadata';
6+
export { Root } from './root';
7+
export { Signature } from './signature';
8+
export { Snapshot } from './snapshot';
9+
export { Targets } from './targets';
10+
export { Timestamp } from './timestamp';
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
3+
exports.Timestamp = exports.Targets = exports.Snapshot = exports.Signature = exports.Root = exports.Metadata = exports.Key = exports.TargetFile = exports.MetaFile = exports.ValueError = exports.MetadataKind = void 0;
4+
var base_1 = require("./base");
5+
Object.defineProperty(exports, "MetadataKind", { enumerable: true, get: function () { return base_1.MetadataKind; } });
6+
var error_1 = require("./error");
7+
Object.defineProperty(exports, "ValueError", { enumerable: true, get: function () { return error_1.ValueError; } });
8+
var file_1 = require("./file");
9+
Object.defineProperty(exports, "MetaFile", { enumerable: true, get: function () { return file_1.MetaFile; } });
10+
Object.defineProperty(exports, "TargetFile", { enumerable: true, get: function () { return file_1.TargetFile; } });
11+
var key_1 = require("./key");
12+
Object.defineProperty(exports, "Key", { enumerable: true, get: function () { return key_1.Key; } });
13+
var metadata_1 = require("./metadata");
14+
Object.defineProperty(exports, "Metadata", { enumerable: true, get: function () { return metadata_1.Metadata; } });
15+
var root_1 = require("./root");
16+
Object.defineProperty(exports, "Root", { enumerable: true, get: function () { return root_1.Root; } });
17+
var signature_1 = require("./signature");
18+
Object.defineProperty(exports, "Signature", { enumerable: true, get: function () { return signature_1.Signature; } });
19+
var snapshot_1 = require("./snapshot");
20+
Object.defineProperty(exports, "Snapshot", { enumerable: true, get: function () { return snapshot_1.Snapshot; } });
21+
var targets_1 = require("./targets");
22+
Object.defineProperty(exports, "Targets", { enumerable: true, get: function () { return targets_1.Targets; } });
23+
var timestamp_1 = require("./timestamp");
24+
Object.defineProperty(exports, "Timestamp", { enumerable: true, get: function () { return timestamp_1.Timestamp; } });

node_modules/tuf-js/dist/models/key.d.ts node_modules/@tufjs/models/dist/key.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { JSONObject, JSONValue } from '../utils/types';
21
import { Signable } from './base';
2+
import { JSONObject, JSONValue } from './utils';
33
export interface KeyOptions {
44
keyID: string;
55
keyType: string;

node_modules/tuf-js/dist/models/key.js node_modules/@tufjs/models/dist/key.js

+5-29
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,13 @@
11
"use strict";
2-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3-
if (k2 === undefined) k2 = k;
4-
var desc = Object.getOwnPropertyDescriptor(m, k);
5-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6-
desc = { enumerable: true, get: function() { return m[k]; } };
7-
}
8-
Object.defineProperty(o, k2, desc);
9-
}) : (function(o, m, k, k2) {
10-
if (k2 === undefined) k2 = k;
11-
o[k2] = m[k];
12-
}));
13-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14-
Object.defineProperty(o, "default", { enumerable: true, value: v });
15-
}) : function(o, v) {
16-
o["default"] = v;
17-
});
18-
var __importStar = (this && this.__importStar) || function (mod) {
19-
if (mod && mod.__esModule) return mod;
20-
var result = {};
21-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22-
__setModuleDefault(result, mod);
23-
return result;
24-
};
252
var __importDefault = (this && this.__importDefault) || function (mod) {
263
return (mod && mod.__esModule) ? mod : { "default": mod };
274
};
285
Object.defineProperty(exports, "__esModule", { value: true });
296
exports.Key = void 0;
307
const util_1 = __importDefault(require("util"));
31-
const error_1 = require("../error");
32-
const guard_1 = require("../utils/guard");
33-
const key_1 = require("../utils/key");
34-
const signer = __importStar(require("../utils/signer"));
8+
const error_1 = require("./error");
9+
const utils_1 = require("./utils");
10+
const key_1 = require("./utils/key");
3511
// A container class representing the public portion of a Key.
3612
class Key {
3713
constructor(options) {
@@ -57,7 +33,7 @@ class Key {
5733
});
5834
const signedData = metadata.signed.toJSON();
5935
try {
60-
if (!signer.verifySignature(signedData, publicKey, signature.sig)) {
36+
if (!utils_1.crypto.verifySignature(signedData, publicKey, signature.sig)) {
6137
throw new error_1.UnsignedMetadataError(`failed to verify ${this.keyID} signature`);
6238
}
6339
}
@@ -94,7 +70,7 @@ class Key {
9470
if (typeof scheme !== 'string') {
9571
throw new TypeError('scheme must be a string');
9672
}
97-
if (!(0, guard_1.isStringRecord)(keyval)) {
73+
if (!utils_1.guard.isStringRecord(keyval)) {
9874
throw new TypeError('keyval must be a string record');
9975
}
10076
return new Key({

node_modules/tuf-js/dist/models/metadata.d.ts node_modules/@tufjs/models/dist/metadata.d.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import { JSONObject, JSONValue, MetadataKind } from '../utils/types';
2-
import { Signable } from './base';
1+
/// <reference types="node" />
2+
import { MetadataKind, Signable } from './base';
33
import { Root } from './root';
44
import { Signature } from './signature';
55
import { Snapshot } from './snapshot';
66
import { Targets } from './targets';
77
import { Timestamp } from './timestamp';
8+
import { JSONObject, JSONValue } from './utils';
89
type MetadataType = Root | Timestamp | Snapshot | Targets;
910
/***
1011
* A container for signed TUF metadata.
@@ -35,8 +36,10 @@ export declare class Metadata<T extends MetadataType> implements Signable {
3536
signatures: Record<string, Signature>;
3637
unrecognizedFields: Record<string, JSONValue>;
3738
constructor(signed: T, signatures?: Record<string, Signature>, unrecognizedFields?: Record<string, JSONValue>);
39+
sign(signer: (data: Buffer) => Signature, append?: boolean): void;
3840
verifyDelegate(delegatedRole: string, delegatedMetadata: Metadata<MetadataType>): void;
3941
equals(other: T): boolean;
42+
toJSON(): JSONObject;
4043
static fromJSON(type: MetadataKind.Root, data: JSONObject): Metadata<Root>;
4144
static fromJSON(type: MetadataKind.Timestamp, data: JSONObject): Metadata<Timestamp>;
4245
static fromJSON(type: MetadataKind.Snapshot, data: JSONObject): Metadata<Snapshot>;

0 commit comments

Comments
 (0)