Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- node24/node_modules/npm/node_modules/@npmcli/agent/package.json +60 -0
- node24/node_modules/npm/node_modules/@npmcli/arborist/LICENSE.md +20 -0
- node24/node_modules/npm/node_modules/@npmcli/arborist/README.md +315 -0
- node24/node_modules/npm/node_modules/@npmcli/arborist/package.json +99 -0
- node24/node_modules/npm/node_modules/@npmcli/config/LICENSE +15 -0
- node24/node_modules/npm/node_modules/@npmcli/config/README.md +226 -0
- node24/node_modules/npm/node_modules/@npmcli/config/package.json +57 -0
- node24/node_modules/npm/node_modules/@npmcli/fs/LICENSE.md +20 -0
- node24/node_modules/npm/node_modules/@npmcli/fs/package.json +54 -0
- node24/node_modules/npm/node_modules/@npmcli/git/LICENSE +15 -0
- node24/node_modules/npm/node_modules/@npmcli/git/package.json +58 -0
- node24/node_modules/npm/node_modules/@npmcli/installed-package-contents/LICENSE +15 -0
- node24/node_modules/npm/node_modules/@npmcli/installed-package-contents/README.md +109 -0
- node24/node_modules/npm/node_modules/@npmcli/installed-package-contents/package.json +52 -0
- node24/node_modules/npm/node_modules/@npmcli/map-workspaces/LICENSE.md +20 -0
- node24/node_modules/npm/node_modules/@npmcli/map-workspaces/package.json +61 -0
- node24/node_modules/npm/node_modules/@npmcli/metavuln-calculator/LICENSE +15 -0
- node24/node_modules/npm/node_modules/@npmcli/metavuln-calculator/package.json +62 -0
- node24/node_modules/npm/node_modules/@npmcli/name-from-folder/LICENSE +15 -0
- node24/node_modules/npm/node_modules/@npmcli/name-from-folder/package.json +45 -0
- node24/node_modules/npm/node_modules/@npmcli/node-gyp/LICENSE +7 -0
- node24/node_modules/npm/node_modules/@sigstore/bundle/LICENSE +202 -0
- node24/node_modules/npm/node_modules/@sigstore/bundle/dist/build.js +100 -0
- node24/node_modules/npm/node_modules/@sigstore/bundle/dist/bundle.js +24 -0
- node24/node_modules/npm/node_modules/@sigstore/bundle/dist/error.js +25 -0
- node24/node_modules/npm/node_modules/@sigstore/bundle/dist/index.js +43 -0
- node24/node_modules/npm/node_modules/@sigstore/bundle/dist/serialized.js +49 -0
- node24/node_modules/npm/node_modules/@sigstore/bundle/dist/utility.js +2 -0
- node24/node_modules/npm/node_modules/@sigstore/bundle/dist/validate.js +199 -0
- node24/node_modules/npm/node_modules/@sigstore/bundle/package.json +35 -0
- node24/node_modules/npm/node_modules/@sigstore/core/LICENSE +202 -0
- node24/node_modules/npm/node_modules/@sigstore/core/dist/asn1/error.js +24 -0
- node24/node_modules/npm/node_modules/@sigstore/core/dist/asn1/index.js +20 -0
- node24/node_modules/npm/node_modules/@sigstore/core/dist/asn1/length.js +62 -0
- node24/node_modules/npm/node_modules/@sigstore/core/dist/asn1/obj.js +155 -0
- node24/node_modules/npm/node_modules/@sigstore/core/dist/asn1/parse.js +124 -0
- node24/node_modules/npm/node_modules/@sigstore/core/dist/asn1/tag.js +89 -0
- node24/node_modules/npm/node_modules/@sigstore/core/dist/crypto.js +69 -0
- node24/node_modules/npm/node_modules/@sigstore/core/dist/dsse.js +30 -0
- node24/node_modules/npm/node_modules/@sigstore/core/dist/encoding.js +27 -0
- node24/node_modules/npm/node_modules/@sigstore/core/dist/index.js +66 -0
- node24/node_modules/npm/node_modules/@sigstore/core/dist/json.js +60 -0
- node24/node_modules/npm/node_modules/@sigstore/core/dist/oid.js +20 -0
- node24/node_modules/npm/node_modules/@sigstore/core/dist/pem.js +43 -0
- node24/node_modules/npm/node_modules/@sigstore/core/dist/rfc3161/error.js +21 -0
- node24/node_modules/npm/node_modules/@sigstore/core/dist/rfc3161/index.js +20 -0
- node24/node_modules/npm/node_modules/@sigstore/core/dist/rfc3161/timestamp.js +212 -0
- node24/node_modules/npm/node_modules/@sigstore/core/dist/rfc3161/tstinfo.js +72 -0
- node24/node_modules/npm/node_modules/@sigstore/core/dist/stream.js +117 -0
- node24/node_modules/npm/node_modules/@sigstore/core/dist/x509/cert.js +245 -0
node24/node_modules/npm/node_modules/@npmcli/agent/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@npmcli/agent",
|
| 3 |
+
"version": "4.0.0",
|
| 4 |
+
"description": "the http/https agent used by the npm cli",
|
| 5 |
+
"main": "lib/index.js",
|
| 6 |
+
"scripts": {
|
| 7 |
+
"gencerts": "bash scripts/create-cert.sh",
|
| 8 |
+
"test": "tap",
|
| 9 |
+
"lint": "npm run eslint",
|
| 10 |
+
"postlint": "template-oss-check",
|
| 11 |
+
"template-oss-apply": "template-oss-apply --force",
|
| 12 |
+
"lintfix": "npm run eslint -- --fix",
|
| 13 |
+
"snap": "tap",
|
| 14 |
+
"posttest": "npm run lint",
|
| 15 |
+
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
|
| 16 |
+
},
|
| 17 |
+
"author": "GitHub Inc.",
|
| 18 |
+
"license": "ISC",
|
| 19 |
+
"bugs": {
|
| 20 |
+
"url": "https://github.com/npm/agent/issues"
|
| 21 |
+
},
|
| 22 |
+
"homepage": "https://github.com/npm/agent#readme",
|
| 23 |
+
"files": [
|
| 24 |
+
"bin/",
|
| 25 |
+
"lib/"
|
| 26 |
+
],
|
| 27 |
+
"engines": {
|
| 28 |
+
"node": "^20.17.0 || >=22.9.0"
|
| 29 |
+
},
|
| 30 |
+
"templateOSS": {
|
| 31 |
+
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
| 32 |
+
"version": "4.25.0",
|
| 33 |
+
"publish": "true"
|
| 34 |
+
},
|
| 35 |
+
"dependencies": {
|
| 36 |
+
"agent-base": "^7.1.0",
|
| 37 |
+
"http-proxy-agent": "^7.0.0",
|
| 38 |
+
"https-proxy-agent": "^7.0.1",
|
| 39 |
+
"lru-cache": "^11.2.1",
|
| 40 |
+
"socks-proxy-agent": "^8.0.3"
|
| 41 |
+
},
|
| 42 |
+
"devDependencies": {
|
| 43 |
+
"@npmcli/eslint-config": "^5.0.0",
|
| 44 |
+
"@npmcli/template-oss": "4.25.0",
|
| 45 |
+
"minipass-fetch": "^4.0.1",
|
| 46 |
+
"nock": "^14.0.3",
|
| 47 |
+
"socksv5": "^0.0.6",
|
| 48 |
+
"tap": "^16.3.0"
|
| 49 |
+
},
|
| 50 |
+
"repository": {
|
| 51 |
+
"type": "git",
|
| 52 |
+
"url": "git+https://github.com/npm/agent.git"
|
| 53 |
+
},
|
| 54 |
+
"tap": {
|
| 55 |
+
"nyc-arg": [
|
| 56 |
+
"--exclude",
|
| 57 |
+
"tap-snapshots/**"
|
| 58 |
+
]
|
| 59 |
+
}
|
| 60 |
+
}
|
node24/node_modules/npm/node_modules/@npmcli/arborist/LICENSE.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!-- This file is automatically added by @npmcli/template-oss. Do not edit. -->
|
| 2 |
+
|
| 3 |
+
ISC License
|
| 4 |
+
|
| 5 |
+
Copyright npm, Inc.
|
| 6 |
+
|
| 7 |
+
Permission to use, copy, modify, and/or distribute this
|
| 8 |
+
software for any purpose with or without fee is hereby
|
| 9 |
+
granted, provided that the above copyright notice and this
|
| 10 |
+
permission notice appear in all copies.
|
| 11 |
+
|
| 12 |
+
THE SOFTWARE IS PROVIDED "AS IS" AND NPM DISCLAIMS ALL
|
| 13 |
+
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
|
| 14 |
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
|
| 15 |
+
EVENT SHALL NPM BE LIABLE FOR ANY SPECIAL, DIRECT,
|
| 16 |
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
| 17 |
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 18 |
+
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
| 19 |
+
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
|
| 20 |
+
USE OR PERFORMANCE OF THIS SOFTWARE.
|
node24/node_modules/npm/node_modules/@npmcli/arborist/README.md
ADDED
|
@@ -0,0 +1,315 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# @npmcli/arborist
|
| 2 |
+
|
| 3 |
+
[](https://npm.im/@npmcli/arborist)
|
| 4 |
+
[](https://npm.im/@npmcli/arborist)
|
| 5 |
+
[](https://github.com/npm/cli/actions/workflows/ci-npmcli-arborist.yml)
|
| 6 |
+
|
| 7 |
+
Inspect and manage `node_modules` trees.
|
| 8 |
+
|
| 9 |
+

|
| 10 |
+
|
| 11 |
+
There's more documentation [in the docs
|
| 12 |
+
folder](https://github.com/npm/cli/tree/latest/workspaces/arborist/docs).
|
| 13 |
+
|
| 14 |
+
## USAGE
|
| 15 |
+
|
| 16 |
+
```js
|
| 17 |
+
const Arborist = require('@npmcli/arborist')
|
| 18 |
+
|
| 19 |
+
const arb = new Arborist({
|
| 20 |
+
// options object
|
| 21 |
+
|
| 22 |
+
// where we're doing stuff. defaults to cwd.
|
| 23 |
+
path: '/path/to/package/root',
|
| 24 |
+
|
| 25 |
+
// url to the default registry. defaults to npm's default registry
|
| 26 |
+
registry: 'https://registry.npmjs.org',
|
| 27 |
+
|
| 28 |
+
// scopes can be mapped to a different registry
|
| 29 |
+
'@foo:registry': 'https://registry.foo.com/',
|
| 30 |
+
|
| 31 |
+
// Auth can be provided in a couple of different ways. If none are
|
| 32 |
+
// provided, then requests are anonymous, and private packages will 404.
|
| 33 |
+
// Arborist doesn't do anything with these, it just passes them down
|
| 34 |
+
// the chain to pacote and npm-registry-fetch.
|
| 35 |
+
|
| 36 |
+
// Safest: a bearer token provided by a registry:
|
| 37 |
+
// 1. an npm auth token, used with the default registry
|
| 38 |
+
token: 'deadbeefcafebad',
|
| 39 |
+
// 2. an alias for the same thing:
|
| 40 |
+
_authToken: 'deadbeefcafebad',
|
| 41 |
+
|
| 42 |
+
// insecure options:
|
| 43 |
+
// 3. basic auth, username:password, base64 encoded
|
| 44 |
+
auth: 'aXNhYWNzOm5vdCBteSByZWFsIHBhc3N3b3Jk',
|
| 45 |
+
// 4. username and base64 encoded password
|
| 46 |
+
username: 'isaacs',
|
| 47 |
+
password: 'bm90IG15IHJlYWwgcGFzc3dvcmQ=',
|
| 48 |
+
|
| 49 |
+
// auth configs can also be scoped to a given registry with this
|
| 50 |
+
// rather unusual pattern:
|
| 51 |
+
'//registry.foo.com:token': 'blahblahblah',
|
| 52 |
+
'//basic.auth.only.foo.com:_auth': 'aXNhYWNzOm5vdCBteSByZWFsIHBhc3N3b3Jk',
|
| 53 |
+
'//registry.foo.com:always-auth': true,
|
| 54 |
+
})
|
| 55 |
+
|
| 56 |
+
// READING
|
| 57 |
+
|
| 58 |
+
// returns a promise. reads the actual contents of node_modules
|
| 59 |
+
arb.loadActual().then(tree => {
|
| 60 |
+
// tree is also stored at arb.virtualTree
|
| 61 |
+
})
|
| 62 |
+
|
| 63 |
+
// read just what the package-lock.json/npm-shrinkwrap says
|
| 64 |
+
// This *also* loads the yarn.lock file, but that's only relevant
|
| 65 |
+
// when building the ideal tree.
|
| 66 |
+
arb.loadVirtual().then(tree => {
|
| 67 |
+
// tree is also stored at arb.virtualTree
|
| 68 |
+
// now arb.virtualTree is loaded
|
| 69 |
+
// this fails if there's no package-lock.json or package.json in the folder
|
| 70 |
+
// note that loading this way should only be done if there's no
|
| 71 |
+
// node_modules folder
|
| 72 |
+
})
|
| 73 |
+
|
| 74 |
+
// OPTIMIZING AND DESIGNING
|
| 75 |
+
|
| 76 |
+
// build an ideal tree from the package.json and various lockfiles.
|
| 77 |
+
arb.buildIdealTree(options).then(() => {
|
| 78 |
+
// next step is to reify that ideal tree onto disk.
|
| 79 |
+
// options can be:
|
| 80 |
+
// rm: array of package names to remove at top level
|
| 81 |
+
// add: Array of package specifiers to add at the top level. Each of
|
| 82 |
+
// these will be resolved with pacote.manifest if the name can't be
|
| 83 |
+
// determined from the spec. (Eg, `github:foo/bar` vs `foo@somespec`.)
|
| 84 |
+
// The dep will be saved in the location where it already exists,
|
| 85 |
+
// (or pkg.dependencies) unless a different saveType is specified.
|
| 86 |
+
// saveType: Save added packages in a specific dependency set.
|
| 87 |
+
// - null (default) Wherever they exist already, or 'dependencies'
|
| 88 |
+
// - prod: definitely in 'dependencies'
|
| 89 |
+
// - optional: in 'optionalDependencies'
|
| 90 |
+
// - dev: devDependencies
|
| 91 |
+
// - peer: save in peerDependencies, and remove any optional flag from
|
| 92 |
+
// peerDependenciesMeta if one exists
|
| 93 |
+
// - peerOptional: save in peerDependencies, and add a
|
| 94 |
+
// peerDepsMeta[name].optional flag
|
| 95 |
+
// saveBundle: add newly added deps to the bundleDependencies list
|
| 96 |
+
// update: Either `true` to just go ahead and update everything, or an
|
| 97 |
+
// object with any or all of the following fields:
|
| 98 |
+
// - all: boolean. set to true to just update everything
|
| 99 |
+
// - names: names of packages update (like `npm update foo`)
|
| 100 |
+
// prune: boolean, default true. Prune extraneous nodes from the tree.
|
| 101 |
+
// preferDedupe: prefer to deduplicate packages if possible, rather than
|
| 102 |
+
// choosing a newer version of a dependency. Defaults to false, ie,
|
| 103 |
+
// always try to get the latest and greatest deps.
|
| 104 |
+
// legacyBundling: Nest every dep under the node requiring it, npm v2 style.
|
| 105 |
+
// No unnecessary deduplication. Default false.
|
| 106 |
+
|
| 107 |
+
// At the end of this process, arb.idealTree is set.
|
| 108 |
+
})
|
| 109 |
+
|
| 110 |
+
// WRITING
|
| 111 |
+
|
| 112 |
+
// Make the idealTree be the thing that's on disk
|
| 113 |
+
arb.reify({
|
| 114 |
+
// write the lockfile(s) back to disk, and package.json with any updates
|
| 115 |
+
// defaults to 'true'
|
| 116 |
+
save: true,
|
| 117 |
+
}).then(() => {
|
| 118 |
+
// node modules has been written to match the idealTree
|
| 119 |
+
})
|
| 120 |
+
```
|
| 121 |
+
|
| 122 |
+
## DATA STRUCTURES
|
| 123 |
+
|
| 124 |
+
A `node_modules` tree is a logical graph of dependencies overlaid on a
|
| 125 |
+
physical tree of folders.
|
| 126 |
+
|
| 127 |
+
A `Node` represents a package folder on disk, either at the root of the
|
| 128 |
+
package, or within a `node_modules` folder. The physical structure of the
|
| 129 |
+
folder tree is represented by the `node.parent` reference to the containing
|
| 130 |
+
folder, and `node.children` map of nodes within its `node_modules`
|
| 131 |
+
folder, where the key in the map is the name of the folder in
|
| 132 |
+
`node_modules`, and the value is the child node.
|
| 133 |
+
|
| 134 |
+
A node without a parent is a top of tree.
|
| 135 |
+
|
| 136 |
+
A `Link` represents a symbolic link to a package on disk. This can be a
|
| 137 |
+
symbolic link to a package folder within the current tree, or elsewhere on
|
| 138 |
+
disk. The `link.target` is a reference to the actual node. Links differ
|
| 139 |
+
from Nodes in that dependencies are resolved from the _target_ location,
|
| 140 |
+
rather than from the link location.
|
| 141 |
+
|
| 142 |
+
An `Edge` represents a dependency relationship. Each node has an `edgesIn`
|
| 143 |
+
set, and an `edgesOut` map. Each edge has a `type` which specifies what
|
| 144 |
+
kind of dependency it represents: `'prod'` for regular dependencies,
|
| 145 |
+
`'peer'` for peerDependencies, `'dev'` for devDependencies, and
|
| 146 |
+
`'optional'` for optionalDependencies. `edge.from` is a reference to the
|
| 147 |
+
node that has the dependency, and `edge.to` is a reference to the node that
|
| 148 |
+
requires the dependency.
|
| 149 |
+
|
| 150 |
+
As nodes are moved around in the tree, the graph edges are automatically
|
| 151 |
+
updated to point at the new module resolution targets. In other words,
|
| 152 |
+
`edge.from`, `edge.name`, and `edge.spec` are immutable; `edge.to` is
|
| 153 |
+
updated automatically when a node's parent changes.
|
| 154 |
+
|
| 155 |
+
### class Node
|
| 156 |
+
|
| 157 |
+
All arborist trees are `Node` objects. A `Node` refers
|
| 158 |
+
to a package folder, which may have children in `node_modules`.
|
| 159 |
+
|
| 160 |
+
* `node.name` The name of this node's folder in `node_modules`.
|
| 161 |
+
* `node.parent` Physical parent node in the tree. The package in whose
|
| 162 |
+
`node_modules` folder this package lives. Null if node is top of tree.
|
| 163 |
+
|
| 164 |
+
Setting `node.parent` will automatically update `node.location` and all
|
| 165 |
+
graph edges affected by the move.
|
| 166 |
+
|
| 167 |
+
* `node.meta` A `Shrinkwrap` object which looks up `resolved` and
|
| 168 |
+
`integrity` values for all modules in this tree. Only relevant on `root`
|
| 169 |
+
nodes.
|
| 170 |
+
|
| 171 |
+
* `node.children` Map of packages located in the node's `node_modules`
|
| 172 |
+
folder.
|
| 173 |
+
* `node.package` The contents of this node's `package.json` file.
|
| 174 |
+
* `node.path` File path to this package. If the node is a link, then this
|
| 175 |
+
is the path to the link, not to the link target. If the node is _not_ a
|
| 176 |
+
link, then this matches `node.realpath`.
|
| 177 |
+
* `node.realpath` The full real filepath on disk where this node lives.
|
| 178 |
+
* `node.location` A slash-normalized relative path from the root node to
|
| 179 |
+
this node's path.
|
| 180 |
+
* `node.isLink` Whether this represents a symlink. Always `false` for Node
|
| 181 |
+
objects, always `true` for Link objects.
|
| 182 |
+
* `node.isRoot` True if this node is a root node. (Ie, if `node.root ===
|
| 183 |
+
node`.)
|
| 184 |
+
* `node.root` The root node where we are working. If not assigned to some
|
| 185 |
+
other value, resolves to the node itself. (Ie, the root node's `root`
|
| 186 |
+
property refers to itself.)
|
| 187 |
+
* `node.isTop` True if this node is the top of its tree (ie, has no
|
| 188 |
+
`parent`, false otherwise).
|
| 189 |
+
* `node.top` The top node in this node's tree. This will be equal to
|
| 190 |
+
`node.root` for simple trees, but link targets will frequently be outside
|
| 191 |
+
of (or nested somewhere within) a `node_modules` hierarchy, and so will
|
| 192 |
+
have a different `top`.
|
| 193 |
+
* `node.dev`, `node.optional`, `node.devOptional`, `node.peer`, Indicators
|
| 194 |
+
as to whether this node is a dev, optional, and/or peer dependency.
|
| 195 |
+
These flags are relevant when pruning dependencies out of the tree or
|
| 196 |
+
deciding what to reify. See **Package Dependency Flags** below for
|
| 197 |
+
explanations.
|
| 198 |
+
* `node.edgesOut` Edges in the dependency graph indicating nodes that this
|
| 199 |
+
node depends on, which resolve its dependencies.
|
| 200 |
+
* `node.edgesIn` Edges in the dependency graph indicating nodes that depend
|
| 201 |
+
on this node.
|
| 202 |
+
|
| 203 |
+
* `extraneous` True if this package is not required by any other for any
|
| 204 |
+
reason. False for top of tree.
|
| 205 |
+
|
| 206 |
+
* `node.resolve(name)` Identify the node that will be returned when code
|
| 207 |
+
in this package runs `require(name)`
|
| 208 |
+
|
| 209 |
+
* `node.errors` Array of errors encountered while parsing package.json or
|
| 210 |
+
version specifiers.
|
| 211 |
+
|
| 212 |
+
### class Link
|
| 213 |
+
|
| 214 |
+
Link objects represent a symbolic link within the `node_modules` folder.
|
| 215 |
+
They have most of the same properties and methods as `Node` objects, with a
|
| 216 |
+
few differences.
|
| 217 |
+
|
| 218 |
+
* `link.target` A Node object representing the package that the link
|
| 219 |
+
references. If this is a Node already present within the tree, then it
|
| 220 |
+
will be the same object. If it's outside of the tree, then it will be
|
| 221 |
+
treated as the top of its own tree.
|
| 222 |
+
* `link.isLink` Always true.
|
| 223 |
+
* `link.children` This is always an empty map, since links don't have their
|
| 224 |
+
own children directly.
|
| 225 |
+
|
| 226 |
+
### class Edge
|
| 227 |
+
|
| 228 |
+
Edge objects represent a dependency relationship a package node to the
|
| 229 |
+
point in the tree where the dependency will be loaded. As nodes are moved
|
| 230 |
+
within the tree, Edges automatically update to point to the appropriate
|
| 231 |
+
location.
|
| 232 |
+
|
| 233 |
+
* `new Edge({ from, type, name, spec })` Creates a new edge with the
|
| 234 |
+
specified fields. After instantiation, none of the fields can be
|
| 235 |
+
changed directly.
|
| 236 |
+
* `edge.from` The node that has the dependency.
|
| 237 |
+
* `edge.type` The type of dependency. One of `'prod'`, `'dev'`, `'peer'`,
|
| 238 |
+
or `'optional'`.
|
| 239 |
+
* `edge.name` The name of the dependency. Ie, the key in the
|
| 240 |
+
relevant `package.json` dependencies object.
|
| 241 |
+
* `edge.spec` The specifier that is required. This can be a version,
|
| 242 |
+
range, tag name, git url, or tarball URL. Any specifier allowed by npm
|
| 243 |
+
is supported.
|
| 244 |
+
* `edge.to` Automatically set to the node in the tree that matches the
|
| 245 |
+
`name` field.
|
| 246 |
+
* `edge.valid` True if `edge.to` satisfies the specifier.
|
| 247 |
+
* `edge.error` A string indicating the type of error if there is a problem,
|
| 248 |
+
or `null` if it's valid. Values, in order of precedence:
|
| 249 |
+
* `DETACHED` Indicates that the edge has been detached from its
|
| 250 |
+
`edge.from` node, typically because a new edge was created when a
|
| 251 |
+
dependency specifier was modified.
|
| 252 |
+
* `MISSING` Indicates that the dependency is unmet. Note that this is
|
| 253 |
+
_not_ set for unmet dependencies of the `optional` type.
|
| 254 |
+
* `PEER LOCAL` Indicates that a `peerDependency` is found in the
|
| 255 |
+
node's local `node_modules` folder, and the node is not the top of
|
| 256 |
+
the tree. This violates the `peerDependency` contract, because it
|
| 257 |
+
means that the dependency is not a peer.
|
| 258 |
+
* `INVALID` Indicates that the dependency does not satisfy `edge.spec`.
|
| 259 |
+
* `edge.reload()` Re-resolve to find the appropriate value for `edge.to`.
|
| 260 |
+
Called automatically from the `Node` class when the tree is mutated.
|
| 261 |
+
|
| 262 |
+
### Package Dependency Flags
|
| 263 |
+
|
| 264 |
+
The dependency type of a node can be determined efficiently by looking at
|
| 265 |
+
the `dev`, `optional`, and `devOptional` flags on the node object. These
|
| 266 |
+
are updated by arborist when necessary whenever the tree is modified in
|
| 267 |
+
such a way that the dependency graph can change, and are relevant when
|
| 268 |
+
pruning nodes from the tree.
|
| 269 |
+
|
| 270 |
+
| extraneous | peer | dev | optional | devOptional | meaning | prune? |
|
| 271 |
+
|:----------:|:----:|:---:|:--------:|:----------------:|:-------------------------------------------------------------------------------------------------|:-------------------------------------------------------|
|
| 272 |
+
| | | | | | production dep | never |
|
| 273 |
+
| X | N/A | N/A | N/A | N/A | nothing depends on this, it is trash | always |
|
| 274 |
+
| | | X | | X<br>not in lock | devDependency, or only depended<br>on by devDependencies | if pruning dev |
|
| 275 |
+
| | | | X | X<br>not in lock | optionalDependency, or only depended<br>on by optionalDeps | if pruning optional |
|
| 276 |
+
| | | X | X | X<br>not in lock | Optional dependency of dep(s) in the<br>dev hierarchy | if pruning EITHER<br>dev OR optional |
|
| 277 |
+
| | | | | X<br>in lock | BOTH a non-optional dep within the<br>dev hierarchy, AND a dep within<br>the optional hierarchy | if pruning BOTH<br>dev AND optional |
|
| 278 |
+
| | X | | | | peer dependency, or only depended<br>on by peer dependencies | if pruning peers |
|
| 279 |
+
| | X | X | | X<br>not in lock | peer dependency of dev node hierarchy | if pruning peer OR<br>dev deps |
|
| 280 |
+
| | X | | X | X<br>not in lock | peer dependency of optional nodes, or<br>peerOptional dep | if pruning peer OR<br>optional deps |
|
| 281 |
+
| | X | X | X | X<br>not in lock | peer optional deps of the dev dep hierarchy | if pruning peer OR<br>optional OR dev |
|
| 282 |
+
| | X | | | X<br>in lock | BOTH a non-optional peer dep within the<br>dev hierarchy, AND a peer optional dep | if pruning peer deps OR:<br>BOTH optional AND dev deps |
|
| 283 |
+
|
| 284 |
+
* If none of these flags are set, then the node is required by the
|
| 285 |
+
dependency and/or peerDependency hierarchy. It should not be pruned.
|
| 286 |
+
* If _both_ `node.dev` and `node.optional` are set, then the node is an
|
| 287 |
+
optional dependency of one of the packages in the devDependency
|
| 288 |
+
hierarchy. It should be pruned if _either_ dev or optional deps are
|
| 289 |
+
being removed.
|
| 290 |
+
* If `node.dev` is set, but `node.optional` is not, then the node is
|
| 291 |
+
required in the devDependency hierarchy. It should be pruned if dev
|
| 292 |
+
dependencies are being removed.
|
| 293 |
+
* If `node.optional` is set, but `node.dev` is not, then the node is
|
| 294 |
+
required in the optionalDependency hierarchy. It should be pruned if
|
| 295 |
+
optional dependencies are being removed.
|
| 296 |
+
* If `node.devOptional` is set, then the node is a (non-optional)
|
| 297 |
+
dependency within the devDependency hierarchy, _and_ a dependency
|
| 298 |
+
within the `optionalDependency` hierarchy. It should be pruned if
|
| 299 |
+
_both_ dev and optional dependencies are being removed.
|
| 300 |
+
* If `node.peer` is set, then all the same semantics apply as above, except
|
| 301 |
+
that the dep is brought in by a peer dep at some point, rather than a
|
| 302 |
+
normal non-peer dependency.
|
| 303 |
+
|
| 304 |
+
Note: `devOptional` is only set in the shrinkwrap/package-lock file if
|
| 305 |
+
_neither_ `dev` nor `optional` are set, as it would be redundant.
|
| 306 |
+
|
| 307 |
+
## BIN
|
| 308 |
+
|
| 309 |
+
Arborist ships with a cli that can be used to run arborist specific commands outside of the context of the npm CLI. This script is currently not part of the public API and is subject to breaking changes outside of major version bumps.
|
| 310 |
+
|
| 311 |
+
To see the usage run:
|
| 312 |
+
|
| 313 |
+
```
|
| 314 |
+
npx @npmcli/arborist --help
|
| 315 |
+
```
|
node24/node_modules/npm/node_modules/@npmcli/arborist/package.json
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@npmcli/arborist",
|
| 3 |
+
"version": "9.4.2",
|
| 4 |
+
"description": "Manage node_modules trees",
|
| 5 |
+
"dependencies": {
|
| 6 |
+
"@gar/promise-retry": "^1.0.0",
|
| 7 |
+
"@isaacs/string-locale-compare": "^1.1.0",
|
| 8 |
+
"@npmcli/fs": "^5.0.0",
|
| 9 |
+
"@npmcli/installed-package-contents": "^4.0.0",
|
| 10 |
+
"@npmcli/map-workspaces": "^5.0.0",
|
| 11 |
+
"@npmcli/metavuln-calculator": "^9.0.2",
|
| 12 |
+
"@npmcli/name-from-folder": "^4.0.0",
|
| 13 |
+
"@npmcli/node-gyp": "^5.0.0",
|
| 14 |
+
"@npmcli/package-json": "^7.0.0",
|
| 15 |
+
"@npmcli/query": "^5.0.0",
|
| 16 |
+
"@npmcli/redact": "^4.0.0",
|
| 17 |
+
"@npmcli/run-script": "^10.0.0",
|
| 18 |
+
"bin-links": "^6.0.0",
|
| 19 |
+
"cacache": "^20.0.1",
|
| 20 |
+
"common-ancestor-path": "^2.0.0",
|
| 21 |
+
"hosted-git-info": "^9.0.0",
|
| 22 |
+
"json-stringify-nice": "^1.1.4",
|
| 23 |
+
"lru-cache": "^11.2.1",
|
| 24 |
+
"minimatch": "^10.0.3",
|
| 25 |
+
"nopt": "^9.0.0",
|
| 26 |
+
"npm-install-checks": "^8.0.0",
|
| 27 |
+
"npm-package-arg": "^13.0.0",
|
| 28 |
+
"npm-pick-manifest": "^11.0.1",
|
| 29 |
+
"npm-registry-fetch": "^19.0.0",
|
| 30 |
+
"pacote": "^21.0.2",
|
| 31 |
+
"parse-conflict-json": "^5.0.1",
|
| 32 |
+
"proc-log": "^6.0.0",
|
| 33 |
+
"proggy": "^4.0.0",
|
| 34 |
+
"promise-all-reject-late": "^1.0.0",
|
| 35 |
+
"promise-call-limit": "^3.0.1",
|
| 36 |
+
"semver": "^7.3.7",
|
| 37 |
+
"ssri": "^13.0.0",
|
| 38 |
+
"treeverse": "^3.0.0",
|
| 39 |
+
"walk-up-path": "^4.0.0"
|
| 40 |
+
},
|
| 41 |
+
"devDependencies": {
|
| 42 |
+
"@npmcli/eslint-config": "^5.0.1",
|
| 43 |
+
"@npmcli/mock-registry": "^1.0.0",
|
| 44 |
+
"@npmcli/template-oss": "4.29.0",
|
| 45 |
+
"benchmark": "^2.1.4",
|
| 46 |
+
"minify-registry-metadata": "^4.0.0",
|
| 47 |
+
"nock": "^13.3.3",
|
| 48 |
+
"tap": "^16.3.8",
|
| 49 |
+
"tar-stream": "^3.0.0",
|
| 50 |
+
"tcompare": "^5.0.6"
|
| 51 |
+
},
|
| 52 |
+
"scripts": {
|
| 53 |
+
"test": "tap",
|
| 54 |
+
"posttest": "npm run lint",
|
| 55 |
+
"snap": "tap",
|
| 56 |
+
"test-proxy": "ARBORIST_TEST_PROXY=1 tap --snapshot",
|
| 57 |
+
"lint": "npm run eslint",
|
| 58 |
+
"lintfix": "npm run eslint -- --fix",
|
| 59 |
+
"benchmark": "node scripts/benchmark.js",
|
| 60 |
+
"benchclean": "rm -rf scripts/benchmark/*/",
|
| 61 |
+
"postlint": "template-oss-check",
|
| 62 |
+
"template-oss-apply": "template-oss-apply --force",
|
| 63 |
+
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
|
| 64 |
+
},
|
| 65 |
+
"repository": {
|
| 66 |
+
"type": "git",
|
| 67 |
+
"url": "git+https://github.com/npm/cli.git",
|
| 68 |
+
"directory": "workspaces/arborist"
|
| 69 |
+
},
|
| 70 |
+
"author": "GitHub Inc.",
|
| 71 |
+
"license": "ISC",
|
| 72 |
+
"files": [
|
| 73 |
+
"bin/",
|
| 74 |
+
"lib/"
|
| 75 |
+
],
|
| 76 |
+
"main": "lib/index.js",
|
| 77 |
+
"bin": {
|
| 78 |
+
"arborist": "bin/index.js"
|
| 79 |
+
},
|
| 80 |
+
"tap": {
|
| 81 |
+
"after": "test/fixtures/cleanup.js",
|
| 82 |
+
"test-env": [
|
| 83 |
+
"LC_ALL=sk"
|
| 84 |
+
],
|
| 85 |
+
"timeout": "720",
|
| 86 |
+
"nyc-arg": [
|
| 87 |
+
"--exclude",
|
| 88 |
+
"tap-snapshots/**"
|
| 89 |
+
]
|
| 90 |
+
},
|
| 91 |
+
"engines": {
|
| 92 |
+
"node": "^20.17.0 || >=22.9.0"
|
| 93 |
+
},
|
| 94 |
+
"templateOSS": {
|
| 95 |
+
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
| 96 |
+
"version": "4.29.0",
|
| 97 |
+
"content": "../../scripts/template-oss/index.js"
|
| 98 |
+
}
|
| 99 |
+
}
|
node24/node_modules/npm/node_modules/@npmcli/config/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
The ISC License
|
| 2 |
+
|
| 3 |
+
Copyright (c) npm, Inc.
|
| 4 |
+
|
| 5 |
+
Permission to use, copy, modify, and/or distribute this software for any
|
| 6 |
+
purpose with or without fee is hereby granted, provided that the above
|
| 7 |
+
copyright notice and this permission notice appear in all copies.
|
| 8 |
+
|
| 9 |
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
| 10 |
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
| 11 |
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
| 12 |
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
| 13 |
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
| 14 |
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
| 15 |
+
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
node24/node_modules/npm/node_modules/@npmcli/config/README.md
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# `@npmcli/config`
|
| 2 |
+
|
| 3 |
+
Configuration management for the npm cli.
|
| 4 |
+
|
| 5 |
+
This module is the spiritual descendant of [`npmconf`](http://npm.im/npmconf), and the code that once lived in npm's
|
| 6 |
+
`lib/config/` folder.
|
| 7 |
+
|
| 8 |
+
It does the management of configuration files that npm uses, but importantly, does _not_ define all the configuration defaults or types, as those parts make more sense to live within the npm CLI itself.
|
| 9 |
+
|
| 10 |
+
The only exceptions:
|
| 11 |
+
|
| 12 |
+
- The `prefix` config value has some special semantics, setting the local prefix if specified on the CLI options and not in global mode, or the global prefix otherwise.
|
| 13 |
+
- The `project` config file is loaded based on the local prefix (which can only be set by the CLI config options, and otherwise defaults to a walk up the folder tree to the first parent containing a `node_modules` folder, `package.json` file, or `package-lock.json` file.)
|
| 14 |
+
- The `userconfig` value, as set by the environment and CLI (defaulting to
|
| 15 |
+
`~/.npmrc`, is used to load user configs.
|
| 16 |
+
- The `globalconfig` value, as set by the environment, CLI, and
|
| 17 |
+
`userconfig` file (defaulting to `$PREFIX/etc/npmrc`) is used to load global configs.
|
| 18 |
+
- A `builtin` config, read from a `npmrc` file in the root of the npm project itself, overrides all defaults.
|
| 19 |
+
|
| 20 |
+
The resulting hierarchy of configs:
|
| 21 |
+
|
| 22 |
+
- CLI switches.
|
| 23 |
+
eg `--some-key=some-value` on the command line.
|
| 24 |
+
These are parsed by [`nopt`](http://npm.im/nopt), which is not a great choice, but it's the one that npm has used forever, and changing it will be difficult.
|
| 25 |
+
- Environment variables.
|
| 26 |
+
eg `npm_config_some_key=some_value` in the environment.
|
| 27 |
+
There is no way at this time to modify this prefix.
|
| 28 |
+
- INI-formatted project configs.
|
| 29 |
+
eg `some-key = some-value` in the
|
| 30 |
+
`localPrefix` folder (ie, the `cwd`, or its nearest parent that contains either a `node_modules` folder or `package.json` file.)
|
| 31 |
+
- INI-formatted userconfig file.
|
| 32 |
+
eg `some-key = some-value` in `~/.npmrc`.
|
| 33 |
+
The `userconfig` config value can be overridden by the `cli`, `env`, or
|
| 34 |
+
`project` configs to change this value.
|
| 35 |
+
- INI-formatted globalconfig file.
|
| 36 |
+
eg `some-key = some-value` in the `globalPrefix` folder, which is inferred by looking at the location of the node executable, or the `prefix` setting in the `cli`, `env`, `project`, or `userconfig`.
|
| 37 |
+
The `globalconfig` value at any of those levels can override this.
|
| 38 |
+
- INI-formatted builtin config file.
|
| 39 |
+
eg `some-key = some-value` in `/usr/local/lib/node_modules/npm/npmrc`.
|
| 40 |
+
This is not configurable, and is determined by looking in the `npmPath` folder.
|
| 41 |
+
- Default values (passed in by npm when it loads this module).
|
| 42 |
+
|
| 43 |
+
## USAGE
|
| 44 |
+
|
| 45 |
+
```js
|
| 46 |
+
const Config = require('@npmcli/config')
|
| 47 |
+
const { shorthands, definitions, flatten } = require('@npmcli/config/lib/definitions')
|
| 48 |
+
|
| 49 |
+
const conf = new Config({
|
| 50 |
+
// path to the npm module being run
|
| 51 |
+
npmPath: resolve(__dirname, '..'),
|
| 52 |
+
definitions,
|
| 53 |
+
shorthands,
|
| 54 |
+
flatten,
|
| 55 |
+
// optional, defaults to process.argv
|
| 56 |
+
// argv: [] <- if you are using this package in your own cli
|
| 57 |
+
// and don't want to have colliding argv
|
| 58 |
+
argv: process.argv,
|
| 59 |
+
// optional, defaults to process.env
|
| 60 |
+
env: process.env,
|
| 61 |
+
// optional, defaults to process.execPath
|
| 62 |
+
execPath: process.execPath,
|
| 63 |
+
// optional, defaults to process.platform
|
| 64 |
+
platform: process.platform,
|
| 65 |
+
// optional, defaults to process.cwd()
|
| 66 |
+
cwd: process.cwd(),
|
| 67 |
+
})
|
| 68 |
+
|
| 69 |
+
// emits log events on the process object
|
| 70 |
+
// see `proc-log` for more info
|
| 71 |
+
process.on('log', (level, ...args) => {
|
| 72 |
+
console.log(level, ...args)
|
| 73 |
+
})
|
| 74 |
+
|
| 75 |
+
// returns a promise that fails if config loading fails, and
|
| 76 |
+
// resolves when the config object is ready for action
|
| 77 |
+
conf.load().then(() => {
|
| 78 |
+
conf.validate()
|
| 79 |
+
console.log('loaded ok! some-key = ' + conf.get('some-key'))
|
| 80 |
+
}).catch(er => {
|
| 81 |
+
console.error('error loading configs!', er)
|
| 82 |
+
})
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
## API
|
| 86 |
+
|
| 87 |
+
The `Config` class is the sole export.
|
| 88 |
+
|
| 89 |
+
```js
|
| 90 |
+
const Config = require('@npmcli/config')
|
| 91 |
+
```
|
| 92 |
+
|
| 93 |
+
### static `Config.typeDefs`
|
| 94 |
+
|
| 95 |
+
The type definitions passed to `nopt` for CLI option parsing and known configuration validation.
|
| 96 |
+
|
| 97 |
+
### constructor `new Config(options)`
|
| 98 |
+
|
| 99 |
+
Options:
|
| 100 |
+
|
| 101 |
+
- `types` Types of all known config values.
|
| 102 |
+
Note that some are effectively given semantic value in the config loading process itself.
|
| 103 |
+
- `shorthands` An object mapping a shorthand value to an array of CLI arguments that replace it.
|
| 104 |
+
- `defaults` Default values for each of the known configuration keys.
|
| 105 |
+
These should be defined for all configs given a type, and must be valid.
|
| 106 |
+
- `npmPath` The path to the `npm` module, for loading the `builtin` config file.
|
| 107 |
+
- `cwd` Optional, defaults to `process.cwd()`, used for inferring the
|
| 108 |
+
`localPrefix` and loading the `project` config.
|
| 109 |
+
- `platform` Optional, defaults to `process.platform`.
|
| 110 |
+
Used when inferring the `globalPrefix` from the `execPath`, since this is done differently on Windows.
|
| 111 |
+
- `execPath` Optional, defaults to `process.execPath`.
|
| 112 |
+
Used to infer the
|
| 113 |
+
`globalPrefix`.
|
| 114 |
+
- `env` Optional, defaults to `process.env`.
|
| 115 |
+
Source of the environment variables for configuration.
|
| 116 |
+
- `argv` Optional, defaults to `process.argv`.
|
| 117 |
+
Source of the CLI options used for configuration.
|
| 118 |
+
|
| 119 |
+
Returns a `config` object, which is not yet loaded.
|
| 120 |
+
|
| 121 |
+
Fields:
|
| 122 |
+
|
| 123 |
+
- `config.globalPrefix` The prefix for `global` operations.
|
| 124 |
+
Set by the
|
| 125 |
+
`prefix` config value, or defaults based on the location of the
|
| 126 |
+
`execPath` option.
|
| 127 |
+
- `config.localPrefix` The prefix for `local` operations.
|
| 128 |
+
Set by the
|
| 129 |
+
`prefix` config value on the CLI only, or defaults to either the `cwd` or its nearest ancestor containing a `node_modules` folder or `package.json` file.
|
| 130 |
+
- `config.sources` A read-only `Map` of the file (or a comment, if no file found, or relevant) to the config level loaded from that source.
|
| 131 |
+
- `config.data` A `Map` of config level to `ConfigData` objects.
|
| 132 |
+
These objects should not be modified directly under any circumstances.
|
| 133 |
+
- `source` The source where this data was loaded from.
|
| 134 |
+
- `raw` The raw data used to generate this config data, as it was parsed initially from the environment, config file, or CLI options.
|
| 135 |
+
- `data` The data object reflecting the inheritance of configs up to this point in the chain.
|
| 136 |
+
- `loadError` Any errors encountered that prevented the loading of this config data.
|
| 137 |
+
- `config.list` A list sorted in priority of all the config data objects in the prototype chain.
|
| 138 |
+
`config.list[0]` is the `cli` level,
|
| 139 |
+
`config.list[1]` is the `env` level, and so on.
|
| 140 |
+
- `cwd` The `cwd` param
|
| 141 |
+
- `env` The `env` param
|
| 142 |
+
- `argv` The `argv` param
|
| 143 |
+
- `execPath` The `execPath` param
|
| 144 |
+
- `platform` The `platform` param
|
| 145 |
+
- `defaults` The `defaults` param
|
| 146 |
+
- `shorthands` The `shorthands` param
|
| 147 |
+
- `types` The `types` param
|
| 148 |
+
- `npmPath` The `npmPath` param
|
| 149 |
+
- `globalPrefix` The effective `globalPrefix`
|
| 150 |
+
- `localPrefix` The effective `localPrefix`
|
| 151 |
+
- `prefix` If `config.get('global')` is true, then `globalPrefix`, otherwise `localPrefix`
|
| 152 |
+
- `home` The user's home directory, found by looking at `env.HOME` or calling `os.homedir()`.
|
| 153 |
+
- `loaded` A boolean indicating whether or not configs are loaded
|
| 154 |
+
- `valid` A getter that returns `true` if all the config objects are valid.
|
| 155 |
+
Any data objects that have been modified with `config.set(...)` will be re-evaluated when `config.valid` is read.
|
| 156 |
+
|
| 157 |
+
### `config.load()`
|
| 158 |
+
|
| 159 |
+
Load configuration from the various sources of information.
|
| 160 |
+
|
| 161 |
+
Returns a `Promise` that resolves when configuration is loaded, and fails if a fatal error is encountered.
|
| 162 |
+
|
| 163 |
+
### `config.find(key)`
|
| 164 |
+
|
| 165 |
+
Find the effective place in the configuration levels a given key is set.
|
| 166 |
+
Returns one of: `cli`, `env`, `project`, `user`, `global`, `builtin`, or
|
| 167 |
+
`default`.
|
| 168 |
+
|
| 169 |
+
Returns `null` if the key is not set.
|
| 170 |
+
|
| 171 |
+
### `config.get(key, where = 'cli')`
|
| 172 |
+
|
| 173 |
+
Load the given key from the config stack.
|
| 174 |
+
|
| 175 |
+
### `config.set(key, value, where = 'cli')`
|
| 176 |
+
|
| 177 |
+
Set the key to the specified value, at the specified level in the config stack.
|
| 178 |
+
|
| 179 |
+
### `config.delete(key, where = 'cli')`
|
| 180 |
+
|
| 181 |
+
Delete the configuration key from the specified level in the config stack.
|
| 182 |
+
|
| 183 |
+
### `config.validate(where)`
|
| 184 |
+
|
| 185 |
+
Verify that all known configuration options are set to valid values, and log a warning if they are invalid.
|
| 186 |
+
|
| 187 |
+
Invalid auth options will cause this method to throw an error with a `code` property of `ERR_INVALID_AUTH`, and a `problems` property listing the specific concerns with the current configuration.
|
| 188 |
+
|
| 189 |
+
If `where` is not set, then all config objects are validated.
|
| 190 |
+
|
| 191 |
+
Returns `true` if all configs are valid.
|
| 192 |
+
|
| 193 |
+
Note that it's usually enough (and more efficient) to just check
|
| 194 |
+
`config.valid`, since each data object is marked for re-evaluation on every
|
| 195 |
+
`config.set()` operation.
|
| 196 |
+
|
| 197 |
+
### `config.repair(problems)`
|
| 198 |
+
|
| 199 |
+
Accept an optional array of problems (as thrown by `config.validate()`) and perform the necessary steps to resolve them.
|
| 200 |
+
If no problems are provided, this method will call `config.validate()` internally to retrieve them.
|
| 201 |
+
|
| 202 |
+
Note that you must `await config.save('user')` in order to persist the changes.
|
| 203 |
+
|
| 204 |
+
### `config.isDefault(key)`
|
| 205 |
+
|
| 206 |
+
Returns `true` if the value is coming directly from the default definitions, if the current value for the key config is coming from any other source, returns `false`.
|
| 207 |
+
|
| 208 |
+
This method can be used for avoiding or tweaking default values, e.g:
|
| 209 |
+
|
| 210 |
+
> Given a global default definition of foo='foo' it's possible to read that value such as:
|
| 211 |
+
>
|
| 212 |
+
> ```js
|
| 213 |
+
> const save = config.get('foo')
|
| 214 |
+
> ```
|
| 215 |
+
>
|
| 216 |
+
> Now in a different place of your app it's possible to avoid using the `foo` default value, by checking to see if the current config value is currently one that was defined by the default definitions:
|
| 217 |
+
>
|
| 218 |
+
> ```js
|
| 219 |
+
> const save = config.isDefault('foo') ? 'bar' : config.get('foo')
|
| 220 |
+
> ```
|
| 221 |
+
|
| 222 |
+
### `config.save(where)`
|
| 223 |
+
|
| 224 |
+
Save the config file specified by the `where` param.
|
| 225 |
+
Must be one of
|
| 226 |
+
`project`, `user`, `global`, `builtin`.
|
node24/node_modules/npm/node_modules/@npmcli/config/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@npmcli/config",
|
| 3 |
+
"version": "10.8.1",
|
| 4 |
+
"files": [
|
| 5 |
+
"bin/",
|
| 6 |
+
"lib/"
|
| 7 |
+
],
|
| 8 |
+
"main": "lib/index.js",
|
| 9 |
+
"description": "Configuration management for the npm cli",
|
| 10 |
+
"repository": {
|
| 11 |
+
"type": "git",
|
| 12 |
+
"url": "git+https://github.com/npm/cli.git",
|
| 13 |
+
"directory": "workspaces/config"
|
| 14 |
+
},
|
| 15 |
+
"author": "GitHub Inc.",
|
| 16 |
+
"license": "ISC",
|
| 17 |
+
"scripts": {
|
| 18 |
+
"test": "tap",
|
| 19 |
+
"snap": "tap",
|
| 20 |
+
"lint": "npm run eslint",
|
| 21 |
+
"postlint": "template-oss-check",
|
| 22 |
+
"lintfix": "npm run eslint -- --fix",
|
| 23 |
+
"posttest": "npm run lint",
|
| 24 |
+
"template-oss-apply": "template-oss-apply --force",
|
| 25 |
+
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
|
| 26 |
+
},
|
| 27 |
+
"tap": {
|
| 28 |
+
"nyc-arg": [
|
| 29 |
+
"--exclude",
|
| 30 |
+
"tap-snapshots/**"
|
| 31 |
+
]
|
| 32 |
+
},
|
| 33 |
+
"devDependencies": {
|
| 34 |
+
"@npmcli/eslint-config": "^5.0.1",
|
| 35 |
+
"@npmcli/mock-globals": "^1.0.0",
|
| 36 |
+
"@npmcli/template-oss": "4.29.0",
|
| 37 |
+
"tap": "^16.3.8"
|
| 38 |
+
},
|
| 39 |
+
"dependencies": {
|
| 40 |
+
"@npmcli/map-workspaces": "^5.0.0",
|
| 41 |
+
"@npmcli/package-json": "^7.0.0",
|
| 42 |
+
"ci-info": "^4.0.0",
|
| 43 |
+
"ini": "^6.0.0",
|
| 44 |
+
"nopt": "^9.0.0",
|
| 45 |
+
"proc-log": "^6.0.0",
|
| 46 |
+
"semver": "^7.3.5",
|
| 47 |
+
"walk-up-path": "^4.0.0"
|
| 48 |
+
},
|
| 49 |
+
"engines": {
|
| 50 |
+
"node": "^20.17.0 || >=22.9.0"
|
| 51 |
+
},
|
| 52 |
+
"templateOSS": {
|
| 53 |
+
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
| 54 |
+
"version": "4.29.0",
|
| 55 |
+
"content": "../../scripts/template-oss/index.js"
|
| 56 |
+
}
|
| 57 |
+
}
|
node24/node_modules/npm/node_modules/@npmcli/fs/LICENSE.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!-- This file is automatically added by @npmcli/template-oss. Do not edit. -->
|
| 2 |
+
|
| 3 |
+
ISC License
|
| 4 |
+
|
| 5 |
+
Copyright npm, Inc.
|
| 6 |
+
|
| 7 |
+
Permission to use, copy, modify, and/or distribute this
|
| 8 |
+
software for any purpose with or without fee is hereby
|
| 9 |
+
granted, provided that the above copyright notice and this
|
| 10 |
+
permission notice appear in all copies.
|
| 11 |
+
|
| 12 |
+
THE SOFTWARE IS PROVIDED "AS IS" AND NPM DISCLAIMS ALL
|
| 13 |
+
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
|
| 14 |
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
|
| 15 |
+
EVENT SHALL NPM BE LIABLE FOR ANY SPECIAL, DIRECT,
|
| 16 |
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
| 17 |
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 18 |
+
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
| 19 |
+
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
|
| 20 |
+
USE OR PERFORMANCE OF THIS SOFTWARE.
|
node24/node_modules/npm/node_modules/@npmcli/fs/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@npmcli/fs",
|
| 3 |
+
"version": "5.0.0",
|
| 4 |
+
"description": "filesystem utilities for the npm cli",
|
| 5 |
+
"main": "lib/index.js",
|
| 6 |
+
"files": [
|
| 7 |
+
"bin/",
|
| 8 |
+
"lib/"
|
| 9 |
+
],
|
| 10 |
+
"scripts": {
|
| 11 |
+
"snap": "tap",
|
| 12 |
+
"test": "tap",
|
| 13 |
+
"npmclilint": "npmcli-lint",
|
| 14 |
+
"lint": "npm run eslint",
|
| 15 |
+
"lintfix": "npm run eslint -- --fix",
|
| 16 |
+
"posttest": "npm run lint",
|
| 17 |
+
"postsnap": "npm run lintfix --",
|
| 18 |
+
"postlint": "template-oss-check",
|
| 19 |
+
"template-oss-apply": "template-oss-apply --force",
|
| 20 |
+
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
|
| 21 |
+
},
|
| 22 |
+
"repository": {
|
| 23 |
+
"type": "git",
|
| 24 |
+
"url": "git+https://github.com/npm/fs.git"
|
| 25 |
+
},
|
| 26 |
+
"keywords": [
|
| 27 |
+
"npm",
|
| 28 |
+
"oss"
|
| 29 |
+
],
|
| 30 |
+
"author": "GitHub Inc.",
|
| 31 |
+
"license": "ISC",
|
| 32 |
+
"devDependencies": {
|
| 33 |
+
"@npmcli/eslint-config": "^5.0.0",
|
| 34 |
+
"@npmcli/template-oss": "4.27.1",
|
| 35 |
+
"tap": "^16.0.1"
|
| 36 |
+
},
|
| 37 |
+
"dependencies": {
|
| 38 |
+
"semver": "^7.3.5"
|
| 39 |
+
},
|
| 40 |
+
"engines": {
|
| 41 |
+
"node": "^20.17.0 || >=22.9.0"
|
| 42 |
+
},
|
| 43 |
+
"templateOSS": {
|
| 44 |
+
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
| 45 |
+
"version": "4.27.1",
|
| 46 |
+
"publish": true
|
| 47 |
+
},
|
| 48 |
+
"tap": {
|
| 49 |
+
"nyc-arg": [
|
| 50 |
+
"--exclude",
|
| 51 |
+
"tap-snapshots/**"
|
| 52 |
+
]
|
| 53 |
+
}
|
| 54 |
+
}
|
node24/node_modules/npm/node_modules/@npmcli/git/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
The ISC License
|
| 2 |
+
|
| 3 |
+
Copyright (c) npm, Inc.
|
| 4 |
+
|
| 5 |
+
Permission to use, copy, modify, and/or distribute this software for any
|
| 6 |
+
purpose with or without fee is hereby granted, provided that the above
|
| 7 |
+
copyright notice and this permission notice appear in all copies.
|
| 8 |
+
|
| 9 |
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE NPM DISCLAIMS ALL WARRANTIES WITH
|
| 10 |
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
| 11 |
+
FITNESS. IN NO EVENT SHALL THE NPM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT,
|
| 12 |
+
OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
| 13 |
+
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 14 |
+
ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
| 15 |
+
SOFTWARE.
|
node24/node_modules/npm/node_modules/@npmcli/git/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@npmcli/git",
|
| 3 |
+
"version": "7.0.2",
|
| 4 |
+
"main": "lib/index.js",
|
| 5 |
+
"files": [
|
| 6 |
+
"bin/",
|
| 7 |
+
"lib/"
|
| 8 |
+
],
|
| 9 |
+
"description": "a util for spawning git from npm CLI contexts",
|
| 10 |
+
"repository": {
|
| 11 |
+
"type": "git",
|
| 12 |
+
"url": "git+https://github.com/npm/git.git"
|
| 13 |
+
},
|
| 14 |
+
"author": "GitHub Inc.",
|
| 15 |
+
"license": "ISC",
|
| 16 |
+
"scripts": {
|
| 17 |
+
"lint": "npm run eslint",
|
| 18 |
+
"snap": "tap",
|
| 19 |
+
"test": "tap",
|
| 20 |
+
"posttest": "npm run lint",
|
| 21 |
+
"postlint": "template-oss-check",
|
| 22 |
+
"lintfix": "npm run eslint -- --fix",
|
| 23 |
+
"template-oss-apply": "template-oss-apply --force",
|
| 24 |
+
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
|
| 25 |
+
},
|
| 26 |
+
"tap": {
|
| 27 |
+
"timeout": 600,
|
| 28 |
+
"nyc-arg": [
|
| 29 |
+
"--exclude",
|
| 30 |
+
"tap-snapshots/**"
|
| 31 |
+
]
|
| 32 |
+
},
|
| 33 |
+
"devDependencies": {
|
| 34 |
+
"@npmcli/eslint-config": "^5.0.0",
|
| 35 |
+
"@npmcli/template-oss": "4.24.1",
|
| 36 |
+
"npm-package-arg": "^13.0.0",
|
| 37 |
+
"slash": "^3.0.0",
|
| 38 |
+
"tap": "^16.0.1"
|
| 39 |
+
},
|
| 40 |
+
"dependencies": {
|
| 41 |
+
"@gar/promise-retry": "^1.0.0",
|
| 42 |
+
"@npmcli/promise-spawn": "^9.0.0",
|
| 43 |
+
"ini": "^6.0.0",
|
| 44 |
+
"lru-cache": "^11.2.1",
|
| 45 |
+
"npm-pick-manifest": "^11.0.1",
|
| 46 |
+
"proc-log": "^6.0.0",
|
| 47 |
+
"semver": "^7.3.5",
|
| 48 |
+
"which": "^6.0.0"
|
| 49 |
+
},
|
| 50 |
+
"engines": {
|
| 51 |
+
"node": "^20.17.0 || >=22.9.0"
|
| 52 |
+
},
|
| 53 |
+
"templateOSS": {
|
| 54 |
+
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
| 55 |
+
"version": "4.24.1",
|
| 56 |
+
"publish": true
|
| 57 |
+
}
|
| 58 |
+
}
|
node24/node_modules/npm/node_modules/@npmcli/installed-package-contents/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
The ISC License
|
| 2 |
+
|
| 3 |
+
Copyright (c) npm, Inc.
|
| 4 |
+
|
| 5 |
+
Permission to use, copy, modify, and/or distribute this software for any
|
| 6 |
+
purpose with or without fee is hereby granted, provided that the above
|
| 7 |
+
copyright notice and this permission notice appear in all copies.
|
| 8 |
+
|
| 9 |
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
| 10 |
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
| 11 |
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
| 12 |
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
| 13 |
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
| 14 |
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
| 15 |
+
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
node24/node_modules/npm/node_modules/@npmcli/installed-package-contents/README.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# @npmcli/installed-package-contents
|
| 2 |
+
|
| 3 |
+
Get the list of files installed in a package in node_modules, including
|
| 4 |
+
bundled dependencies.
|
| 5 |
+
|
| 6 |
+
This is useful if you want to remove a package node from the tree _without_
|
| 7 |
+
removing its child nodes, for example to extract a new version of the
|
| 8 |
+
dependency into place safely.
|
| 9 |
+
|
| 10 |
+
It's sort of the reflection of [npm-packlist](http://npm.im/npm-packlist),
|
| 11 |
+
but for listing out the _installed_ files rather than the files that _will_
|
| 12 |
+
be installed. This is of course a much simpler operation, because we don't
|
| 13 |
+
have to handle ignore files or package.json `files` lists.
|
| 14 |
+
|
| 15 |
+
## USAGE
|
| 16 |
+
|
| 17 |
+
```js
|
| 18 |
+
// programmatic usage
|
| 19 |
+
const pkgContents = require('@npmcli/installed-package-contents')
|
| 20 |
+
|
| 21 |
+
pkgContents({ path: 'node_modules/foo', depth: 1 }).then(files => {
|
| 22 |
+
// files is an array of items that need to be passed to
|
| 23 |
+
// rimraf or moved out of the way to make the folder empty
|
| 24 |
+
// if foo bundled dependencies, those will be included.
|
| 25 |
+
// It will not traverse into child directories, because we set
|
| 26 |
+
// depth:1 in the options.
|
| 27 |
+
// If the folder doesn't exist, this returns an empty array.
|
| 28 |
+
})
|
| 29 |
+
|
| 30 |
+
pkgContents({ path: 'node_modules/foo', depth: Infinity }).then(files => {
|
| 31 |
+
// setting depth:Infinity tells it to keep walking forever
|
| 32 |
+
// until it hits something that isn't a directory, so we'll
|
| 33 |
+
// just get the list of all files, but not their containing
|
| 34 |
+
// directories.
|
| 35 |
+
})
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
As a CLI:
|
| 39 |
+
|
| 40 |
+
```bash
|
| 41 |
+
$ installed-package-contents node_modules/bundle-some -d1
|
| 42 |
+
node_modules/.bin/some
|
| 43 |
+
node_modules/bundle-some/package.json
|
| 44 |
+
node_modules/bundle-some/node_modules/@scope/baz
|
| 45 |
+
node_modules/bundle-some/node_modules/.bin/foo
|
| 46 |
+
node_modules/bundle-some/node_modules/foo
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
CLI options:
|
| 50 |
+
|
| 51 |
+
```
|
| 52 |
+
Usage:
|
| 53 |
+
installed-package-contents <path> [-d<n> --depth=<n>]
|
| 54 |
+
|
| 55 |
+
Lists the files installed for a package specified by <path>.
|
| 56 |
+
|
| 57 |
+
Options:
|
| 58 |
+
-d<n> --depth=<n> Provide a numeric value ("Infinity" is allowed)
|
| 59 |
+
to specify how deep in the file tree to traverse.
|
| 60 |
+
Default=1
|
| 61 |
+
-h --help Show this usage information
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
## OPTIONS
|
| 65 |
+
|
| 66 |
+
* `depth` Number, default `1`. How deep to traverse through folders to get
|
| 67 |
+
contents. Typically you'd want to set this to either `1` (to get the
|
| 68 |
+
surface files and folders) or `Infinity` (to get all files), but any
|
| 69 |
+
other positive number is supported as well. If set to `0` or a
|
| 70 |
+
negative number, returns the path provided and (if it is a package) its
|
| 71 |
+
set of linked bins.
|
| 72 |
+
* `path` Required. Path to the package in `node_modules` where traversal
|
| 73 |
+
should begin.
|
| 74 |
+
|
| 75 |
+
## RETURN VALUE
|
| 76 |
+
|
| 77 |
+
A Promise that resolves to an array of fully-resolved files and folders
|
| 78 |
+
matching the criteria. This includes all bundled dependencies in
|
| 79 |
+
`node_modules`, and any linked executables in `node_modules/.bin` that the
|
| 80 |
+
package caused to be installed.
|
| 81 |
+
|
| 82 |
+
An empty or missing package folder will return an empty array. Empty
|
| 83 |
+
directories _within_ package contents are listed, even if the `depth`
|
| 84 |
+
argument would cause them to be traversed into.
|
| 85 |
+
|
| 86 |
+
## CAVEAT
|
| 87 |
+
|
| 88 |
+
If using this module to generate a list of files that should be recursively
|
| 89 |
+
removed to clear away the package, note that this will leave empty
|
| 90 |
+
directories behind in certain cases:
|
| 91 |
+
|
| 92 |
+
- If all child packages are bundled dependencies, then the
|
| 93 |
+
`node_modules` folder will remain.
|
| 94 |
+
- If all child packages within a given scope were bundled dependencies,
|
| 95 |
+
then the `node_modules/@scope` folder will remain.
|
| 96 |
+
- If all linked bin scripts were removed, then an empty `node_modules/.bin`
|
| 97 |
+
folder will remain.
|
| 98 |
+
|
| 99 |
+
In the interest of speed and algorithmic complexity, this module does _not_
|
| 100 |
+
do a subsequent readdir to see if it would remove all directory entries,
|
| 101 |
+
though it would be easier to look at if it returned `node_modules` or
|
| 102 |
+
`.bin` in that case rather than the contents. However, if the intent is to
|
| 103 |
+
pass these arguments to `rimraf`, it hardly makes sense to do _two_
|
| 104 |
+
`readdir` calls just so that we can have the luxury of having to make a
|
| 105 |
+
third.
|
| 106 |
+
|
| 107 |
+
Since the primary use case is to delete a package's contents so that they
|
| 108 |
+
can be re-filled with a new version of that package, this caveat does not
|
| 109 |
+
pose a problem. Empty directories are already ignored by both npm and git.
|
node24/node_modules/npm/node_modules/@npmcli/installed-package-contents/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@npmcli/installed-package-contents",
|
| 3 |
+
"version": "4.0.0",
|
| 4 |
+
"description": "Get the list of files installed in a package in node_modules, including bundled dependencies",
|
| 5 |
+
"author": "GitHub Inc.",
|
| 6 |
+
"main": "lib/index.js",
|
| 7 |
+
"bin": {
|
| 8 |
+
"installed-package-contents": "bin/index.js"
|
| 9 |
+
},
|
| 10 |
+
"license": "ISC",
|
| 11 |
+
"scripts": {
|
| 12 |
+
"test": "tap",
|
| 13 |
+
"snap": "tap",
|
| 14 |
+
"lint": "npm run eslint",
|
| 15 |
+
"postlint": "template-oss-check",
|
| 16 |
+
"template-oss-apply": "template-oss-apply --force",
|
| 17 |
+
"lintfix": "npm run eslint -- --fix",
|
| 18 |
+
"posttest": "npm run lint",
|
| 19 |
+
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
|
| 20 |
+
},
|
| 21 |
+
"devDependencies": {
|
| 22 |
+
"@npmcli/eslint-config": "^5.0.0",
|
| 23 |
+
"@npmcli/template-oss": "4.27.1",
|
| 24 |
+
"tap": "^16.3.0"
|
| 25 |
+
},
|
| 26 |
+
"dependencies": {
|
| 27 |
+
"npm-bundled": "^5.0.0",
|
| 28 |
+
"npm-normalize-package-bin": "^5.0.0"
|
| 29 |
+
},
|
| 30 |
+
"repository": {
|
| 31 |
+
"type": "git",
|
| 32 |
+
"url": "git+https://github.com/npm/installed-package-contents.git"
|
| 33 |
+
},
|
| 34 |
+
"files": [
|
| 35 |
+
"bin/",
|
| 36 |
+
"lib/"
|
| 37 |
+
],
|
| 38 |
+
"engines": {
|
| 39 |
+
"node": "^20.17.0 || >=22.9.0"
|
| 40 |
+
},
|
| 41 |
+
"templateOSS": {
|
| 42 |
+
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
| 43 |
+
"version": "4.27.1",
|
| 44 |
+
"publish": true
|
| 45 |
+
},
|
| 46 |
+
"tap": {
|
| 47 |
+
"nyc-arg": [
|
| 48 |
+
"--exclude",
|
| 49 |
+
"tap-snapshots/**"
|
| 50 |
+
]
|
| 51 |
+
}
|
| 52 |
+
}
|
node24/node_modules/npm/node_modules/@npmcli/map-workspaces/LICENSE.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!-- This file is automatically added by @npmcli/template-oss. Do not edit. -->
|
| 2 |
+
|
| 3 |
+
ISC License
|
| 4 |
+
|
| 5 |
+
Copyright npm, Inc.
|
| 6 |
+
|
| 7 |
+
Permission to use, copy, modify, and/or distribute this
|
| 8 |
+
software for any purpose with or without fee is hereby
|
| 9 |
+
granted, provided that the above copyright notice and this
|
| 10 |
+
permission notice appear in all copies.
|
| 11 |
+
|
| 12 |
+
THE SOFTWARE IS PROVIDED "AS IS" AND NPM DISCLAIMS ALL
|
| 13 |
+
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
|
| 14 |
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
|
| 15 |
+
EVENT SHALL NPM BE LIABLE FOR ANY SPECIAL, DIRECT,
|
| 16 |
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
| 17 |
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 18 |
+
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
| 19 |
+
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
|
| 20 |
+
USE OR PERFORMANCE OF THIS SOFTWARE.
|
node24/node_modules/npm/node_modules/@npmcli/map-workspaces/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@npmcli/map-workspaces",
|
| 3 |
+
"version": "5.0.3",
|
| 4 |
+
"main": "lib/index.js",
|
| 5 |
+
"files": [
|
| 6 |
+
"bin/",
|
| 7 |
+
"lib/"
|
| 8 |
+
],
|
| 9 |
+
"engines": {
|
| 10 |
+
"node": "^20.17.0 || >=22.9.0"
|
| 11 |
+
},
|
| 12 |
+
"description": "Retrieves a name:pathname Map for a given workspaces config",
|
| 13 |
+
"repository": {
|
| 14 |
+
"type": "git",
|
| 15 |
+
"url": "git+https://github.com/npm/map-workspaces.git"
|
| 16 |
+
},
|
| 17 |
+
"keywords": [
|
| 18 |
+
"npm",
|
| 19 |
+
"npmcli",
|
| 20 |
+
"libnpm",
|
| 21 |
+
"cli",
|
| 22 |
+
"workspaces",
|
| 23 |
+
"map-workspaces"
|
| 24 |
+
],
|
| 25 |
+
"author": "GitHub Inc.",
|
| 26 |
+
"license": "ISC",
|
| 27 |
+
"scripts": {
|
| 28 |
+
"lint": "npm run eslint",
|
| 29 |
+
"pretest": "npm run lint",
|
| 30 |
+
"test": "tap",
|
| 31 |
+
"snap": "tap",
|
| 32 |
+
"postlint": "template-oss-check",
|
| 33 |
+
"lintfix": "npm run eslint -- --fix",
|
| 34 |
+
"posttest": "npm run lint",
|
| 35 |
+
"template-oss-apply": "template-oss-apply --force",
|
| 36 |
+
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
|
| 37 |
+
},
|
| 38 |
+
"tap": {
|
| 39 |
+
"check-coverage": true,
|
| 40 |
+
"nyc-arg": [
|
| 41 |
+
"--exclude",
|
| 42 |
+
"tap-snapshots/**"
|
| 43 |
+
]
|
| 44 |
+
},
|
| 45 |
+
"devDependencies": {
|
| 46 |
+
"@npmcli/eslint-config": "^6.0.0",
|
| 47 |
+
"@npmcli/template-oss": "4.28.0",
|
| 48 |
+
"tap": "^16.0.1"
|
| 49 |
+
},
|
| 50 |
+
"dependencies": {
|
| 51 |
+
"@npmcli/name-from-folder": "^4.0.0",
|
| 52 |
+
"@npmcli/package-json": "^7.0.0",
|
| 53 |
+
"glob": "^13.0.0",
|
| 54 |
+
"minimatch": "^10.0.3"
|
| 55 |
+
},
|
| 56 |
+
"templateOSS": {
|
| 57 |
+
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
| 58 |
+
"version": "4.28.0",
|
| 59 |
+
"publish": "true"
|
| 60 |
+
}
|
| 61 |
+
}
|
node24/node_modules/npm/node_modules/@npmcli/metavuln-calculator/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
The ISC License
|
| 2 |
+
|
| 3 |
+
Copyright (c) npm, Inc.
|
| 4 |
+
|
| 5 |
+
Permission to use, copy, modify, and/or distribute this software for any
|
| 6 |
+
purpose with or without fee is hereby granted, provided that the above
|
| 7 |
+
copyright notice and this permission notice appear in all copies.
|
| 8 |
+
|
| 9 |
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
| 10 |
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
| 11 |
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
| 12 |
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
| 13 |
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
| 14 |
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
| 15 |
+
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
node24/node_modules/npm/node_modules/@npmcli/metavuln-calculator/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@npmcli/metavuln-calculator",
|
| 3 |
+
"version": "9.0.3",
|
| 4 |
+
"main": "lib/index.js",
|
| 5 |
+
"files": [
|
| 6 |
+
"bin/",
|
| 7 |
+
"lib/"
|
| 8 |
+
],
|
| 9 |
+
"description": "Calculate meta-vulnerabilities from package security advisories",
|
| 10 |
+
"repository": {
|
| 11 |
+
"type": "git",
|
| 12 |
+
"url": "git+https://github.com/npm/metavuln-calculator.git"
|
| 13 |
+
},
|
| 14 |
+
"author": "GitHub Inc.",
|
| 15 |
+
"license": "ISC",
|
| 16 |
+
"scripts": {
|
| 17 |
+
"test": "tap",
|
| 18 |
+
"posttest": "npm run lint",
|
| 19 |
+
"snap": "tap",
|
| 20 |
+
"postsnap": "npm run lint",
|
| 21 |
+
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"",
|
| 22 |
+
"lint": "npm run eslint",
|
| 23 |
+
"lintfix": "npm run eslint -- --fix",
|
| 24 |
+
"postlint": "template-oss-check",
|
| 25 |
+
"template-oss-apply": "template-oss-apply --force"
|
| 26 |
+
},
|
| 27 |
+
"tap": {
|
| 28 |
+
"check-coverage": true,
|
| 29 |
+
"coverage-map": "map.js",
|
| 30 |
+
"nyc-arg": [
|
| 31 |
+
"--exclude",
|
| 32 |
+
"tap-snapshots/**"
|
| 33 |
+
]
|
| 34 |
+
},
|
| 35 |
+
"devDependencies": {
|
| 36 |
+
"@npmcli/eslint-config": "^5.0.0",
|
| 37 |
+
"@npmcli/template-oss": "4.27.1",
|
| 38 |
+
"require-inject": "^1.4.4",
|
| 39 |
+
"tap": "^16.0.1"
|
| 40 |
+
},
|
| 41 |
+
"dependencies": {
|
| 42 |
+
"cacache": "^20.0.0",
|
| 43 |
+
"json-parse-even-better-errors": "^5.0.0",
|
| 44 |
+
"pacote": "^21.0.0",
|
| 45 |
+
"proc-log": "^6.0.0",
|
| 46 |
+
"semver": "^7.3.5"
|
| 47 |
+
},
|
| 48 |
+
"engines": {
|
| 49 |
+
"node": "^20.17.0 || >=22.9.0"
|
| 50 |
+
},
|
| 51 |
+
"templateOSS": {
|
| 52 |
+
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
| 53 |
+
"version": "4.27.1",
|
| 54 |
+
"publish": "true",
|
| 55 |
+
"ciVersions": [
|
| 56 |
+
"16.14.0",
|
| 57 |
+
"16.x",
|
| 58 |
+
"18.0.0",
|
| 59 |
+
"18.x"
|
| 60 |
+
]
|
| 61 |
+
}
|
| 62 |
+
}
|
node24/node_modules/npm/node_modules/@npmcli/name-from-folder/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
The ISC License
|
| 2 |
+
|
| 3 |
+
Copyright npm, Inc.
|
| 4 |
+
|
| 5 |
+
Permission to use, copy, modify, and/or distribute this software for any
|
| 6 |
+
purpose with or without fee is hereby granted, provided that the above
|
| 7 |
+
copyright notice and this permission notice appear in all copies.
|
| 8 |
+
|
| 9 |
+
THE SOFTWARE IS PROVIDED "AS IS" AND NPM DISCLAIMS ALL WARRANTIES WITH REGARD
|
| 10 |
+
TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
| 11 |
+
FITNESS. IN NO EVENT SHALL NPM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
|
| 12 |
+
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
| 13 |
+
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 14 |
+
ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
| 15 |
+
SOFTWARE.
|
node24/node_modules/npm/node_modules/@npmcli/name-from-folder/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@npmcli/name-from-folder",
|
| 3 |
+
"version": "4.0.0",
|
| 4 |
+
"files": [
|
| 5 |
+
"bin/",
|
| 6 |
+
"lib/"
|
| 7 |
+
],
|
| 8 |
+
"main": "lib/index.js",
|
| 9 |
+
"description": "Get the package name from a folder path",
|
| 10 |
+
"repository": {
|
| 11 |
+
"type": "git",
|
| 12 |
+
"url": "git+https://github.com/npm/name-from-folder.git"
|
| 13 |
+
},
|
| 14 |
+
"author": "GitHub Inc.",
|
| 15 |
+
"license": "ISC",
|
| 16 |
+
"scripts": {
|
| 17 |
+
"test": "tap",
|
| 18 |
+
"snap": "tap",
|
| 19 |
+
"lint": "npm run eslint",
|
| 20 |
+
"postlint": "template-oss-check",
|
| 21 |
+
"template-oss-apply": "template-oss-apply --force",
|
| 22 |
+
"lintfix": "npm run eslint -- --fix",
|
| 23 |
+
"posttest": "npm run lint",
|
| 24 |
+
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
|
| 25 |
+
},
|
| 26 |
+
"devDependencies": {
|
| 27 |
+
"@npmcli/eslint-config": "^5.0.0",
|
| 28 |
+
"@npmcli/template-oss": "4.27.1",
|
| 29 |
+
"tap": "^16.3.2"
|
| 30 |
+
},
|
| 31 |
+
"engines": {
|
| 32 |
+
"node": "^20.17.0 || >=22.9.0"
|
| 33 |
+
},
|
| 34 |
+
"templateOSS": {
|
| 35 |
+
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
| 36 |
+
"version": "4.27.1",
|
| 37 |
+
"publish": true
|
| 38 |
+
},
|
| 39 |
+
"tap": {
|
| 40 |
+
"nyc-arg": [
|
| 41 |
+
"--exclude",
|
| 42 |
+
"tap-snapshots/**"
|
| 43 |
+
]
|
| 44 |
+
}
|
| 45 |
+
}
|
node24/node_modules/npm/node_modules/@npmcli/node-gyp/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
ISC License:
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2023 by GitHub Inc.
|
| 4 |
+
|
| 5 |
+
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
| 6 |
+
|
| 7 |
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
node24/node_modules/npm/node_modules/@sigstore/bundle/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
Apache License
|
| 3 |
+
Version 2.0, January 2004
|
| 4 |
+
http://www.apache.org/licenses/
|
| 5 |
+
|
| 6 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 7 |
+
|
| 8 |
+
1. Definitions.
|
| 9 |
+
|
| 10 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 11 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 12 |
+
|
| 13 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 14 |
+
the copyright owner that is granting the License.
|
| 15 |
+
|
| 16 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 17 |
+
other entities that control, are controlled by, or are under common
|
| 18 |
+
control with that entity. For the purposes of this definition,
|
| 19 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 20 |
+
direction or management of such entity, whether by contract or
|
| 21 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 22 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 23 |
+
|
| 24 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 25 |
+
exercising permissions granted by this License.
|
| 26 |
+
|
| 27 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 28 |
+
including but not limited to software source code, documentation
|
| 29 |
+
source, and configuration files.
|
| 30 |
+
|
| 31 |
+
"Object" form shall mean any form resulting from mechanical
|
| 32 |
+
transformation or translation of a Source form, including but
|
| 33 |
+
not limited to compiled object code, generated documentation,
|
| 34 |
+
and conversions to other media types.
|
| 35 |
+
|
| 36 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 37 |
+
Object form, made available under the License, as indicated by a
|
| 38 |
+
copyright notice that is included in or attached to the work
|
| 39 |
+
(an example is provided in the Appendix below).
|
| 40 |
+
|
| 41 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 42 |
+
form, that is based on (or derived from) the Work and for which the
|
| 43 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 44 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 45 |
+
of this License, Derivative Works shall not include works that remain
|
| 46 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 47 |
+
the Work and Derivative Works thereof.
|
| 48 |
+
|
| 49 |
+
"Contribution" shall mean any work of authorship, including
|
| 50 |
+
the original version of the Work and any modifications or additions
|
| 51 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 52 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 53 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 54 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 55 |
+
means any form of electronic, verbal, or written communication sent
|
| 56 |
+
to the Licensor or its representatives, including but not limited to
|
| 57 |
+
communication on electronic mailing lists, source code control systems,
|
| 58 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 59 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 60 |
+
excluding communication that is conspicuously marked or otherwise
|
| 61 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 62 |
+
|
| 63 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 64 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 65 |
+
subsequently incorporated within the Work.
|
| 66 |
+
|
| 67 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 68 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 69 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 70 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 71 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 72 |
+
Work and such Derivative Works in Source or Object form.
|
| 73 |
+
|
| 74 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 75 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 76 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 77 |
+
(except as stated in this section) patent license to make, have made,
|
| 78 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 79 |
+
where such license applies only to those patent claims licensable
|
| 80 |
+
by such Contributor that are necessarily infringed by their
|
| 81 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 82 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 83 |
+
institute patent litigation against any entity (including a
|
| 84 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 85 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 86 |
+
or contributory patent infringement, then any patent licenses
|
| 87 |
+
granted to You under this License for that Work shall terminate
|
| 88 |
+
as of the date such litigation is filed.
|
| 89 |
+
|
| 90 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 91 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 92 |
+
modifications, and in Source or Object form, provided that You
|
| 93 |
+
meet the following conditions:
|
| 94 |
+
|
| 95 |
+
(a) You must give any other recipients of the Work or
|
| 96 |
+
Derivative Works a copy of this License; and
|
| 97 |
+
|
| 98 |
+
(b) You must cause any modified files to carry prominent notices
|
| 99 |
+
stating that You changed the files; and
|
| 100 |
+
|
| 101 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 102 |
+
that You distribute, all copyright, patent, trademark, and
|
| 103 |
+
attribution notices from the Source form of the Work,
|
| 104 |
+
excluding those notices that do not pertain to any part of
|
| 105 |
+
the Derivative Works; and
|
| 106 |
+
|
| 107 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 108 |
+
distribution, then any Derivative Works that You distribute must
|
| 109 |
+
include a readable copy of the attribution notices contained
|
| 110 |
+
within such NOTICE file, excluding those notices that do not
|
| 111 |
+
pertain to any part of the Derivative Works, in at least one
|
| 112 |
+
of the following places: within a NOTICE text file distributed
|
| 113 |
+
as part of the Derivative Works; within the Source form or
|
| 114 |
+
documentation, if provided along with the Derivative Works; or,
|
| 115 |
+
within a display generated by the Derivative Works, if and
|
| 116 |
+
wherever such third-party notices normally appear. The contents
|
| 117 |
+
of the NOTICE file are for informational purposes only and
|
| 118 |
+
do not modify the License. You may add Your own attribution
|
| 119 |
+
notices within Derivative Works that You distribute, alongside
|
| 120 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 121 |
+
that such additional attribution notices cannot be construed
|
| 122 |
+
as modifying the License.
|
| 123 |
+
|
| 124 |
+
You may add Your own copyright statement to Your modifications and
|
| 125 |
+
may provide additional or different license terms and conditions
|
| 126 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 127 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 128 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 129 |
+
the conditions stated in this License.
|
| 130 |
+
|
| 131 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 132 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 133 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 134 |
+
this License, without any additional terms or conditions.
|
| 135 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 136 |
+
the terms of any separate license agreement you may have executed
|
| 137 |
+
with Licensor regarding such Contributions.
|
| 138 |
+
|
| 139 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 140 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 141 |
+
except as required for reasonable and customary use in describing the
|
| 142 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 143 |
+
|
| 144 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 145 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 146 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 147 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 148 |
+
implied, including, without limitation, any warranties or conditions
|
| 149 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 150 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 151 |
+
appropriateness of using or redistributing the Work and assume any
|
| 152 |
+
risks associated with Your exercise of permissions under this License.
|
| 153 |
+
|
| 154 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 155 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 156 |
+
unless required by applicable law (such as deliberate and grossly
|
| 157 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 158 |
+
liable to You for damages, including any direct, indirect, special,
|
| 159 |
+
incidental, or consequential damages of any character arising as a
|
| 160 |
+
result of this License or out of the use or inability to use the
|
| 161 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 162 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 163 |
+
other commercial damages or losses), even if such Contributor
|
| 164 |
+
has been advised of the possibility of such damages.
|
| 165 |
+
|
| 166 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 167 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 168 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 169 |
+
or other liability obligations and/or rights consistent with this
|
| 170 |
+
License. However, in accepting such obligations, You may act only
|
| 171 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 172 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 173 |
+
defend, and hold each Contributor harmless for any liability
|
| 174 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 175 |
+
of your accepting any such warranty or additional liability.
|
| 176 |
+
|
| 177 |
+
END OF TERMS AND CONDITIONS
|
| 178 |
+
|
| 179 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 180 |
+
|
| 181 |
+
To apply the Apache License to your work, attach the following
|
| 182 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
| 183 |
+
replaced with your own identifying information. (Don't include
|
| 184 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 185 |
+
comment syntax for the file format. We also recommend that a
|
| 186 |
+
file or class name and description of purpose be included on the
|
| 187 |
+
same "printed page" as the copyright notice for easier
|
| 188 |
+
identification within third-party archives.
|
| 189 |
+
|
| 190 |
+
Copyright 2023 The Sigstore Authors
|
| 191 |
+
|
| 192 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 193 |
+
you may not use this file except in compliance with the License.
|
| 194 |
+
You may obtain a copy of the License at
|
| 195 |
+
|
| 196 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 197 |
+
|
| 198 |
+
Unless required by applicable law or agreed to in writing, software
|
| 199 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 200 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 201 |
+
See the License for the specific language governing permissions and
|
| 202 |
+
limitations under the License.
|
node24/node_modules/npm/node_modules/@sigstore/bundle/dist/build.js
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 3 |
+
exports.toMessageSignatureBundle = toMessageSignatureBundle;
|
| 4 |
+
exports.toDSSEBundle = toDSSEBundle;
|
| 5 |
+
/*
|
| 6 |
+
Copyright 2023 The Sigstore Authors.
|
| 7 |
+
|
| 8 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 9 |
+
you may not use this file except in compliance with the License.
|
| 10 |
+
You may obtain a copy of the License at
|
| 11 |
+
|
| 12 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 13 |
+
|
| 14 |
+
Unless required by applicable law or agreed to in writing, software
|
| 15 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 16 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 17 |
+
See the License for the specific language governing permissions and
|
| 18 |
+
limitations under the License.
|
| 19 |
+
*/
|
| 20 |
+
const protobuf_specs_1 = require("@sigstore/protobuf-specs");
|
| 21 |
+
const bundle_1 = require("./bundle");
|
| 22 |
+
// Message signature bundle - $case: 'messageSignature'
|
| 23 |
+
function toMessageSignatureBundle(options) {
|
| 24 |
+
return {
|
| 25 |
+
mediaType: options.certificateChain
|
| 26 |
+
? bundle_1.BUNDLE_V02_MEDIA_TYPE
|
| 27 |
+
: bundle_1.BUNDLE_V03_MEDIA_TYPE,
|
| 28 |
+
content: {
|
| 29 |
+
$case: 'messageSignature',
|
| 30 |
+
messageSignature: {
|
| 31 |
+
messageDigest: {
|
| 32 |
+
algorithm: protobuf_specs_1.HashAlgorithm.SHA2_256,
|
| 33 |
+
digest: options.digest,
|
| 34 |
+
},
|
| 35 |
+
signature: options.signature,
|
| 36 |
+
},
|
| 37 |
+
},
|
| 38 |
+
verificationMaterial: toVerificationMaterial(options),
|
| 39 |
+
};
|
| 40 |
+
}
|
| 41 |
+
// DSSE envelope bundle - $case: 'dsseEnvelope'
|
| 42 |
+
function toDSSEBundle(options) {
|
| 43 |
+
return {
|
| 44 |
+
mediaType: options.certificateChain
|
| 45 |
+
? bundle_1.BUNDLE_V02_MEDIA_TYPE
|
| 46 |
+
: bundle_1.BUNDLE_V03_MEDIA_TYPE,
|
| 47 |
+
content: {
|
| 48 |
+
$case: 'dsseEnvelope',
|
| 49 |
+
dsseEnvelope: toEnvelope(options),
|
| 50 |
+
},
|
| 51 |
+
verificationMaterial: toVerificationMaterial(options),
|
| 52 |
+
};
|
| 53 |
+
}
|
| 54 |
+
function toEnvelope(options) {
|
| 55 |
+
return {
|
| 56 |
+
payloadType: options.artifactType,
|
| 57 |
+
payload: options.artifact,
|
| 58 |
+
signatures: [toSignature(options)],
|
| 59 |
+
};
|
| 60 |
+
}
|
| 61 |
+
function toSignature(options) {
|
| 62 |
+
return {
|
| 63 |
+
keyid: options.keyHint || '',
|
| 64 |
+
sig: options.signature,
|
| 65 |
+
};
|
| 66 |
+
}
|
| 67 |
+
// Verification material
|
| 68 |
+
function toVerificationMaterial(options) {
|
| 69 |
+
return {
|
| 70 |
+
content: toKeyContent(options),
|
| 71 |
+
tlogEntries: [],
|
| 72 |
+
timestampVerificationData: { rfc3161Timestamps: [] },
|
| 73 |
+
};
|
| 74 |
+
}
|
| 75 |
+
function toKeyContent(options) {
|
| 76 |
+
if (options.certificate) {
|
| 77 |
+
if (options.certificateChain) {
|
| 78 |
+
return {
|
| 79 |
+
$case: 'x509CertificateChain',
|
| 80 |
+
x509CertificateChain: {
|
| 81 |
+
certificates: [{ rawBytes: options.certificate }],
|
| 82 |
+
},
|
| 83 |
+
};
|
| 84 |
+
}
|
| 85 |
+
else {
|
| 86 |
+
return {
|
| 87 |
+
$case: 'certificate',
|
| 88 |
+
certificate: { rawBytes: options.certificate },
|
| 89 |
+
};
|
| 90 |
+
}
|
| 91 |
+
}
|
| 92 |
+
else {
|
| 93 |
+
return {
|
| 94 |
+
$case: 'publicKey',
|
| 95 |
+
publicKey: {
|
| 96 |
+
hint: options.keyHint || '',
|
| 97 |
+
},
|
| 98 |
+
};
|
| 99 |
+
}
|
| 100 |
+
}
|
node24/node_modules/npm/node_modules/@sigstore/bundle/dist/bundle.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 3 |
+
exports.BUNDLE_V03_MEDIA_TYPE = exports.BUNDLE_V03_LEGACY_MEDIA_TYPE = exports.BUNDLE_V02_MEDIA_TYPE = exports.BUNDLE_V01_MEDIA_TYPE = void 0;
|
| 4 |
+
exports.isBundleWithCertificateChain = isBundleWithCertificateChain;
|
| 5 |
+
exports.isBundleWithPublicKey = isBundleWithPublicKey;
|
| 6 |
+
exports.isBundleWithMessageSignature = isBundleWithMessageSignature;
|
| 7 |
+
exports.isBundleWithDsseEnvelope = isBundleWithDsseEnvelope;
|
| 8 |
+
exports.BUNDLE_V01_MEDIA_TYPE = 'application/vnd.dev.sigstore.bundle+json;version=0.1';
|
| 9 |
+
exports.BUNDLE_V02_MEDIA_TYPE = 'application/vnd.dev.sigstore.bundle+json;version=0.2';
|
| 10 |
+
exports.BUNDLE_V03_LEGACY_MEDIA_TYPE = 'application/vnd.dev.sigstore.bundle+json;version=0.3';
|
| 11 |
+
exports.BUNDLE_V03_MEDIA_TYPE = 'application/vnd.dev.sigstore.bundle.v0.3+json';
|
| 12 |
+
// Type guards for bundle variants.
|
| 13 |
+
function isBundleWithCertificateChain(b) {
|
| 14 |
+
return b.verificationMaterial.content.$case === 'x509CertificateChain';
|
| 15 |
+
}
|
| 16 |
+
function isBundleWithPublicKey(b) {
|
| 17 |
+
return b.verificationMaterial.content.$case === 'publicKey';
|
| 18 |
+
}
|
| 19 |
+
function isBundleWithMessageSignature(b) {
|
| 20 |
+
return b.content.$case === 'messageSignature';
|
| 21 |
+
}
|
| 22 |
+
function isBundleWithDsseEnvelope(b) {
|
| 23 |
+
return b.content.$case === 'dsseEnvelope';
|
| 24 |
+
}
|
node24/node_modules/npm/node_modules/@sigstore/bundle/dist/error.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 3 |
+
exports.ValidationError = void 0;
|
| 4 |
+
/*
|
| 5 |
+
Copyright 2023 The Sigstore Authors.
|
| 6 |
+
|
| 7 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 8 |
+
you may not use this file except in compliance with the License.
|
| 9 |
+
You may obtain a copy of the License at
|
| 10 |
+
|
| 11 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 12 |
+
|
| 13 |
+
Unless required by applicable law or agreed to in writing, software
|
| 14 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 15 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 16 |
+
See the License for the specific language governing permissions and
|
| 17 |
+
limitations under the License.
|
| 18 |
+
*/
|
| 19 |
+
class ValidationError extends Error {
|
| 20 |
+
constructor(message, fields) {
|
| 21 |
+
super(message);
|
| 22 |
+
this.fields = fields;
|
| 23 |
+
}
|
| 24 |
+
}
|
| 25 |
+
exports.ValidationError = ValidationError;
|
node24/node_modules/npm/node_modules/@sigstore/bundle/dist/index.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 3 |
+
exports.isBundleV01 = exports.assertBundleV02 = exports.assertBundleV01 = exports.assertBundleLatest = exports.assertBundle = exports.envelopeToJSON = exports.envelopeFromJSON = exports.bundleToJSON = exports.bundleFromJSON = exports.ValidationError = exports.isBundleWithPublicKey = exports.isBundleWithMessageSignature = exports.isBundleWithDsseEnvelope = exports.isBundleWithCertificateChain = exports.BUNDLE_V03_MEDIA_TYPE = exports.BUNDLE_V03_LEGACY_MEDIA_TYPE = exports.BUNDLE_V02_MEDIA_TYPE = exports.BUNDLE_V01_MEDIA_TYPE = exports.toMessageSignatureBundle = exports.toDSSEBundle = void 0;
|
| 4 |
+
/*
|
| 5 |
+
Copyright 2023 The Sigstore Authors.
|
| 6 |
+
|
| 7 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 8 |
+
you may not use this file except in compliance with the License.
|
| 9 |
+
You may obtain a copy of the License at
|
| 10 |
+
|
| 11 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 12 |
+
|
| 13 |
+
Unless required by applicable law or agreed to in writing, software
|
| 14 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 15 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 16 |
+
See the License for the specific language governing permissions and
|
| 17 |
+
limitations under the License.
|
| 18 |
+
*/
|
| 19 |
+
var build_1 = require("./build");
|
| 20 |
+
Object.defineProperty(exports, "toDSSEBundle", { enumerable: true, get: function () { return build_1.toDSSEBundle; } });
|
| 21 |
+
Object.defineProperty(exports, "toMessageSignatureBundle", { enumerable: true, get: function () { return build_1.toMessageSignatureBundle; } });
|
| 22 |
+
var bundle_1 = require("./bundle");
|
| 23 |
+
Object.defineProperty(exports, "BUNDLE_V01_MEDIA_TYPE", { enumerable: true, get: function () { return bundle_1.BUNDLE_V01_MEDIA_TYPE; } });
|
| 24 |
+
Object.defineProperty(exports, "BUNDLE_V02_MEDIA_TYPE", { enumerable: true, get: function () { return bundle_1.BUNDLE_V02_MEDIA_TYPE; } });
|
| 25 |
+
Object.defineProperty(exports, "BUNDLE_V03_LEGACY_MEDIA_TYPE", { enumerable: true, get: function () { return bundle_1.BUNDLE_V03_LEGACY_MEDIA_TYPE; } });
|
| 26 |
+
Object.defineProperty(exports, "BUNDLE_V03_MEDIA_TYPE", { enumerable: true, get: function () { return bundle_1.BUNDLE_V03_MEDIA_TYPE; } });
|
| 27 |
+
Object.defineProperty(exports, "isBundleWithCertificateChain", { enumerable: true, get: function () { return bundle_1.isBundleWithCertificateChain; } });
|
| 28 |
+
Object.defineProperty(exports, "isBundleWithDsseEnvelope", { enumerable: true, get: function () { return bundle_1.isBundleWithDsseEnvelope; } });
|
| 29 |
+
Object.defineProperty(exports, "isBundleWithMessageSignature", { enumerable: true, get: function () { return bundle_1.isBundleWithMessageSignature; } });
|
| 30 |
+
Object.defineProperty(exports, "isBundleWithPublicKey", { enumerable: true, get: function () { return bundle_1.isBundleWithPublicKey; } });
|
| 31 |
+
var error_1 = require("./error");
|
| 32 |
+
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return error_1.ValidationError; } });
|
| 33 |
+
var serialized_1 = require("./serialized");
|
| 34 |
+
Object.defineProperty(exports, "bundleFromJSON", { enumerable: true, get: function () { return serialized_1.bundleFromJSON; } });
|
| 35 |
+
Object.defineProperty(exports, "bundleToJSON", { enumerable: true, get: function () { return serialized_1.bundleToJSON; } });
|
| 36 |
+
Object.defineProperty(exports, "envelopeFromJSON", { enumerable: true, get: function () { return serialized_1.envelopeFromJSON; } });
|
| 37 |
+
Object.defineProperty(exports, "envelopeToJSON", { enumerable: true, get: function () { return serialized_1.envelopeToJSON; } });
|
| 38 |
+
var validate_1 = require("./validate");
|
| 39 |
+
Object.defineProperty(exports, "assertBundle", { enumerable: true, get: function () { return validate_1.assertBundle; } });
|
| 40 |
+
Object.defineProperty(exports, "assertBundleLatest", { enumerable: true, get: function () { return validate_1.assertBundleLatest; } });
|
| 41 |
+
Object.defineProperty(exports, "assertBundleV01", { enumerable: true, get: function () { return validate_1.assertBundleV01; } });
|
| 42 |
+
Object.defineProperty(exports, "assertBundleV02", { enumerable: true, get: function () { return validate_1.assertBundleV02; } });
|
| 43 |
+
Object.defineProperty(exports, "isBundleV01", { enumerable: true, get: function () { return validate_1.isBundleV01; } });
|
node24/node_modules/npm/node_modules/@sigstore/bundle/dist/serialized.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 3 |
+
exports.envelopeToJSON = exports.envelopeFromJSON = exports.bundleToJSON = exports.bundleFromJSON = void 0;
|
| 4 |
+
/*
|
| 5 |
+
Copyright 2023 The Sigstore Authors.
|
| 6 |
+
|
| 7 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 8 |
+
you may not use this file except in compliance with the License.
|
| 9 |
+
You may obtain a copy of the License at
|
| 10 |
+
|
| 11 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 12 |
+
|
| 13 |
+
Unless required by applicable law or agreed to in writing, software
|
| 14 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 15 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 16 |
+
See the License for the specific language governing permissions and
|
| 17 |
+
limitations under the License.
|
| 18 |
+
*/
|
| 19 |
+
const protobuf_specs_1 = require("@sigstore/protobuf-specs");
|
| 20 |
+
const bundle_1 = require("./bundle");
|
| 21 |
+
const validate_1 = require("./validate");
|
| 22 |
+
const bundleFromJSON = (obj) => {
|
| 23 |
+
const bundle = protobuf_specs_1.Bundle.fromJSON(obj);
|
| 24 |
+
switch (bundle.mediaType) {
|
| 25 |
+
case bundle_1.BUNDLE_V01_MEDIA_TYPE:
|
| 26 |
+
(0, validate_1.assertBundleV01)(bundle);
|
| 27 |
+
break;
|
| 28 |
+
case bundle_1.BUNDLE_V02_MEDIA_TYPE:
|
| 29 |
+
(0, validate_1.assertBundleV02)(bundle);
|
| 30 |
+
break;
|
| 31 |
+
default:
|
| 32 |
+
(0, validate_1.assertBundleLatest)(bundle);
|
| 33 |
+
break;
|
| 34 |
+
}
|
| 35 |
+
return bundle;
|
| 36 |
+
};
|
| 37 |
+
exports.bundleFromJSON = bundleFromJSON;
|
| 38 |
+
const bundleToJSON = (bundle) => {
|
| 39 |
+
return protobuf_specs_1.Bundle.toJSON(bundle);
|
| 40 |
+
};
|
| 41 |
+
exports.bundleToJSON = bundleToJSON;
|
| 42 |
+
const envelopeFromJSON = (obj) => {
|
| 43 |
+
return protobuf_specs_1.Envelope.fromJSON(obj);
|
| 44 |
+
};
|
| 45 |
+
exports.envelopeFromJSON = envelopeFromJSON;
|
| 46 |
+
const envelopeToJSON = (envelope) => {
|
| 47 |
+
return protobuf_specs_1.Envelope.toJSON(envelope);
|
| 48 |
+
};
|
| 49 |
+
exports.envelopeToJSON = envelopeToJSON;
|
node24/node_modules/npm/node_modules/@sigstore/bundle/dist/utility.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
node24/node_modules/npm/node_modules/@sigstore/bundle/dist/validate.js
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 3 |
+
exports.assertBundle = assertBundle;
|
| 4 |
+
exports.assertBundleV01 = assertBundleV01;
|
| 5 |
+
exports.isBundleV01 = isBundleV01;
|
| 6 |
+
exports.assertBundleV02 = assertBundleV02;
|
| 7 |
+
exports.assertBundleLatest = assertBundleLatest;
|
| 8 |
+
/*
|
| 9 |
+
Copyright 2023 The Sigstore Authors.
|
| 10 |
+
|
| 11 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 12 |
+
you may not use this file except in compliance with the License.
|
| 13 |
+
You may obtain a copy of the License at
|
| 14 |
+
|
| 15 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 16 |
+
|
| 17 |
+
Unless required by applicable law or agreed to in writing, software
|
| 18 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 19 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 20 |
+
See the License for the specific language governing permissions and
|
| 21 |
+
limitations under the License.
|
| 22 |
+
*/
|
| 23 |
+
const error_1 = require("./error");
|
| 24 |
+
// Performs basic validation of a Sigstore bundle to ensure that all required
|
| 25 |
+
// fields are populated. This is not a complete validation of the bundle, but
|
| 26 |
+
// rather a check that the bundle is in a valid state to be processed by the
|
| 27 |
+
// rest of the code.
|
| 28 |
+
function assertBundle(b) {
|
| 29 |
+
const invalidValues = validateBundleBase(b);
|
| 30 |
+
if (invalidValues.length > 0) {
|
| 31 |
+
throw new error_1.ValidationError('invalid bundle', invalidValues);
|
| 32 |
+
}
|
| 33 |
+
}
|
| 34 |
+
// Asserts that the given bundle conforms to the v0.1 bundle format.
|
| 35 |
+
function assertBundleV01(b) {
|
| 36 |
+
const invalidValues = [];
|
| 37 |
+
invalidValues.push(...validateBundleBase(b));
|
| 38 |
+
invalidValues.push(...validateInclusionPromise(b));
|
| 39 |
+
if (invalidValues.length > 0) {
|
| 40 |
+
throw new error_1.ValidationError('invalid v0.1 bundle', invalidValues);
|
| 41 |
+
}
|
| 42 |
+
}
|
| 43 |
+
// Type guard to determine if Bundle is a v0.1 bundle.
|
| 44 |
+
function isBundleV01(b) {
|
| 45 |
+
try {
|
| 46 |
+
assertBundleV01(b);
|
| 47 |
+
return true;
|
| 48 |
+
}
|
| 49 |
+
catch (e) {
|
| 50 |
+
return false;
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
// Asserts that the given bundle conforms to the v0.2 bundle format.
|
| 54 |
+
function assertBundleV02(b) {
|
| 55 |
+
const invalidValues = [];
|
| 56 |
+
invalidValues.push(...validateBundleBase(b));
|
| 57 |
+
invalidValues.push(...validateInclusionProof(b));
|
| 58 |
+
if (invalidValues.length > 0) {
|
| 59 |
+
throw new error_1.ValidationError('invalid v0.2 bundle', invalidValues);
|
| 60 |
+
}
|
| 61 |
+
}
|
| 62 |
+
// Asserts that the given bundle conforms to the newest (0.3) bundle format.
|
| 63 |
+
function assertBundleLatest(b) {
|
| 64 |
+
const invalidValues = [];
|
| 65 |
+
invalidValues.push(...validateBundleBase(b));
|
| 66 |
+
invalidValues.push(...validateInclusionProof(b));
|
| 67 |
+
invalidValues.push(...validateNoCertificateChain(b));
|
| 68 |
+
if (invalidValues.length > 0) {
|
| 69 |
+
throw new error_1.ValidationError('invalid bundle', invalidValues);
|
| 70 |
+
}
|
| 71 |
+
}
|
| 72 |
+
function validateBundleBase(b) {
|
| 73 |
+
const invalidValues = [];
|
| 74 |
+
// Media type validation
|
| 75 |
+
if (b.mediaType === undefined ||
|
| 76 |
+
(!b.mediaType.match(/^application\/vnd\.dev\.sigstore\.bundle\+json;version=\d\.\d/) &&
|
| 77 |
+
!b.mediaType.match(/^application\/vnd\.dev\.sigstore\.bundle\.v\d\.\d\+json/))) {
|
| 78 |
+
invalidValues.push('mediaType');
|
| 79 |
+
}
|
| 80 |
+
// Content-related validation
|
| 81 |
+
if (b.content === undefined) {
|
| 82 |
+
invalidValues.push('content');
|
| 83 |
+
}
|
| 84 |
+
else {
|
| 85 |
+
switch (b.content.$case) {
|
| 86 |
+
case 'messageSignature':
|
| 87 |
+
if (b.content.messageSignature.messageDigest === undefined) {
|
| 88 |
+
invalidValues.push('content.messageSignature.messageDigest');
|
| 89 |
+
}
|
| 90 |
+
else {
|
| 91 |
+
if (b.content.messageSignature.messageDigest.digest.length === 0) {
|
| 92 |
+
invalidValues.push('content.messageSignature.messageDigest.digest');
|
| 93 |
+
}
|
| 94 |
+
}
|
| 95 |
+
if (b.content.messageSignature.signature.length === 0) {
|
| 96 |
+
invalidValues.push('content.messageSignature.signature');
|
| 97 |
+
}
|
| 98 |
+
break;
|
| 99 |
+
case 'dsseEnvelope':
|
| 100 |
+
if (b.content.dsseEnvelope.payload.length === 0) {
|
| 101 |
+
invalidValues.push('content.dsseEnvelope.payload');
|
| 102 |
+
}
|
| 103 |
+
if (b.content.dsseEnvelope.signatures.length !== 1) {
|
| 104 |
+
invalidValues.push('content.dsseEnvelope.signatures');
|
| 105 |
+
}
|
| 106 |
+
else {
|
| 107 |
+
if (b.content.dsseEnvelope.signatures[0].sig.length === 0) {
|
| 108 |
+
invalidValues.push('content.dsseEnvelope.signatures[0].sig');
|
| 109 |
+
}
|
| 110 |
+
}
|
| 111 |
+
break;
|
| 112 |
+
}
|
| 113 |
+
}
|
| 114 |
+
// Verification material-related validation
|
| 115 |
+
if (b.verificationMaterial === undefined) {
|
| 116 |
+
invalidValues.push('verificationMaterial');
|
| 117 |
+
}
|
| 118 |
+
else {
|
| 119 |
+
if (b.verificationMaterial.content === undefined) {
|
| 120 |
+
invalidValues.push('verificationMaterial.content');
|
| 121 |
+
}
|
| 122 |
+
else {
|
| 123 |
+
switch (b.verificationMaterial.content.$case) {
|
| 124 |
+
case 'x509CertificateChain':
|
| 125 |
+
if (b.verificationMaterial.content.x509CertificateChain.certificates
|
| 126 |
+
.length === 0) {
|
| 127 |
+
invalidValues.push('verificationMaterial.content.x509CertificateChain.certificates');
|
| 128 |
+
}
|
| 129 |
+
b.verificationMaterial.content.x509CertificateChain.certificates.forEach((cert, i) => {
|
| 130 |
+
if (cert.rawBytes.length === 0) {
|
| 131 |
+
invalidValues.push(`verificationMaterial.content.x509CertificateChain.certificates[${i}].rawBytes`);
|
| 132 |
+
}
|
| 133 |
+
});
|
| 134 |
+
break;
|
| 135 |
+
case 'certificate':
|
| 136 |
+
if (b.verificationMaterial.content.certificate.rawBytes.length === 0) {
|
| 137 |
+
invalidValues.push('verificationMaterial.content.certificate.rawBytes');
|
| 138 |
+
}
|
| 139 |
+
break;
|
| 140 |
+
}
|
| 141 |
+
}
|
| 142 |
+
if (b.verificationMaterial.tlogEntries === undefined) {
|
| 143 |
+
invalidValues.push('verificationMaterial.tlogEntries');
|
| 144 |
+
}
|
| 145 |
+
else {
|
| 146 |
+
if (b.verificationMaterial.tlogEntries.length > 0) {
|
| 147 |
+
b.verificationMaterial.tlogEntries.forEach((entry, i) => {
|
| 148 |
+
if (entry.logId === undefined) {
|
| 149 |
+
invalidValues.push(`verificationMaterial.tlogEntries[${i}].logId`);
|
| 150 |
+
}
|
| 151 |
+
if (entry.kindVersion === undefined) {
|
| 152 |
+
invalidValues.push(`verificationMaterial.tlogEntries[${i}].kindVersion`);
|
| 153 |
+
}
|
| 154 |
+
});
|
| 155 |
+
}
|
| 156 |
+
}
|
| 157 |
+
}
|
| 158 |
+
return invalidValues;
|
| 159 |
+
}
|
| 160 |
+
// Necessary for V01 bundles
|
| 161 |
+
function validateInclusionPromise(b) {
|
| 162 |
+
const invalidValues = [];
|
| 163 |
+
if (b.verificationMaterial &&
|
| 164 |
+
b.verificationMaterial.tlogEntries?.length > 0) {
|
| 165 |
+
b.verificationMaterial.tlogEntries.forEach((entry, i) => {
|
| 166 |
+
if (entry.inclusionPromise === undefined) {
|
| 167 |
+
invalidValues.push(`verificationMaterial.tlogEntries[${i}].inclusionPromise`);
|
| 168 |
+
}
|
| 169 |
+
});
|
| 170 |
+
}
|
| 171 |
+
return invalidValues;
|
| 172 |
+
}
|
| 173 |
+
// Necessary for V02 and later bundles
|
| 174 |
+
function validateInclusionProof(b) {
|
| 175 |
+
const invalidValues = [];
|
| 176 |
+
if (b.verificationMaterial &&
|
| 177 |
+
b.verificationMaterial.tlogEntries?.length > 0) {
|
| 178 |
+
b.verificationMaterial.tlogEntries.forEach((entry, i) => {
|
| 179 |
+
if (entry.inclusionProof === undefined) {
|
| 180 |
+
invalidValues.push(`verificationMaterial.tlogEntries[${i}].inclusionProof`);
|
| 181 |
+
}
|
| 182 |
+
else {
|
| 183 |
+
if (entry.inclusionProof.checkpoint === undefined) {
|
| 184 |
+
invalidValues.push(`verificationMaterial.tlogEntries[${i}].inclusionProof.checkpoint`);
|
| 185 |
+
}
|
| 186 |
+
}
|
| 187 |
+
});
|
| 188 |
+
}
|
| 189 |
+
return invalidValues;
|
| 190 |
+
}
|
| 191 |
+
// Necessary for V03 and later bundles
|
| 192 |
+
function validateNoCertificateChain(b) {
|
| 193 |
+
const invalidValues = [];
|
| 194 |
+
/* istanbul ignore next */
|
| 195 |
+
if (b.verificationMaterial?.content?.$case === 'x509CertificateChain') {
|
| 196 |
+
invalidValues.push('verificationMaterial.content.$case');
|
| 197 |
+
}
|
| 198 |
+
return invalidValues;
|
| 199 |
+
}
|
node24/node_modules/npm/node_modules/@sigstore/bundle/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@sigstore/bundle",
|
| 3 |
+
"version": "4.0.0",
|
| 4 |
+
"description": "Sigstore bundle type",
|
| 5 |
+
"main": "dist/index.js",
|
| 6 |
+
"types": "dist/index.d.ts",
|
| 7 |
+
"scripts": {
|
| 8 |
+
"clean": "shx rm -rf dist *.tsbuildinfo",
|
| 9 |
+
"build": "tsc --build",
|
| 10 |
+
"test": "jest"
|
| 11 |
+
},
|
| 12 |
+
"files": [
|
| 13 |
+
"dist",
|
| 14 |
+
"store"
|
| 15 |
+
],
|
| 16 |
+
"author": "bdehamer@github.com",
|
| 17 |
+
"license": "Apache-2.0",
|
| 18 |
+
"repository": {
|
| 19 |
+
"type": "git",
|
| 20 |
+
"url": "git+https://github.com/sigstore/sigstore-js.git"
|
| 21 |
+
},
|
| 22 |
+
"bugs": {
|
| 23 |
+
"url": "https://github.com/sigstore/sigstore-js/issues"
|
| 24 |
+
},
|
| 25 |
+
"homepage": "https://github.com/sigstore/sigstore-js/tree/main/packages/bundle#readme",
|
| 26 |
+
"publishConfig": {
|
| 27 |
+
"provenance": true
|
| 28 |
+
},
|
| 29 |
+
"dependencies": {
|
| 30 |
+
"@sigstore/protobuf-specs": "^0.5.0"
|
| 31 |
+
},
|
| 32 |
+
"engines": {
|
| 33 |
+
"node": "^20.17.0 || >=22.9.0"
|
| 34 |
+
}
|
| 35 |
+
}
|
node24/node_modules/npm/node_modules/@sigstore/core/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
Apache License
|
| 3 |
+
Version 2.0, January 2004
|
| 4 |
+
http://www.apache.org/licenses/
|
| 5 |
+
|
| 6 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 7 |
+
|
| 8 |
+
1. Definitions.
|
| 9 |
+
|
| 10 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 11 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 12 |
+
|
| 13 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 14 |
+
the copyright owner that is granting the License.
|
| 15 |
+
|
| 16 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 17 |
+
other entities that control, are controlled by, or are under common
|
| 18 |
+
control with that entity. For the purposes of this definition,
|
| 19 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 20 |
+
direction or management of such entity, whether by contract or
|
| 21 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 22 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 23 |
+
|
| 24 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 25 |
+
exercising permissions granted by this License.
|
| 26 |
+
|
| 27 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 28 |
+
including but not limited to software source code, documentation
|
| 29 |
+
source, and configuration files.
|
| 30 |
+
|
| 31 |
+
"Object" form shall mean any form resulting from mechanical
|
| 32 |
+
transformation or translation of a Source form, including but
|
| 33 |
+
not limited to compiled object code, generated documentation,
|
| 34 |
+
and conversions to other media types.
|
| 35 |
+
|
| 36 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 37 |
+
Object form, made available under the License, as indicated by a
|
| 38 |
+
copyright notice that is included in or attached to the work
|
| 39 |
+
(an example is provided in the Appendix below).
|
| 40 |
+
|
| 41 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 42 |
+
form, that is based on (or derived from) the Work and for which the
|
| 43 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 44 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 45 |
+
of this License, Derivative Works shall not include works that remain
|
| 46 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 47 |
+
the Work and Derivative Works thereof.
|
| 48 |
+
|
| 49 |
+
"Contribution" shall mean any work of authorship, including
|
| 50 |
+
the original version of the Work and any modifications or additions
|
| 51 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 52 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 53 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 54 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 55 |
+
means any form of electronic, verbal, or written communication sent
|
| 56 |
+
to the Licensor or its representatives, including but not limited to
|
| 57 |
+
communication on electronic mailing lists, source code control systems,
|
| 58 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 59 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 60 |
+
excluding communication that is conspicuously marked or otherwise
|
| 61 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 62 |
+
|
| 63 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 64 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 65 |
+
subsequently incorporated within the Work.
|
| 66 |
+
|
| 67 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 68 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 69 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 70 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 71 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 72 |
+
Work and such Derivative Works in Source or Object form.
|
| 73 |
+
|
| 74 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 75 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 76 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 77 |
+
(except as stated in this section) patent license to make, have made,
|
| 78 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 79 |
+
where such license applies only to those patent claims licensable
|
| 80 |
+
by such Contributor that are necessarily infringed by their
|
| 81 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 82 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 83 |
+
institute patent litigation against any entity (including a
|
| 84 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 85 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 86 |
+
or contributory patent infringement, then any patent licenses
|
| 87 |
+
granted to You under this License for that Work shall terminate
|
| 88 |
+
as of the date such litigation is filed.
|
| 89 |
+
|
| 90 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 91 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 92 |
+
modifications, and in Source or Object form, provided that You
|
| 93 |
+
meet the following conditions:
|
| 94 |
+
|
| 95 |
+
(a) You must give any other recipients of the Work or
|
| 96 |
+
Derivative Works a copy of this License; and
|
| 97 |
+
|
| 98 |
+
(b) You must cause any modified files to carry prominent notices
|
| 99 |
+
stating that You changed the files; and
|
| 100 |
+
|
| 101 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 102 |
+
that You distribute, all copyright, patent, trademark, and
|
| 103 |
+
attribution notices from the Source form of the Work,
|
| 104 |
+
excluding those notices that do not pertain to any part of
|
| 105 |
+
the Derivative Works; and
|
| 106 |
+
|
| 107 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 108 |
+
distribution, then any Derivative Works that You distribute must
|
| 109 |
+
include a readable copy of the attribution notices contained
|
| 110 |
+
within such NOTICE file, excluding those notices that do not
|
| 111 |
+
pertain to any part of the Derivative Works, in at least one
|
| 112 |
+
of the following places: within a NOTICE text file distributed
|
| 113 |
+
as part of the Derivative Works; within the Source form or
|
| 114 |
+
documentation, if provided along with the Derivative Works; or,
|
| 115 |
+
within a display generated by the Derivative Works, if and
|
| 116 |
+
wherever such third-party notices normally appear. The contents
|
| 117 |
+
of the NOTICE file are for informational purposes only and
|
| 118 |
+
do not modify the License. You may add Your own attribution
|
| 119 |
+
notices within Derivative Works that You distribute, alongside
|
| 120 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 121 |
+
that such additional attribution notices cannot be construed
|
| 122 |
+
as modifying the License.
|
| 123 |
+
|
| 124 |
+
You may add Your own copyright statement to Your modifications and
|
| 125 |
+
may provide additional or different license terms and conditions
|
| 126 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 127 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 128 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 129 |
+
the conditions stated in this License.
|
| 130 |
+
|
| 131 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 132 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 133 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 134 |
+
this License, without any additional terms or conditions.
|
| 135 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 136 |
+
the terms of any separate license agreement you may have executed
|
| 137 |
+
with Licensor regarding such Contributions.
|
| 138 |
+
|
| 139 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 140 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 141 |
+
except as required for reasonable and customary use in describing the
|
| 142 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 143 |
+
|
| 144 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 145 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 146 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 147 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 148 |
+
implied, including, without limitation, any warranties or conditions
|
| 149 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 150 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 151 |
+
appropriateness of using or redistributing the Work and assume any
|
| 152 |
+
risks associated with Your exercise of permissions under this License.
|
| 153 |
+
|
| 154 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 155 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 156 |
+
unless required by applicable law (such as deliberate and grossly
|
| 157 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 158 |
+
liable to You for damages, including any direct, indirect, special,
|
| 159 |
+
incidental, or consequential damages of any character arising as a
|
| 160 |
+
result of this License or out of the use or inability to use the
|
| 161 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 162 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 163 |
+
other commercial damages or losses), even if such Contributor
|
| 164 |
+
has been advised of the possibility of such damages.
|
| 165 |
+
|
| 166 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 167 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 168 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 169 |
+
or other liability obligations and/or rights consistent with this
|
| 170 |
+
License. However, in accepting such obligations, You may act only
|
| 171 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 172 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 173 |
+
defend, and hold each Contributor harmless for any liability
|
| 174 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 175 |
+
of your accepting any such warranty or additional liability.
|
| 176 |
+
|
| 177 |
+
END OF TERMS AND CONDITIONS
|
| 178 |
+
|
| 179 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 180 |
+
|
| 181 |
+
To apply the Apache License to your work, attach the following
|
| 182 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
| 183 |
+
replaced with your own identifying information. (Don't include
|
| 184 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 185 |
+
comment syntax for the file format. We also recommend that a
|
| 186 |
+
file or class name and description of purpose be included on the
|
| 187 |
+
same "printed page" as the copyright notice for easier
|
| 188 |
+
identification within third-party archives.
|
| 189 |
+
|
| 190 |
+
Copyright 2023 The Sigstore Authors
|
| 191 |
+
|
| 192 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 193 |
+
you may not use this file except in compliance with the License.
|
| 194 |
+
You may obtain a copy of the License at
|
| 195 |
+
|
| 196 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 197 |
+
|
| 198 |
+
Unless required by applicable law or agreed to in writing, software
|
| 199 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 200 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 201 |
+
See the License for the specific language governing permissions and
|
| 202 |
+
limitations under the License.
|
node24/node_modules/npm/node_modules/@sigstore/core/dist/asn1/error.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 3 |
+
exports.ASN1TypeError = exports.ASN1ParseError = void 0;
|
| 4 |
+
/*
|
| 5 |
+
Copyright 2023 The Sigstore Authors.
|
| 6 |
+
|
| 7 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 8 |
+
you may not use this file except in compliance with the License.
|
| 9 |
+
You may obtain a copy of the License at
|
| 10 |
+
|
| 11 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 12 |
+
|
| 13 |
+
Unless required by applicable law or agreed to in writing, software
|
| 14 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 15 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 16 |
+
See the License for the specific language governing permissions and
|
| 17 |
+
limitations under the License.
|
| 18 |
+
*/
|
| 19 |
+
class ASN1ParseError extends Error {
|
| 20 |
+
}
|
| 21 |
+
exports.ASN1ParseError = ASN1ParseError;
|
| 22 |
+
class ASN1TypeError extends Error {
|
| 23 |
+
}
|
| 24 |
+
exports.ASN1TypeError = ASN1TypeError;
|
node24/node_modules/npm/node_modules/@sigstore/core/dist/asn1/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 3 |
+
exports.ASN1Obj = void 0;
|
| 4 |
+
/*
|
| 5 |
+
Copyright 2023 The Sigstore Authors.
|
| 6 |
+
|
| 7 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 8 |
+
you may not use this file except in compliance with the License.
|
| 9 |
+
You may obtain a copy of the License at
|
| 10 |
+
|
| 11 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 12 |
+
|
| 13 |
+
Unless required by applicable law or agreed to in writing, software
|
| 14 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 15 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 16 |
+
See the License for the specific language governing permissions and
|
| 17 |
+
limitations under the License.
|
| 18 |
+
*/
|
| 19 |
+
var obj_1 = require("./obj");
|
| 20 |
+
Object.defineProperty(exports, "ASN1Obj", { enumerable: true, get: function () { return obj_1.ASN1Obj; } });
|
node24/node_modules/npm/node_modules/@sigstore/core/dist/asn1/length.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
/*
|
| 3 |
+
Copyright 2023 The Sigstore Authors.
|
| 4 |
+
|
| 5 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
you may not use this file except in compliance with the License.
|
| 7 |
+
You may obtain a copy of the License at
|
| 8 |
+
|
| 9 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
|
| 11 |
+
Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
See the License for the specific language governing permissions and
|
| 15 |
+
limitations under the License.
|
| 16 |
+
*/
|
| 17 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 18 |
+
exports.decodeLength = decodeLength;
|
| 19 |
+
exports.encodeLength = encodeLength;
|
| 20 |
+
const error_1 = require("./error");
|
| 21 |
+
// Decodes the length of a DER-encoded ANS.1 element from the supplied stream.
|
| 22 |
+
// https://learn.microsoft.com/en-us/windows/win32/seccertenroll/about-encoded-length-and-value-bytes
|
| 23 |
+
function decodeLength(stream) {
|
| 24 |
+
const buf = stream.getUint8();
|
| 25 |
+
// If the most significant bit is UNSET the length is just the value of the
|
| 26 |
+
// byte.
|
| 27 |
+
if ((buf & 0x80) === 0x00) {
|
| 28 |
+
return buf;
|
| 29 |
+
}
|
| 30 |
+
// Otherwise, the lower 7 bits of the first byte indicate the number of bytes
|
| 31 |
+
// that follow to encode the length.
|
| 32 |
+
const byteCount = buf & 0x7f;
|
| 33 |
+
// Ensure the encoded length can safely fit in a JS number.
|
| 34 |
+
if (byteCount > 6) {
|
| 35 |
+
throw new error_1.ASN1ParseError('length exceeds 6 byte limit');
|
| 36 |
+
}
|
| 37 |
+
// Iterate over the bytes that encode the length.
|
| 38 |
+
let len = 0;
|
| 39 |
+
for (let i = 0; i < byteCount; i++) {
|
| 40 |
+
len = len * 256 + stream.getUint8();
|
| 41 |
+
}
|
| 42 |
+
// This is a valid ASN.1 length encoding, but we don't support it.
|
| 43 |
+
if (len === 0) {
|
| 44 |
+
throw new error_1.ASN1ParseError('indefinite length encoding not supported');
|
| 45 |
+
}
|
| 46 |
+
return len;
|
| 47 |
+
}
|
| 48 |
+
// Translates the supplied value to a DER-encoded length.
|
| 49 |
+
function encodeLength(len) {
|
| 50 |
+
if (len < 128) {
|
| 51 |
+
return Buffer.from([len]);
|
| 52 |
+
}
|
| 53 |
+
// Bitwise operations on large numbers are not supported in JS, so we need to
|
| 54 |
+
// use BigInts.
|
| 55 |
+
let val = BigInt(len);
|
| 56 |
+
const bytes = [];
|
| 57 |
+
while (val > 0n) {
|
| 58 |
+
bytes.unshift(Number(val & 255n));
|
| 59 |
+
val = val >> 8n;
|
| 60 |
+
}
|
| 61 |
+
return Buffer.from([0x80 | bytes.length, ...bytes]);
|
| 62 |
+
}
|
node24/node_modules/npm/node_modules/@sigstore/core/dist/asn1/obj.js
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 3 |
+
exports.ASN1Obj = void 0;
|
| 4 |
+
/*
|
| 5 |
+
Copyright 2023 The Sigstore Authors.
|
| 6 |
+
|
| 7 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 8 |
+
you may not use this file except in compliance with the License.
|
| 9 |
+
You may obtain a copy of the License at
|
| 10 |
+
|
| 11 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 12 |
+
|
| 13 |
+
Unless required by applicable law or agreed to in writing, software
|
| 14 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 15 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 16 |
+
See the License for the specific language governing permissions and
|
| 17 |
+
limitations under the License.
|
| 18 |
+
*/
|
| 19 |
+
const stream_1 = require("../stream");
|
| 20 |
+
const error_1 = require("./error");
|
| 21 |
+
const length_1 = require("./length");
|
| 22 |
+
const parse_1 = require("./parse");
|
| 23 |
+
const tag_1 = require("./tag");
|
| 24 |
+
class ASN1Obj {
|
| 25 |
+
tag;
|
| 26 |
+
subs;
|
| 27 |
+
value;
|
| 28 |
+
constructor(tag, value, subs) {
|
| 29 |
+
this.tag = tag;
|
| 30 |
+
this.value = value;
|
| 31 |
+
this.subs = subs;
|
| 32 |
+
}
|
| 33 |
+
// Constructs an ASN.1 object from a Buffer of DER-encoded bytes.
|
| 34 |
+
static parseBuffer(buf) {
|
| 35 |
+
return parseStream(new stream_1.ByteStream(buf));
|
| 36 |
+
}
|
| 37 |
+
toDER() {
|
| 38 |
+
const valueStream = new stream_1.ByteStream();
|
| 39 |
+
if (this.subs.length > 0) {
|
| 40 |
+
for (const sub of this.subs) {
|
| 41 |
+
valueStream.appendView(sub.toDER());
|
| 42 |
+
}
|
| 43 |
+
}
|
| 44 |
+
else {
|
| 45 |
+
valueStream.appendView(this.value);
|
| 46 |
+
}
|
| 47 |
+
const value = valueStream.buffer;
|
| 48 |
+
// Concat tag/length/value
|
| 49 |
+
const obj = new stream_1.ByteStream();
|
| 50 |
+
obj.appendChar(this.tag.toDER());
|
| 51 |
+
obj.appendView((0, length_1.encodeLength)(value.length));
|
| 52 |
+
obj.appendView(value);
|
| 53 |
+
return obj.buffer;
|
| 54 |
+
}
|
| 55 |
+
/////////////////////////////////////////////////////////////////////////////
|
| 56 |
+
// Convenience methods for parsing ASN.1 primitives into JS types
|
| 57 |
+
// Returns the ASN.1 object's value as a boolean. Throws an error if the
|
| 58 |
+
// object is not a boolean.
|
| 59 |
+
toBoolean() {
|
| 60 |
+
if (!this.tag.isBoolean()) {
|
| 61 |
+
throw new error_1.ASN1TypeError('not a boolean');
|
| 62 |
+
}
|
| 63 |
+
return (0, parse_1.parseBoolean)(this.value);
|
| 64 |
+
}
|
| 65 |
+
// Returns the ASN.1 object's value as a BigInt. Throws an error if the
|
| 66 |
+
// object is not an integer.
|
| 67 |
+
toInteger() {
|
| 68 |
+
if (!this.tag.isInteger()) {
|
| 69 |
+
throw new error_1.ASN1TypeError('not an integer');
|
| 70 |
+
}
|
| 71 |
+
return (0, parse_1.parseInteger)(this.value);
|
| 72 |
+
}
|
| 73 |
+
// Returns the ASN.1 object's value as an OID string. Throws an error if the
|
| 74 |
+
// object is not an OID.
|
| 75 |
+
toOID() {
|
| 76 |
+
if (!this.tag.isOID()) {
|
| 77 |
+
throw new error_1.ASN1TypeError('not an OID');
|
| 78 |
+
}
|
| 79 |
+
return (0, parse_1.parseOID)(this.value);
|
| 80 |
+
}
|
| 81 |
+
// Returns the ASN.1 object's value as a Date. Throws an error if the object
|
| 82 |
+
// is not either a UTCTime or a GeneralizedTime.
|
| 83 |
+
toDate() {
|
| 84 |
+
switch (true) {
|
| 85 |
+
case this.tag.isUTCTime():
|
| 86 |
+
return (0, parse_1.parseTime)(this.value, true);
|
| 87 |
+
case this.tag.isGeneralizedTime():
|
| 88 |
+
return (0, parse_1.parseTime)(this.value, false);
|
| 89 |
+
default:
|
| 90 |
+
throw new error_1.ASN1TypeError('not a date');
|
| 91 |
+
}
|
| 92 |
+
}
|
| 93 |
+
// Returns the ASN.1 object's value as a number[] where each number is the
|
| 94 |
+
// value of a bit in the bit string. Throws an error if the object is not a
|
| 95 |
+
// bit string.
|
| 96 |
+
toBitString() {
|
| 97 |
+
if (!this.tag.isBitString()) {
|
| 98 |
+
throw new error_1.ASN1TypeError('not a bit string');
|
| 99 |
+
}
|
| 100 |
+
return (0, parse_1.parseBitString)(this.value);
|
| 101 |
+
}
|
| 102 |
+
}
|
| 103 |
+
exports.ASN1Obj = ASN1Obj;
|
| 104 |
+
/////////////////////////////////////////////////////////////////////////////
|
| 105 |
+
// Internal stream parsing functions
|
| 106 |
+
function parseStream(stream) {
|
| 107 |
+
// Parse tag, length, and value from stream
|
| 108 |
+
const tag = new tag_1.ASN1Tag(stream.getUint8());
|
| 109 |
+
const len = (0, length_1.decodeLength)(stream);
|
| 110 |
+
const value = stream.slice(stream.position, len);
|
| 111 |
+
const start = stream.position;
|
| 112 |
+
let subs = [];
|
| 113 |
+
// If the object is constructed, parse its children. Sometimes, children
|
| 114 |
+
// are embedded in OCTESTRING objects, so we need to check those
|
| 115 |
+
// for children as well.
|
| 116 |
+
if (tag.constructed) {
|
| 117 |
+
subs = collectSubs(stream, len);
|
| 118 |
+
}
|
| 119 |
+
else if (tag.isOctetString()) {
|
| 120 |
+
// Attempt to parse children of OCTETSTRING objects. If anything fails,
|
| 121 |
+
// assume the object is not constructed and treat as primitive.
|
| 122 |
+
try {
|
| 123 |
+
subs = collectSubs(stream, len);
|
| 124 |
+
}
|
| 125 |
+
catch (e) {
|
| 126 |
+
// Fail silently and treat as primitive
|
| 127 |
+
}
|
| 128 |
+
}
|
| 129 |
+
// If there are no children, move stream cursor to the end of the object
|
| 130 |
+
if (subs.length === 0) {
|
| 131 |
+
stream.seek(start + len);
|
| 132 |
+
}
|
| 133 |
+
return new ASN1Obj(tag, value, subs);
|
| 134 |
+
}
|
| 135 |
+
function collectSubs(stream, len) {
|
| 136 |
+
// Calculate end of object content
|
| 137 |
+
const end = stream.position + len;
|
| 138 |
+
// Make sure there are enough bytes left in the stream. This should never
|
| 139 |
+
// happen, cause it'll get caught when the stream is sliced in parseStream.
|
| 140 |
+
// Leaving as an extra check just in case.
|
| 141 |
+
/* istanbul ignore if */
|
| 142 |
+
if (end > stream.length) {
|
| 143 |
+
throw new error_1.ASN1ParseError('invalid length');
|
| 144 |
+
}
|
| 145 |
+
// Parse all children
|
| 146 |
+
const subs = [];
|
| 147 |
+
while (stream.position < end) {
|
| 148 |
+
subs.push(parseStream(stream));
|
| 149 |
+
}
|
| 150 |
+
// When we're done parsing children, we should be at the end of the object
|
| 151 |
+
if (stream.position !== end) {
|
| 152 |
+
throw new error_1.ASN1ParseError('invalid length');
|
| 153 |
+
}
|
| 154 |
+
return subs;
|
| 155 |
+
}
|
node24/node_modules/npm/node_modules/@sigstore/core/dist/asn1/parse.js
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 3 |
+
exports.parseInteger = parseInteger;
|
| 4 |
+
exports.parseStringASCII = parseStringASCII;
|
| 5 |
+
exports.parseTime = parseTime;
|
| 6 |
+
exports.parseOID = parseOID;
|
| 7 |
+
exports.parseBoolean = parseBoolean;
|
| 8 |
+
exports.parseBitString = parseBitString;
|
| 9 |
+
/*
|
| 10 |
+
Copyright 2023 The Sigstore Authors.
|
| 11 |
+
|
| 12 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 13 |
+
you may not use this file except in compliance with the License.
|
| 14 |
+
You may obtain a copy of the License at
|
| 15 |
+
|
| 16 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 17 |
+
|
| 18 |
+
Unless required by applicable law or agreed to in writing, software
|
| 19 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 20 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 21 |
+
See the License for the specific language governing permissions and
|
| 22 |
+
limitations under the License.
|
| 23 |
+
*/
|
| 24 |
+
const RE_TIME_SHORT_YEAR = /^(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\.\d{3})?Z$/;
|
| 25 |
+
const RE_TIME_LONG_YEAR = /^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\.\d{3})?Z$/;
|
| 26 |
+
// Parse a BigInt from the DER-encoded buffer
|
| 27 |
+
// https://learn.microsoft.com/en-us/windows/win32/seccertenroll/about-integer
|
| 28 |
+
function parseInteger(buf) {
|
| 29 |
+
let pos = 0;
|
| 30 |
+
const end = buf.length;
|
| 31 |
+
let val = buf[pos];
|
| 32 |
+
const neg = val > 0x7f;
|
| 33 |
+
// Consume any padding bytes
|
| 34 |
+
const pad = neg ? 0xff : 0x00;
|
| 35 |
+
while (val == pad && ++pos < end) {
|
| 36 |
+
val = buf[pos];
|
| 37 |
+
}
|
| 38 |
+
// Calculate remaining bytes to read
|
| 39 |
+
const len = end - pos;
|
| 40 |
+
if (len === 0)
|
| 41 |
+
return BigInt(neg ? -1 : 0);
|
| 42 |
+
// Handle two's complement for negative numbers
|
| 43 |
+
val = neg ? val - 256 : val;
|
| 44 |
+
// Parse remaining bytes
|
| 45 |
+
let n = BigInt(val);
|
| 46 |
+
for (let i = pos + 1; i < end; ++i) {
|
| 47 |
+
n = n * BigInt(256) + BigInt(buf[i]);
|
| 48 |
+
}
|
| 49 |
+
return n;
|
| 50 |
+
}
|
| 51 |
+
// Parse an ASCII string from the DER-encoded buffer
|
| 52 |
+
// https://learn.microsoft.com/en-us/windows/win32/seccertenroll/about-basic-types#boolean
|
| 53 |
+
function parseStringASCII(buf) {
|
| 54 |
+
return buf.toString('ascii');
|
| 55 |
+
}
|
| 56 |
+
// Parse a Date from the DER-encoded buffer
|
| 57 |
+
// https://www.rfc-editor.org/rfc/rfc5280#section-4.1.2.5.1
|
| 58 |
+
function parseTime(buf, shortYear) {
|
| 59 |
+
const timeStr = parseStringASCII(buf);
|
| 60 |
+
// Parse the time string into matches - captured groups start at index 1
|
| 61 |
+
const m = shortYear
|
| 62 |
+
? RE_TIME_SHORT_YEAR.exec(timeStr)
|
| 63 |
+
: RE_TIME_LONG_YEAR.exec(timeStr);
|
| 64 |
+
if (!m) {
|
| 65 |
+
throw new Error('invalid time');
|
| 66 |
+
}
|
| 67 |
+
// Translate dates with a 2-digit year to 4 digits per the spec
|
| 68 |
+
if (shortYear) {
|
| 69 |
+
let year = Number(m[1]);
|
| 70 |
+
year += year >= 50 ? 1900 : 2000;
|
| 71 |
+
m[1] = year.toString();
|
| 72 |
+
}
|
| 73 |
+
// Translate to ISO8601 format and parse
|
| 74 |
+
return new Date(`${m[1]}-${m[2]}-${m[3]}T${m[4]}:${m[5]}:${m[6]}Z`);
|
| 75 |
+
}
|
| 76 |
+
// Parse an OID from the DER-encoded buffer
|
| 77 |
+
// https://learn.microsoft.com/en-us/windows/win32/seccertenroll/about-object-identifier
|
| 78 |
+
function parseOID(buf) {
|
| 79 |
+
let pos = 0;
|
| 80 |
+
const end = buf.length;
|
| 81 |
+
// Consume first byte which encodes the first two OID components
|
| 82 |
+
let n = buf[pos++];
|
| 83 |
+
const first = Math.floor(n / 40);
|
| 84 |
+
const second = n % 40;
|
| 85 |
+
let oid = `${first}.${second}`;
|
| 86 |
+
// Consume remaining bytes
|
| 87 |
+
let val = 0;
|
| 88 |
+
for (; pos < end; ++pos) {
|
| 89 |
+
n = buf[pos];
|
| 90 |
+
val = (val << 7) + (n & 0x7f);
|
| 91 |
+
// If the left-most bit is NOT set, then this is the last byte in the
|
| 92 |
+
// sequence and we can add the value to the OID and reset the accumulator
|
| 93 |
+
if ((n & 0x80) === 0) {
|
| 94 |
+
oid += `.${val}`;
|
| 95 |
+
val = 0;
|
| 96 |
+
}
|
| 97 |
+
}
|
| 98 |
+
return oid;
|
| 99 |
+
}
|
| 100 |
+
// Parse a boolean from the DER-encoded buffer
|
| 101 |
+
// https://learn.microsoft.com/en-us/windows/win32/seccertenroll/about-basic-types#boolean
|
| 102 |
+
function parseBoolean(buf) {
|
| 103 |
+
return buf[0] !== 0;
|
| 104 |
+
}
|
| 105 |
+
// Parse a bit string from the DER-encoded buffer
|
| 106 |
+
// https://learn.microsoft.com/en-us/windows/win32/seccertenroll/about-bit-string
|
| 107 |
+
function parseBitString(buf) {
|
| 108 |
+
// First byte tell us how many unused bits are in the last byte
|
| 109 |
+
const unused = buf[0];
|
| 110 |
+
const start = 1;
|
| 111 |
+
const end = buf.length;
|
| 112 |
+
const bits = [];
|
| 113 |
+
for (let i = start; i < end; ++i) {
|
| 114 |
+
const byte = buf[i];
|
| 115 |
+
// The skip value is only used for the last byte
|
| 116 |
+
const skip = i === end - 1 ? unused : 0;
|
| 117 |
+
// Iterate over each bit in the byte (most significant first)
|
| 118 |
+
for (let j = 7; j >= skip; --j) {
|
| 119 |
+
// Read the bit and add it to the bit string
|
| 120 |
+
bits.push((byte >> j) & 0x01);
|
| 121 |
+
}
|
| 122 |
+
}
|
| 123 |
+
return bits;
|
| 124 |
+
}
|
node24/node_modules/npm/node_modules/@sigstore/core/dist/asn1/tag.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 3 |
+
exports.ASN1Tag = void 0;
|
| 4 |
+
/*
|
| 5 |
+
Copyright 2023 The Sigstore Authors.
|
| 6 |
+
|
| 7 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 8 |
+
you may not use this file except in compliance with the License.
|
| 9 |
+
You may obtain a copy of the License at
|
| 10 |
+
|
| 11 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 12 |
+
|
| 13 |
+
Unless required by applicable law or agreed to in writing, software
|
| 14 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 15 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 16 |
+
See the License for the specific language governing permissions and
|
| 17 |
+
limitations under the License.
|
| 18 |
+
*/
|
| 19 |
+
const error_1 = require("./error");
|
| 20 |
+
const UNIVERSAL_TAG = {
|
| 21 |
+
BOOLEAN: 0x01,
|
| 22 |
+
INTEGER: 0x02,
|
| 23 |
+
BIT_STRING: 0x03,
|
| 24 |
+
OCTET_STRING: 0x04,
|
| 25 |
+
OBJECT_IDENTIFIER: 0x06,
|
| 26 |
+
SEQUENCE: 0x10,
|
| 27 |
+
SET: 0x11,
|
| 28 |
+
PRINTABLE_STRING: 0x13,
|
| 29 |
+
UTC_TIME: 0x17,
|
| 30 |
+
GENERALIZED_TIME: 0x18,
|
| 31 |
+
};
|
| 32 |
+
const TAG_CLASS = {
|
| 33 |
+
UNIVERSAL: 0x00,
|
| 34 |
+
APPLICATION: 0x01,
|
| 35 |
+
CONTEXT_SPECIFIC: 0x02,
|
| 36 |
+
PRIVATE: 0x03,
|
| 37 |
+
};
|
| 38 |
+
// https://learn.microsoft.com/en-us/windows/win32/seccertenroll/about-encoded-tag-bytes
|
| 39 |
+
class ASN1Tag {
|
| 40 |
+
number;
|
| 41 |
+
constructed;
|
| 42 |
+
class;
|
| 43 |
+
constructor(enc) {
|
| 44 |
+
// Bits 0 through 4 are the tag number
|
| 45 |
+
this.number = enc & 0x1f;
|
| 46 |
+
// Bit 5 is the constructed bit
|
| 47 |
+
this.constructed = (enc & 0x20) === 0x20;
|
| 48 |
+
// Bit 6 & 7 are the class
|
| 49 |
+
this.class = enc >> 6;
|
| 50 |
+
if (this.number === 0x1f) {
|
| 51 |
+
throw new error_1.ASN1ParseError('long form tags not supported');
|
| 52 |
+
}
|
| 53 |
+
if (this.class === TAG_CLASS.UNIVERSAL && this.number === 0x00) {
|
| 54 |
+
throw new error_1.ASN1ParseError('unsupported tag 0x00');
|
| 55 |
+
}
|
| 56 |
+
}
|
| 57 |
+
isUniversal() {
|
| 58 |
+
return this.class === TAG_CLASS.UNIVERSAL;
|
| 59 |
+
}
|
| 60 |
+
isContextSpecific(num) {
|
| 61 |
+
const res = this.class === TAG_CLASS.CONTEXT_SPECIFIC;
|
| 62 |
+
return num !== undefined ? res && this.number === num : res;
|
| 63 |
+
}
|
| 64 |
+
isBoolean() {
|
| 65 |
+
return this.isUniversal() && this.number === UNIVERSAL_TAG.BOOLEAN;
|
| 66 |
+
}
|
| 67 |
+
isInteger() {
|
| 68 |
+
return this.isUniversal() && this.number === UNIVERSAL_TAG.INTEGER;
|
| 69 |
+
}
|
| 70 |
+
isBitString() {
|
| 71 |
+
return this.isUniversal() && this.number === UNIVERSAL_TAG.BIT_STRING;
|
| 72 |
+
}
|
| 73 |
+
isOctetString() {
|
| 74 |
+
return this.isUniversal() && this.number === UNIVERSAL_TAG.OCTET_STRING;
|
| 75 |
+
}
|
| 76 |
+
isOID() {
|
| 77 |
+
return (this.isUniversal() && this.number === UNIVERSAL_TAG.OBJECT_IDENTIFIER);
|
| 78 |
+
}
|
| 79 |
+
isUTCTime() {
|
| 80 |
+
return this.isUniversal() && this.number === UNIVERSAL_TAG.UTC_TIME;
|
| 81 |
+
}
|
| 82 |
+
isGeneralizedTime() {
|
| 83 |
+
return this.isUniversal() && this.number === UNIVERSAL_TAG.GENERALIZED_TIME;
|
| 84 |
+
}
|
| 85 |
+
toDER() {
|
| 86 |
+
return this.number | (this.constructed ? 0x20 : 0x00) | (this.class << 6);
|
| 87 |
+
}
|
| 88 |
+
}
|
| 89 |
+
exports.ASN1Tag = ASN1Tag;
|
node24/node_modules/npm/node_modules/@sigstore/core/dist/crypto.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
| 3 |
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
| 4 |
+
};
|
| 5 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 6 |
+
exports.createPublicKey = createPublicKey;
|
| 7 |
+
exports.digest = digest;
|
| 8 |
+
exports.verify = verify;
|
| 9 |
+
exports.bufferEqual = bufferEqual;
|
| 10 |
+
/*
|
| 11 |
+
Copyright 2023 The Sigstore Authors.
|
| 12 |
+
|
| 13 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 14 |
+
you may not use this file except in compliance with the License.
|
| 15 |
+
You may obtain a copy of the License at
|
| 16 |
+
|
| 17 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 18 |
+
|
| 19 |
+
Unless required by applicable law or agreed to in writing, software
|
| 20 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 21 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 22 |
+
See the License for the specific language governing permissions and
|
| 23 |
+
limitations under the License.
|
| 24 |
+
*/
|
| 25 |
+
const crypto_1 = __importDefault(require("crypto"));
|
| 26 |
+
function createPublicKey(key, type = 'spki') {
|
| 27 |
+
if (typeof key === 'string') {
|
| 28 |
+
if (key.startsWith('-----')) {
|
| 29 |
+
return crypto_1.default.createPublicKey(key);
|
| 30 |
+
}
|
| 31 |
+
else {
|
| 32 |
+
return crypto_1.default.createPublicKey({
|
| 33 |
+
key: Buffer.from(key, 'base64'),
|
| 34 |
+
format: 'der',
|
| 35 |
+
type: type,
|
| 36 |
+
});
|
| 37 |
+
}
|
| 38 |
+
}
|
| 39 |
+
else {
|
| 40 |
+
return crypto_1.default.createPublicKey({ key, format: 'der', type: type });
|
| 41 |
+
}
|
| 42 |
+
}
|
| 43 |
+
function digest(algorithm, ...data) {
|
| 44 |
+
const hash = crypto_1.default.createHash(algorithm);
|
| 45 |
+
for (const d of data) {
|
| 46 |
+
hash.update(d);
|
| 47 |
+
}
|
| 48 |
+
return hash.digest();
|
| 49 |
+
}
|
| 50 |
+
function verify(data, key, signature, algorithm) {
|
| 51 |
+
// The try/catch is to work around an issue in Node 14.x where verify throws
|
| 52 |
+
// an error in some scenarios if the signature is invalid.
|
| 53 |
+
try {
|
| 54 |
+
return crypto_1.default.verify(algorithm, data, key, signature);
|
| 55 |
+
}
|
| 56 |
+
catch (e) {
|
| 57 |
+
/* istanbul ignore next */
|
| 58 |
+
return false;
|
| 59 |
+
}
|
| 60 |
+
}
|
| 61 |
+
function bufferEqual(a, b) {
|
| 62 |
+
try {
|
| 63 |
+
return crypto_1.default.timingSafeEqual(a, b);
|
| 64 |
+
}
|
| 65 |
+
catch {
|
| 66 |
+
/* istanbul ignore next */
|
| 67 |
+
return false;
|
| 68 |
+
}
|
| 69 |
+
}
|
node24/node_modules/npm/node_modules/@sigstore/core/dist/dsse.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 3 |
+
exports.preAuthEncoding = preAuthEncoding;
|
| 4 |
+
/*
|
| 5 |
+
Copyright 2023 The Sigstore Authors.
|
| 6 |
+
|
| 7 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 8 |
+
you may not use this file except in compliance with the License.
|
| 9 |
+
You may obtain a copy of the License at
|
| 10 |
+
|
| 11 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 12 |
+
|
| 13 |
+
Unless required by applicable law or agreed to in writing, software
|
| 14 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 15 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 16 |
+
See the License for the specific language governing permissions and
|
| 17 |
+
limitations under the License.
|
| 18 |
+
*/
|
| 19 |
+
const PAE_PREFIX = 'DSSEv1';
|
| 20 |
+
// DSSE Pre-Authentication Encoding
|
| 21 |
+
function preAuthEncoding(payloadType, payload) {
|
| 22 |
+
const prefix = [
|
| 23 |
+
PAE_PREFIX,
|
| 24 |
+
payloadType.length,
|
| 25 |
+
payloadType,
|
| 26 |
+
payload.length,
|
| 27 |
+
'',
|
| 28 |
+
].join(' ');
|
| 29 |
+
return Buffer.concat([Buffer.from(prefix, 'ascii'), payload]);
|
| 30 |
+
}
|
node24/node_modules/npm/node_modules/@sigstore/core/dist/encoding.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 3 |
+
exports.base64Encode = base64Encode;
|
| 4 |
+
exports.base64Decode = base64Decode;
|
| 5 |
+
/*
|
| 6 |
+
Copyright 2023 The Sigstore Authors.
|
| 7 |
+
|
| 8 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 9 |
+
you may not use this file except in compliance with the License.
|
| 10 |
+
You may obtain a copy of the License at
|
| 11 |
+
|
| 12 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 13 |
+
|
| 14 |
+
Unless required by applicable law or agreed to in writing, software
|
| 15 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 16 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 17 |
+
See the License for the specific language governing permissions and
|
| 18 |
+
limitations under the License.
|
| 19 |
+
*/
|
| 20 |
+
const BASE64_ENCODING = 'base64';
|
| 21 |
+
const UTF8_ENCODING = 'utf-8';
|
| 22 |
+
function base64Encode(str) {
|
| 23 |
+
return Buffer.from(str, UTF8_ENCODING).toString(BASE64_ENCODING);
|
| 24 |
+
}
|
| 25 |
+
function base64Decode(str) {
|
| 26 |
+
return Buffer.from(str, BASE64_ENCODING).toString(UTF8_ENCODING);
|
| 27 |
+
}
|
node24/node_modules/npm/node_modules/@sigstore/core/dist/index.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"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 () {
|
| 19 |
+
var ownKeys = function(o) {
|
| 20 |
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
| 21 |
+
var ar = [];
|
| 22 |
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
| 23 |
+
return ar;
|
| 24 |
+
};
|
| 25 |
+
return ownKeys(o);
|
| 26 |
+
};
|
| 27 |
+
return function (mod) {
|
| 28 |
+
if (mod && mod.__esModule) return mod;
|
| 29 |
+
var result = {};
|
| 30 |
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
| 31 |
+
__setModuleDefault(result, mod);
|
| 32 |
+
return result;
|
| 33 |
+
};
|
| 34 |
+
})();
|
| 35 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 36 |
+
exports.X509SCTExtension = exports.X509Certificate = exports.EXTENSION_OID_SCT = exports.ByteStream = exports.RFC3161Timestamp = exports.pem = exports.json = exports.encoding = exports.dsse = exports.crypto = exports.ASN1Obj = void 0;
|
| 37 |
+
/*
|
| 38 |
+
Copyright 2023 The Sigstore Authors.
|
| 39 |
+
|
| 40 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 41 |
+
you may not use this file except in compliance with the License.
|
| 42 |
+
You may obtain a copy of the License at
|
| 43 |
+
|
| 44 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 45 |
+
|
| 46 |
+
Unless required by applicable law or agreed to in writing, software
|
| 47 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 48 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 49 |
+
See the License for the specific language governing permissions and
|
| 50 |
+
limitations under the License.
|
| 51 |
+
*/
|
| 52 |
+
var asn1_1 = require("./asn1");
|
| 53 |
+
Object.defineProperty(exports, "ASN1Obj", { enumerable: true, get: function () { return asn1_1.ASN1Obj; } });
|
| 54 |
+
exports.crypto = __importStar(require("./crypto"));
|
| 55 |
+
exports.dsse = __importStar(require("./dsse"));
|
| 56 |
+
exports.encoding = __importStar(require("./encoding"));
|
| 57 |
+
exports.json = __importStar(require("./json"));
|
| 58 |
+
exports.pem = __importStar(require("./pem"));
|
| 59 |
+
var rfc3161_1 = require("./rfc3161");
|
| 60 |
+
Object.defineProperty(exports, "RFC3161Timestamp", { enumerable: true, get: function () { return rfc3161_1.RFC3161Timestamp; } });
|
| 61 |
+
var stream_1 = require("./stream");
|
| 62 |
+
Object.defineProperty(exports, "ByteStream", { enumerable: true, get: function () { return stream_1.ByteStream; } });
|
| 63 |
+
var x509_1 = require("./x509");
|
| 64 |
+
Object.defineProperty(exports, "EXTENSION_OID_SCT", { enumerable: true, get: function () { return x509_1.EXTENSION_OID_SCT; } });
|
| 65 |
+
Object.defineProperty(exports, "X509Certificate", { enumerable: true, get: function () { return x509_1.X509Certificate; } });
|
| 66 |
+
Object.defineProperty(exports, "X509SCTExtension", { enumerable: true, get: function () { return x509_1.X509SCTExtension; } });
|
node24/node_modules/npm/node_modules/@sigstore/core/dist/json.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
/*
|
| 3 |
+
Copyright 2023 The Sigstore Authors.
|
| 4 |
+
|
| 5 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
you may not use this file except in compliance with the License.
|
| 7 |
+
You may obtain a copy of the License at
|
| 8 |
+
|
| 9 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
|
| 11 |
+
Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
See the License for the specific language governing permissions and
|
| 15 |
+
limitations under the License.
|
| 16 |
+
*/
|
| 17 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 18 |
+
exports.canonicalize = canonicalize;
|
| 19 |
+
// JSON canonicalization per https://github.com/cyberphone/json-canonicalization
|
| 20 |
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
| 21 |
+
function canonicalize(object) {
|
| 22 |
+
let buffer = '';
|
| 23 |
+
if (object === null || typeof object !== 'object' || object.toJSON != null) {
|
| 24 |
+
// Primitives or toJSONable objects
|
| 25 |
+
buffer += JSON.stringify(object);
|
| 26 |
+
}
|
| 27 |
+
else if (Array.isArray(object)) {
|
| 28 |
+
// Array - maintain element order
|
| 29 |
+
buffer += '[';
|
| 30 |
+
let first = true;
|
| 31 |
+
object.forEach((element) => {
|
| 32 |
+
if (!first) {
|
| 33 |
+
buffer += ',';
|
| 34 |
+
}
|
| 35 |
+
first = false;
|
| 36 |
+
// recursive call
|
| 37 |
+
buffer += canonicalize(element);
|
| 38 |
+
});
|
| 39 |
+
buffer += ']';
|
| 40 |
+
}
|
| 41 |
+
else {
|
| 42 |
+
// Object - Sort properties before serializing
|
| 43 |
+
buffer += '{';
|
| 44 |
+
let first = true;
|
| 45 |
+
Object.keys(object)
|
| 46 |
+
.sort()
|
| 47 |
+
.forEach((property) => {
|
| 48 |
+
if (!first) {
|
| 49 |
+
buffer += ',';
|
| 50 |
+
}
|
| 51 |
+
first = false;
|
| 52 |
+
buffer += JSON.stringify(property);
|
| 53 |
+
buffer += ':';
|
| 54 |
+
// recursive call
|
| 55 |
+
buffer += canonicalize(object[property]);
|
| 56 |
+
});
|
| 57 |
+
buffer += '}';
|
| 58 |
+
}
|
| 59 |
+
return buffer;
|
| 60 |
+
}
|
node24/node_modules/npm/node_modules/@sigstore/core/dist/oid.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 3 |
+
exports.SHA2_HASH_ALGOS = exports.RSA_SIGNATURE_ALGOS = exports.ECDSA_SIGNATURE_ALGOS = void 0;
|
| 4 |
+
exports.ECDSA_SIGNATURE_ALGOS = {
|
| 5 |
+
'1.2.840.10045.4.3.1': 'sha224',
|
| 6 |
+
'1.2.840.10045.4.3.2': 'sha256',
|
| 7 |
+
'1.2.840.10045.4.3.3': 'sha384',
|
| 8 |
+
'1.2.840.10045.4.3.4': 'sha512',
|
| 9 |
+
};
|
| 10 |
+
exports.RSA_SIGNATURE_ALGOS = {
|
| 11 |
+
'1.2.840.113549.1.1.14': 'sha224',
|
| 12 |
+
'1.2.840.113549.1.1.11': 'sha256',
|
| 13 |
+
'1.2.840.113549.1.1.12': 'sha384',
|
| 14 |
+
'1.2.840.113549.1.1.13': 'sha512',
|
| 15 |
+
};
|
| 16 |
+
exports.SHA2_HASH_ALGOS = {
|
| 17 |
+
'2.16.840.1.101.3.4.2.1': 'sha256',
|
| 18 |
+
'2.16.840.1.101.3.4.2.2': 'sha384',
|
| 19 |
+
'2.16.840.1.101.3.4.2.3': 'sha512',
|
| 20 |
+
};
|
node24/node_modules/npm/node_modules/@sigstore/core/dist/pem.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 3 |
+
exports.toDER = toDER;
|
| 4 |
+
exports.fromDER = fromDER;
|
| 5 |
+
/*
|
| 6 |
+
Copyright 2023 The Sigstore Authors.
|
| 7 |
+
|
| 8 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 9 |
+
you may not use this file except in compliance with the License.
|
| 10 |
+
You may obtain a copy of the License at
|
| 11 |
+
|
| 12 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 13 |
+
|
| 14 |
+
Unless required by applicable law or agreed to in writing, software
|
| 15 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 16 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 17 |
+
See the License for the specific language governing permissions and
|
| 18 |
+
limitations under the License.
|
| 19 |
+
*/
|
| 20 |
+
const PEM_HEADER = /-----BEGIN (.*)-----/;
|
| 21 |
+
const PEM_FOOTER = /-----END (.*)-----/;
|
| 22 |
+
function toDER(certificate) {
|
| 23 |
+
let der = '';
|
| 24 |
+
certificate.split('\n').forEach((line) => {
|
| 25 |
+
if (line.match(PEM_HEADER) || line.match(PEM_FOOTER)) {
|
| 26 |
+
return;
|
| 27 |
+
}
|
| 28 |
+
der += line;
|
| 29 |
+
});
|
| 30 |
+
return Buffer.from(der, 'base64');
|
| 31 |
+
}
|
| 32 |
+
// Translates a DER-encoded buffer into a PEM-encoded string. Standard PEM
|
| 33 |
+
// encoding dictates that each certificate should have a trailing newline after
|
| 34 |
+
// the footer.
|
| 35 |
+
function fromDER(certificate, type = 'CERTIFICATE') {
|
| 36 |
+
// Base64-encode the certificate.
|
| 37 |
+
const der = certificate.toString('base64');
|
| 38 |
+
// Split the certificate into lines of 64 characters.
|
| 39 |
+
const lines = der.match(/.{1,64}/g) || '';
|
| 40 |
+
return [`-----BEGIN ${type}-----`, ...lines, `-----END ${type}-----`]
|
| 41 |
+
.join('\n')
|
| 42 |
+
.concat('\n');
|
| 43 |
+
}
|
node24/node_modules/npm/node_modules/@sigstore/core/dist/rfc3161/error.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 3 |
+
exports.RFC3161TimestampVerificationError = void 0;
|
| 4 |
+
/*
|
| 5 |
+
Copyright 2023 The Sigstore Authors.
|
| 6 |
+
|
| 7 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 8 |
+
you may not use this file except in compliance with the License.
|
| 9 |
+
You may obtain a copy of the License at
|
| 10 |
+
|
| 11 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 12 |
+
|
| 13 |
+
Unless required by applicable law or agreed to in writing, software
|
| 14 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 15 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 16 |
+
See the License for the specific language governing permissions and
|
| 17 |
+
limitations under the License.
|
| 18 |
+
*/
|
| 19 |
+
class RFC3161TimestampVerificationError extends Error {
|
| 20 |
+
}
|
| 21 |
+
exports.RFC3161TimestampVerificationError = RFC3161TimestampVerificationError;
|
node24/node_modules/npm/node_modules/@sigstore/core/dist/rfc3161/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
/*
|
| 3 |
+
Copyright 2023 The Sigstore Authors.
|
| 4 |
+
|
| 5 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
you may not use this file except in compliance with the License.
|
| 7 |
+
You may obtain a copy of the License at
|
| 8 |
+
|
| 9 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
|
| 11 |
+
Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
See the License for the specific language governing permissions and
|
| 15 |
+
limitations under the License.
|
| 16 |
+
*/
|
| 17 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 18 |
+
exports.RFC3161Timestamp = void 0;
|
| 19 |
+
var timestamp_1 = require("./timestamp");
|
| 20 |
+
Object.defineProperty(exports, "RFC3161Timestamp", { enumerable: true, get: function () { return timestamp_1.RFC3161Timestamp; } });
|
node24/node_modules/npm/node_modules/@sigstore/core/dist/rfc3161/timestamp.js
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"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 () {
|
| 19 |
+
var ownKeys = function(o) {
|
| 20 |
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
| 21 |
+
var ar = [];
|
| 22 |
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
| 23 |
+
return ar;
|
| 24 |
+
};
|
| 25 |
+
return ownKeys(o);
|
| 26 |
+
};
|
| 27 |
+
return function (mod) {
|
| 28 |
+
if (mod && mod.__esModule) return mod;
|
| 29 |
+
var result = {};
|
| 30 |
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
| 31 |
+
__setModuleDefault(result, mod);
|
| 32 |
+
return result;
|
| 33 |
+
};
|
| 34 |
+
})();
|
| 35 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 36 |
+
exports.RFC3161Timestamp = void 0;
|
| 37 |
+
/*
|
| 38 |
+
Copyright 2023 The Sigstore Authors.
|
| 39 |
+
|
| 40 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 41 |
+
you may not use this file except in compliance with the License.
|
| 42 |
+
You may obtain a copy of the License at
|
| 43 |
+
|
| 44 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 45 |
+
|
| 46 |
+
Unless required by applicable law or agreed to in writing, software
|
| 47 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 48 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 49 |
+
See the License for the specific language governing permissions and
|
| 50 |
+
limitations under the License.
|
| 51 |
+
*/
|
| 52 |
+
const asn1_1 = require("../asn1");
|
| 53 |
+
const crypto = __importStar(require("../crypto"));
|
| 54 |
+
const oid_1 = require("../oid");
|
| 55 |
+
const error_1 = require("./error");
|
| 56 |
+
const tstinfo_1 = require("./tstinfo");
|
| 57 |
+
const OID_PKCS9_CONTENT_TYPE_SIGNED_DATA = '1.2.840.113549.1.7.2';
|
| 58 |
+
const OID_PKCS9_CONTENT_TYPE_TSTINFO = '1.2.840.113549.1.9.16.1.4';
|
| 59 |
+
const OID_PKCS9_MESSAGE_DIGEST_KEY = '1.2.840.113549.1.9.4';
|
| 60 |
+
class RFC3161Timestamp {
|
| 61 |
+
root;
|
| 62 |
+
constructor(asn1) {
|
| 63 |
+
this.root = asn1;
|
| 64 |
+
}
|
| 65 |
+
static parse(der) {
|
| 66 |
+
const asn1 = asn1_1.ASN1Obj.parseBuffer(der);
|
| 67 |
+
return new RFC3161Timestamp(asn1);
|
| 68 |
+
}
|
| 69 |
+
get status() {
|
| 70 |
+
return this.pkiStatusInfoObj.subs[0].toInteger();
|
| 71 |
+
}
|
| 72 |
+
get contentType() {
|
| 73 |
+
return this.contentTypeObj.toOID();
|
| 74 |
+
}
|
| 75 |
+
get eContentType() {
|
| 76 |
+
return this.eContentTypeObj.toOID();
|
| 77 |
+
}
|
| 78 |
+
get signingTime() {
|
| 79 |
+
return this.tstInfo.genTime;
|
| 80 |
+
}
|
| 81 |
+
get signerIssuer() {
|
| 82 |
+
return this.signerSidObj.subs[0].value;
|
| 83 |
+
}
|
| 84 |
+
get signerSerialNumber() {
|
| 85 |
+
return this.signerSidObj.subs[1].value;
|
| 86 |
+
}
|
| 87 |
+
get signerDigestAlgorithm() {
|
| 88 |
+
const oid = this.signerDigestAlgorithmObj.subs[0].toOID();
|
| 89 |
+
return oid_1.SHA2_HASH_ALGOS[oid];
|
| 90 |
+
}
|
| 91 |
+
get signatureAlgorithm() {
|
| 92 |
+
const oid = this.signatureAlgorithmObj.subs[0].toOID();
|
| 93 |
+
return oid_1.ECDSA_SIGNATURE_ALGOS[oid];
|
| 94 |
+
}
|
| 95 |
+
get signatureValue() {
|
| 96 |
+
return this.signatureValueObj.value;
|
| 97 |
+
}
|
| 98 |
+
get tstInfo() {
|
| 99 |
+
// Need to unpack tstInfo from an OCTET STRING
|
| 100 |
+
return new tstinfo_1.TSTInfo(this.eContentObj.subs[0].subs[0]);
|
| 101 |
+
}
|
| 102 |
+
verify(data, publicKey) {
|
| 103 |
+
if (!this.timeStampTokenObj) {
|
| 104 |
+
throw new error_1.RFC3161TimestampVerificationError('timeStampToken is missing');
|
| 105 |
+
}
|
| 106 |
+
// Check for expected ContentInfo content type
|
| 107 |
+
if (this.contentType !== OID_PKCS9_CONTENT_TYPE_SIGNED_DATA) {
|
| 108 |
+
throw new error_1.RFC3161TimestampVerificationError(`incorrect content type: ${this.contentType}`);
|
| 109 |
+
}
|
| 110 |
+
// Check for expected encapsulated content type
|
| 111 |
+
if (this.eContentType !== OID_PKCS9_CONTENT_TYPE_TSTINFO) {
|
| 112 |
+
throw new error_1.RFC3161TimestampVerificationError(`incorrect encapsulated content type: ${this.eContentType}`);
|
| 113 |
+
}
|
| 114 |
+
// Check that the tstInfo references the correct artifact
|
| 115 |
+
this.tstInfo.verify(data);
|
| 116 |
+
// Check that the signed message digest matches the tstInfo
|
| 117 |
+
this.verifyMessageDigest();
|
| 118 |
+
// Check that the signature is valid for the signed attributes
|
| 119 |
+
this.verifySignature(publicKey);
|
| 120 |
+
}
|
| 121 |
+
verifyMessageDigest() {
|
| 122 |
+
// Check that the tstInfo matches the signed data
|
| 123 |
+
const tstInfoDigest = crypto.digest(this.signerDigestAlgorithm, this.tstInfo.raw);
|
| 124 |
+
const expectedDigest = this.messageDigestAttributeObj.subs[1].subs[0].value;
|
| 125 |
+
if (!crypto.bufferEqual(tstInfoDigest, expectedDigest)) {
|
| 126 |
+
throw new error_1.RFC3161TimestampVerificationError('signed data does not match tstInfo');
|
| 127 |
+
}
|
| 128 |
+
}
|
| 129 |
+
verifySignature(key) {
|
| 130 |
+
// Encode the signed attributes for verification
|
| 131 |
+
const signedAttrs = this.signedAttrsObj.toDER();
|
| 132 |
+
signedAttrs[0] = 0x31; // Change context-specific tag to SET
|
| 133 |
+
// Check that the signature is valid for the signed attributes
|
| 134 |
+
const verified = crypto.verify(signedAttrs, key, this.signatureValue, this.signatureAlgorithm);
|
| 135 |
+
if (!verified) {
|
| 136 |
+
throw new error_1.RFC3161TimestampVerificationError('signature verification failed');
|
| 137 |
+
}
|
| 138 |
+
}
|
| 139 |
+
// https://www.rfc-editor.org/rfc/rfc3161#section-2.4.2
|
| 140 |
+
get pkiStatusInfoObj() {
|
| 141 |
+
// pkiStatusInfo is the first element of the timestamp response sequence
|
| 142 |
+
return this.root.subs[0];
|
| 143 |
+
}
|
| 144 |
+
// https://www.rfc-editor.org/rfc/rfc3161#section-2.4.2
|
| 145 |
+
get timeStampTokenObj() {
|
| 146 |
+
// timeStampToken is the first element of the timestamp response sequence
|
| 147 |
+
return this.root.subs[1];
|
| 148 |
+
}
|
| 149 |
+
// https://datatracker.ietf.org/doc/html/rfc5652#section-3
|
| 150 |
+
get contentTypeObj() {
|
| 151 |
+
return this.timeStampTokenObj.subs[0];
|
| 152 |
+
}
|
| 153 |
+
// https://www.rfc-editor.org/rfc/rfc5652#section-3
|
| 154 |
+
get signedDataObj() {
|
| 155 |
+
const obj = this.timeStampTokenObj.subs.find((sub) => sub.tag.isContextSpecific(0x00));
|
| 156 |
+
return obj.subs[0];
|
| 157 |
+
}
|
| 158 |
+
// https://datatracker.ietf.org/doc/html/rfc5652#section-5.1
|
| 159 |
+
get encapContentInfoObj() {
|
| 160 |
+
return this.signedDataObj.subs[2];
|
| 161 |
+
}
|
| 162 |
+
// https://datatracker.ietf.org/doc/html/rfc5652#section-5.1
|
| 163 |
+
get signerInfosObj() {
|
| 164 |
+
// SignerInfos is the last element of the signed data sequence
|
| 165 |
+
const sd = this.signedDataObj;
|
| 166 |
+
return sd.subs[sd.subs.length - 1];
|
| 167 |
+
}
|
| 168 |
+
// https://www.rfc-editor.org/rfc/rfc5652#section-5.1
|
| 169 |
+
get signerInfoObj() {
|
| 170 |
+
// Only supporting one signer
|
| 171 |
+
return this.signerInfosObj.subs[0];
|
| 172 |
+
}
|
| 173 |
+
// https://datatracker.ietf.org/doc/html/rfc5652#section-5.2
|
| 174 |
+
get eContentTypeObj() {
|
| 175 |
+
return this.encapContentInfoObj.subs[0];
|
| 176 |
+
}
|
| 177 |
+
// https://datatracker.ietf.org/doc/html/rfc5652#section-5.2
|
| 178 |
+
get eContentObj() {
|
| 179 |
+
return this.encapContentInfoObj.subs[1];
|
| 180 |
+
}
|
| 181 |
+
// https://datatracker.ietf.org/doc/html/rfc5652#section-5.3
|
| 182 |
+
get signedAttrsObj() {
|
| 183 |
+
const signedAttrs = this.signerInfoObj.subs.find((sub) => sub.tag.isContextSpecific(0x00));
|
| 184 |
+
return signedAttrs;
|
| 185 |
+
}
|
| 186 |
+
// https://datatracker.ietf.org/doc/html/rfc5652#section-5.3
|
| 187 |
+
get messageDigestAttributeObj() {
|
| 188 |
+
const messageDigest = this.signedAttrsObj.subs.find((sub) => sub.subs[0].tag.isOID() &&
|
| 189 |
+
sub.subs[0].toOID() === OID_PKCS9_MESSAGE_DIGEST_KEY);
|
| 190 |
+
return messageDigest;
|
| 191 |
+
}
|
| 192 |
+
// https://datatracker.ietf.org/doc/html/rfc5652#section-5.3
|
| 193 |
+
get signerSidObj() {
|
| 194 |
+
return this.signerInfoObj.subs[1];
|
| 195 |
+
}
|
| 196 |
+
// https://datatracker.ietf.org/doc/html/rfc5652#section-5.3
|
| 197 |
+
get signerDigestAlgorithmObj() {
|
| 198 |
+
// Signature is the 2nd element of the signerInfoObj object
|
| 199 |
+
return this.signerInfoObj.subs[2];
|
| 200 |
+
}
|
| 201 |
+
// https://datatracker.ietf.org/doc/html/rfc5652#section-5.3
|
| 202 |
+
get signatureAlgorithmObj() {
|
| 203 |
+
// Signature is the 4th element of the signerInfoObj object
|
| 204 |
+
return this.signerInfoObj.subs[4];
|
| 205 |
+
}
|
| 206 |
+
// https://datatracker.ietf.org/doc/html/rfc5652#section-5.3
|
| 207 |
+
get signatureValueObj() {
|
| 208 |
+
// Signature is the 6th element of the signerInfoObj object
|
| 209 |
+
return this.signerInfoObj.subs[5];
|
| 210 |
+
}
|
| 211 |
+
}
|
| 212 |
+
exports.RFC3161Timestamp = RFC3161Timestamp;
|
node24/node_modules/npm/node_modules/@sigstore/core/dist/rfc3161/tstinfo.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"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 () {
|
| 19 |
+
var ownKeys = function(o) {
|
| 20 |
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
| 21 |
+
var ar = [];
|
| 22 |
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
| 23 |
+
return ar;
|
| 24 |
+
};
|
| 25 |
+
return ownKeys(o);
|
| 26 |
+
};
|
| 27 |
+
return function (mod) {
|
| 28 |
+
if (mod && mod.__esModule) return mod;
|
| 29 |
+
var result = {};
|
| 30 |
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
| 31 |
+
__setModuleDefault(result, mod);
|
| 32 |
+
return result;
|
| 33 |
+
};
|
| 34 |
+
})();
|
| 35 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 36 |
+
exports.TSTInfo = void 0;
|
| 37 |
+
const crypto = __importStar(require("../crypto"));
|
| 38 |
+
const oid_1 = require("../oid");
|
| 39 |
+
const error_1 = require("./error");
|
| 40 |
+
class TSTInfo {
|
| 41 |
+
root;
|
| 42 |
+
constructor(asn1) {
|
| 43 |
+
this.root = asn1;
|
| 44 |
+
}
|
| 45 |
+
get version() {
|
| 46 |
+
return this.root.subs[0].toInteger();
|
| 47 |
+
}
|
| 48 |
+
get genTime() {
|
| 49 |
+
return this.root.subs[4].toDate();
|
| 50 |
+
}
|
| 51 |
+
get messageImprintHashAlgorithm() {
|
| 52 |
+
const oid = this.messageImprintObj.subs[0].subs[0].toOID();
|
| 53 |
+
return oid_1.SHA2_HASH_ALGOS[oid];
|
| 54 |
+
}
|
| 55 |
+
get messageImprintHashedMessage() {
|
| 56 |
+
return this.messageImprintObj.subs[1].value;
|
| 57 |
+
}
|
| 58 |
+
get raw() {
|
| 59 |
+
return this.root.toDER();
|
| 60 |
+
}
|
| 61 |
+
verify(data) {
|
| 62 |
+
const digest = crypto.digest(this.messageImprintHashAlgorithm, data);
|
| 63 |
+
if (!crypto.bufferEqual(digest, this.messageImprintHashedMessage)) {
|
| 64 |
+
throw new error_1.RFC3161TimestampVerificationError('message imprint does not match artifact');
|
| 65 |
+
}
|
| 66 |
+
}
|
| 67 |
+
// https://www.rfc-editor.org/rfc/rfc3161#section-2.4.2
|
| 68 |
+
get messageImprintObj() {
|
| 69 |
+
return this.root.subs[2];
|
| 70 |
+
}
|
| 71 |
+
}
|
| 72 |
+
exports.TSTInfo = TSTInfo;
|
node24/node_modules/npm/node_modules/@sigstore/core/dist/stream.js
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 3 |
+
exports.ByteStream = void 0;
|
| 4 |
+
/*
|
| 5 |
+
Copyright 2023 The Sigstore Authors.
|
| 6 |
+
|
| 7 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 8 |
+
you may not use this file except in compliance with the License.
|
| 9 |
+
You may obtain a copy of the License at
|
| 10 |
+
|
| 11 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 12 |
+
|
| 13 |
+
Unless required by applicable law or agreed to in writing, software
|
| 14 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 15 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 16 |
+
See the License for the specific language governing permissions and
|
| 17 |
+
limitations under the License.
|
| 18 |
+
*/
|
| 19 |
+
class StreamError extends Error {
|
| 20 |
+
}
|
| 21 |
+
class ByteStream {
|
| 22 |
+
static BLOCK_SIZE = 1024;
|
| 23 |
+
buf;
|
| 24 |
+
view;
|
| 25 |
+
start = 0;
|
| 26 |
+
constructor(buffer) {
|
| 27 |
+
if (buffer) {
|
| 28 |
+
this.buf = buffer;
|
| 29 |
+
this.view = Buffer.from(buffer);
|
| 30 |
+
}
|
| 31 |
+
else {
|
| 32 |
+
this.buf = Buffer.alloc(0);
|
| 33 |
+
this.view = Buffer.from(this.buf);
|
| 34 |
+
}
|
| 35 |
+
}
|
| 36 |
+
get buffer() {
|
| 37 |
+
return this.view.subarray(0, this.start);
|
| 38 |
+
}
|
| 39 |
+
get length() {
|
| 40 |
+
return this.view.byteLength;
|
| 41 |
+
}
|
| 42 |
+
get position() {
|
| 43 |
+
return this.start;
|
| 44 |
+
}
|
| 45 |
+
seek(position) {
|
| 46 |
+
this.start = position;
|
| 47 |
+
}
|
| 48 |
+
// Returns a Buffer containing the specified number of bytes starting at the
|
| 49 |
+
// given start position.
|
| 50 |
+
slice(start, len) {
|
| 51 |
+
const end = start + len;
|
| 52 |
+
if (end > this.length) {
|
| 53 |
+
throw new StreamError('request past end of buffer');
|
| 54 |
+
}
|
| 55 |
+
return this.view.subarray(start, end);
|
| 56 |
+
}
|
| 57 |
+
appendChar(char) {
|
| 58 |
+
this.ensureCapacity(1);
|
| 59 |
+
this.view[this.start] = char;
|
| 60 |
+
this.start += 1;
|
| 61 |
+
}
|
| 62 |
+
appendUint16(num) {
|
| 63 |
+
this.ensureCapacity(2);
|
| 64 |
+
const value = new Uint16Array([num]);
|
| 65 |
+
const view = new Uint8Array(value.buffer);
|
| 66 |
+
this.view[this.start] = view[1];
|
| 67 |
+
this.view[this.start + 1] = view[0];
|
| 68 |
+
this.start += 2;
|
| 69 |
+
}
|
| 70 |
+
appendUint24(num) {
|
| 71 |
+
this.ensureCapacity(3);
|
| 72 |
+
const value = new Uint32Array([num]);
|
| 73 |
+
const view = new Uint8Array(value.buffer);
|
| 74 |
+
this.view[this.start] = view[2];
|
| 75 |
+
this.view[this.start + 1] = view[1];
|
| 76 |
+
this.view[this.start + 2] = view[0];
|
| 77 |
+
this.start += 3;
|
| 78 |
+
}
|
| 79 |
+
appendView(view) {
|
| 80 |
+
this.ensureCapacity(view.length);
|
| 81 |
+
this.view.set(view, this.start);
|
| 82 |
+
this.start += view.length;
|
| 83 |
+
}
|
| 84 |
+
getBlock(size) {
|
| 85 |
+
if (size <= 0) {
|
| 86 |
+
return Buffer.alloc(0);
|
| 87 |
+
}
|
| 88 |
+
if (this.start + size > this.view.length) {
|
| 89 |
+
throw new Error('request past end of buffer');
|
| 90 |
+
}
|
| 91 |
+
const result = this.view.subarray(this.start, this.start + size);
|
| 92 |
+
this.start += size;
|
| 93 |
+
return result;
|
| 94 |
+
}
|
| 95 |
+
getUint8() {
|
| 96 |
+
return this.getBlock(1)[0];
|
| 97 |
+
}
|
| 98 |
+
getUint16() {
|
| 99 |
+
const block = this.getBlock(2);
|
| 100 |
+
return (block[0] << 8) | block[1];
|
| 101 |
+
}
|
| 102 |
+
ensureCapacity(size) {
|
| 103 |
+
if (this.start + size > this.view.byteLength) {
|
| 104 |
+
const blockSize = ByteStream.BLOCK_SIZE + (size > ByteStream.BLOCK_SIZE ? size : 0);
|
| 105 |
+
this.realloc(this.view.byteLength + blockSize);
|
| 106 |
+
}
|
| 107 |
+
}
|
| 108 |
+
realloc(size) {
|
| 109 |
+
const newArray = Buffer.alloc(size);
|
| 110 |
+
const newView = Buffer.from(newArray);
|
| 111 |
+
// Copy the old buffer into the new one
|
| 112 |
+
newView.set(this.view);
|
| 113 |
+
this.buf = newArray;
|
| 114 |
+
this.view = newView;
|
| 115 |
+
}
|
| 116 |
+
}
|
| 117 |
+
exports.ByteStream = ByteStream;
|
node24/node_modules/npm/node_modules/@sigstore/core/dist/x509/cert.js
ADDED
|
@@ -0,0 +1,245 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"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 () {
|
| 19 |
+
var ownKeys = function(o) {
|
| 20 |
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
| 21 |
+
var ar = [];
|
| 22 |
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
| 23 |
+
return ar;
|
| 24 |
+
};
|
| 25 |
+
return ownKeys(o);
|
| 26 |
+
};
|
| 27 |
+
return function (mod) {
|
| 28 |
+
if (mod && mod.__esModule) return mod;
|
| 29 |
+
var result = {};
|
| 30 |
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
| 31 |
+
__setModuleDefault(result, mod);
|
| 32 |
+
return result;
|
| 33 |
+
};
|
| 34 |
+
})();
|
| 35 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 36 |
+
exports.X509Certificate = exports.EXTENSION_OID_SCT = void 0;
|
| 37 |
+
/*
|
| 38 |
+
Copyright 2023 The Sigstore Authors.
|
| 39 |
+
|
| 40 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 41 |
+
you may not use this file except in compliance with the License.
|
| 42 |
+
You may obtain a copy of the License at
|
| 43 |
+
|
| 44 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 45 |
+
|
| 46 |
+
Unless required by applicable law or agreed to in writing, software
|
| 47 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 48 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 49 |
+
See the License for the specific language governing permissions and
|
| 50 |
+
limitations under the License.
|
| 51 |
+
*/
|
| 52 |
+
const asn1_1 = require("../asn1");
|
| 53 |
+
const crypto = __importStar(require("../crypto"));
|
| 54 |
+
const oid_1 = require("../oid");
|
| 55 |
+
const pem = __importStar(require("../pem"));
|
| 56 |
+
const ext_1 = require("./ext");
|
| 57 |
+
const EXTENSION_OID_SUBJECT_KEY_ID = '2.5.29.14';
|
| 58 |
+
const EXTENSION_OID_KEY_USAGE = '2.5.29.15';
|
| 59 |
+
const EXTENSION_OID_SUBJECT_ALT_NAME = '2.5.29.17';
|
| 60 |
+
const EXTENSION_OID_BASIC_CONSTRAINTS = '2.5.29.19';
|
| 61 |
+
const EXTENSION_OID_AUTHORITY_KEY_ID = '2.5.29.35';
|
| 62 |
+
exports.EXTENSION_OID_SCT = '1.3.6.1.4.1.11129.2.4.2';
|
| 63 |
+
class X509Certificate {
|
| 64 |
+
root;
|
| 65 |
+
constructor(asn1) {
|
| 66 |
+
this.root = asn1;
|
| 67 |
+
}
|
| 68 |
+
static parse(cert) {
|
| 69 |
+
const der = typeof cert === 'string' ? pem.toDER(cert) : cert;
|
| 70 |
+
const asn1 = asn1_1.ASN1Obj.parseBuffer(der);
|
| 71 |
+
return new X509Certificate(asn1);
|
| 72 |
+
}
|
| 73 |
+
get tbsCertificate() {
|
| 74 |
+
return this.tbsCertificateObj;
|
| 75 |
+
}
|
| 76 |
+
get version() {
|
| 77 |
+
// version number is the first element of the version context specific tag
|
| 78 |
+
const ver = this.versionObj.subs[0].toInteger();
|
| 79 |
+
return `v${(ver + BigInt(1)).toString()}`;
|
| 80 |
+
}
|
| 81 |
+
get serialNumber() {
|
| 82 |
+
return this.serialNumberObj.value;
|
| 83 |
+
}
|
| 84 |
+
get notBefore() {
|
| 85 |
+
// notBefore is the first element of the validity sequence
|
| 86 |
+
return this.validityObj.subs[0].toDate();
|
| 87 |
+
}
|
| 88 |
+
get notAfter() {
|
| 89 |
+
// notAfter is the second element of the validity sequence
|
| 90 |
+
return this.validityObj.subs[1].toDate();
|
| 91 |
+
}
|
| 92 |
+
get issuer() {
|
| 93 |
+
return this.issuerObj.value;
|
| 94 |
+
}
|
| 95 |
+
get subject() {
|
| 96 |
+
return this.subjectObj.value;
|
| 97 |
+
}
|
| 98 |
+
get publicKey() {
|
| 99 |
+
return this.subjectPublicKeyInfoObj.toDER();
|
| 100 |
+
}
|
| 101 |
+
get signatureAlgorithm() {
|
| 102 |
+
const oid = this.signatureAlgorithmObj.subs[0].toOID();
|
| 103 |
+
if (oid_1.RSA_SIGNATURE_ALGOS[oid]) {
|
| 104 |
+
return oid_1.RSA_SIGNATURE_ALGOS[oid];
|
| 105 |
+
}
|
| 106 |
+
return oid_1.ECDSA_SIGNATURE_ALGOS[oid];
|
| 107 |
+
}
|
| 108 |
+
get signatureValue() {
|
| 109 |
+
// Signature value is a bit string, so we need to skip the first byte
|
| 110 |
+
return this.signatureValueObj.value.subarray(1);
|
| 111 |
+
}
|
| 112 |
+
get subjectAltName() {
|
| 113 |
+
const ext = this.extSubjectAltName;
|
| 114 |
+
return ext?.uri || /* istanbul ignore next */ ext?.rfc822Name;
|
| 115 |
+
}
|
| 116 |
+
get extensions() {
|
| 117 |
+
// The extension list is the first (and only) element of the extensions
|
| 118 |
+
// context specific tag
|
| 119 |
+
/* istanbul ignore next */
|
| 120 |
+
const extSeq = this.extensionsObj?.subs[0];
|
| 121 |
+
/* istanbul ignore next */
|
| 122 |
+
return extSeq?.subs || [];
|
| 123 |
+
}
|
| 124 |
+
get extKeyUsage() {
|
| 125 |
+
const ext = this.findExtension(EXTENSION_OID_KEY_USAGE);
|
| 126 |
+
return ext ? new ext_1.X509KeyUsageExtension(ext) : undefined;
|
| 127 |
+
}
|
| 128 |
+
get extBasicConstraints() {
|
| 129 |
+
const ext = this.findExtension(EXTENSION_OID_BASIC_CONSTRAINTS);
|
| 130 |
+
return ext ? new ext_1.X509BasicConstraintsExtension(ext) : undefined;
|
| 131 |
+
}
|
| 132 |
+
get extSubjectAltName() {
|
| 133 |
+
const ext = this.findExtension(EXTENSION_OID_SUBJECT_ALT_NAME);
|
| 134 |
+
return ext ? new ext_1.X509SubjectAlternativeNameExtension(ext) : undefined;
|
| 135 |
+
}
|
| 136 |
+
get extAuthorityKeyID() {
|
| 137 |
+
const ext = this.findExtension(EXTENSION_OID_AUTHORITY_KEY_ID);
|
| 138 |
+
return ext ? new ext_1.X509AuthorityKeyIDExtension(ext) : undefined;
|
| 139 |
+
}
|
| 140 |
+
get extSubjectKeyID() {
|
| 141 |
+
const ext = this.findExtension(EXTENSION_OID_SUBJECT_KEY_ID);
|
| 142 |
+
return ext
|
| 143 |
+
? new ext_1.X509SubjectKeyIDExtension(ext)
|
| 144 |
+
: /* istanbul ignore next */ undefined;
|
| 145 |
+
}
|
| 146 |
+
get extSCT() {
|
| 147 |
+
const ext = this.findExtension(exports.EXTENSION_OID_SCT);
|
| 148 |
+
return ext ? new ext_1.X509SCTExtension(ext) : undefined;
|
| 149 |
+
}
|
| 150 |
+
get isCA() {
|
| 151 |
+
const ca = this.extBasicConstraints?.isCA || false;
|
| 152 |
+
// If the KeyUsage extension is present, keyCertSign must be set
|
| 153 |
+
/* istanbul ignore else */
|
| 154 |
+
if (this.extKeyUsage) {
|
| 155 |
+
return ca && this.extKeyUsage.keyCertSign;
|
| 156 |
+
}
|
| 157 |
+
// TODO: test coverage for this case
|
| 158 |
+
/* istanbul ignore next */
|
| 159 |
+
return ca;
|
| 160 |
+
}
|
| 161 |
+
extension(oid) {
|
| 162 |
+
const ext = this.findExtension(oid);
|
| 163 |
+
return ext ? new ext_1.X509Extension(ext) : undefined;
|
| 164 |
+
}
|
| 165 |
+
verify(issuerCertificate) {
|
| 166 |
+
// Use the issuer's public key if provided, otherwise use the subject's
|
| 167 |
+
const publicKey = issuerCertificate?.publicKey || this.publicKey;
|
| 168 |
+
const key = crypto.createPublicKey(publicKey);
|
| 169 |
+
return crypto.verify(this.tbsCertificate.toDER(), key, this.signatureValue, this.signatureAlgorithm);
|
| 170 |
+
}
|
| 171 |
+
validForDate(date) {
|
| 172 |
+
return this.notBefore <= date && date <= this.notAfter;
|
| 173 |
+
}
|
| 174 |
+
equals(other) {
|
| 175 |
+
return this.root.toDER().equals(other.root.toDER());
|
| 176 |
+
}
|
| 177 |
+
// Creates a copy of the certificate with a new buffer
|
| 178 |
+
clone() {
|
| 179 |
+
const der = this.root.toDER();
|
| 180 |
+
const clone = Buffer.alloc(der.length);
|
| 181 |
+
der.copy(clone);
|
| 182 |
+
return X509Certificate.parse(clone);
|
| 183 |
+
}
|
| 184 |
+
findExtension(oid) {
|
| 185 |
+
// Find the extension with the given OID. The OID will always be the first
|
| 186 |
+
// element of the extension sequence
|
| 187 |
+
return this.extensions.find((ext) => ext.subs[0].toOID() === oid);
|
| 188 |
+
}
|
| 189 |
+
/////////////////////////////////////////////////////////////////////////////
|
| 190 |
+
// The following properties use the documented x509 structure to locate the
|
| 191 |
+
// desired ASN.1 object
|
| 192 |
+
// https://www.rfc-editor.org/rfc/rfc5280#section-4.1
|
| 193 |
+
// https://www.rfc-editor.org/rfc/rfc5280#section-4.1.1.1
|
| 194 |
+
get tbsCertificateObj() {
|
| 195 |
+
// tbsCertificate is the first element of the certificate sequence
|
| 196 |
+
return this.root.subs[0];
|
| 197 |
+
}
|
| 198 |
+
// https://www.rfc-editor.org/rfc/rfc5280#section-4.1.1.2
|
| 199 |
+
get signatureAlgorithmObj() {
|
| 200 |
+
// signatureAlgorithm is the second element of the certificate sequence
|
| 201 |
+
return this.root.subs[1];
|
| 202 |
+
}
|
| 203 |
+
// https://www.rfc-editor.org/rfc/rfc5280#section-4.1.1.3
|
| 204 |
+
get signatureValueObj() {
|
| 205 |
+
// signatureValue is the third element of the certificate sequence
|
| 206 |
+
return this.root.subs[2];
|
| 207 |
+
}
|
| 208 |
+
// https://www.rfc-editor.org/rfc/rfc5280#section-4.1.2.1
|
| 209 |
+
get versionObj() {
|
| 210 |
+
// version is the first element of the tbsCertificate sequence
|
| 211 |
+
return this.tbsCertificateObj.subs[0];
|
| 212 |
+
}
|
| 213 |
+
// https://www.rfc-editor.org/rfc/rfc5280#section-4.1.2.2
|
| 214 |
+
get serialNumberObj() {
|
| 215 |
+
// serialNumber is the second element of the tbsCertificate sequence
|
| 216 |
+
return this.tbsCertificateObj.subs[1];
|
| 217 |
+
}
|
| 218 |
+
// https://www.rfc-editor.org/rfc/rfc5280#section-4.1.2.4
|
| 219 |
+
get issuerObj() {
|
| 220 |
+
// issuer is the fourth element of the tbsCertificate sequence
|
| 221 |
+
return this.tbsCertificateObj.subs[3];
|
| 222 |
+
}
|
| 223 |
+
// https://www.rfc-editor.org/rfc/rfc5280#section-4.1.2.5
|
| 224 |
+
get validityObj() {
|
| 225 |
+
// version is the fifth element of the tbsCertificate sequence
|
| 226 |
+
return this.tbsCertificateObj.subs[4];
|
| 227 |
+
}
|
| 228 |
+
// https://www.rfc-editor.org/rfc/rfc5280#section-4.1.2.6
|
| 229 |
+
get subjectObj() {
|
| 230 |
+
// subject is the sixth element of the tbsCertificate sequence
|
| 231 |
+
return this.tbsCertificateObj.subs[5];
|
| 232 |
+
}
|
| 233 |
+
// https://www.rfc-editor.org/rfc/rfc5280#section-4.1.2.7
|
| 234 |
+
get subjectPublicKeyInfoObj() {
|
| 235 |
+
// subjectPublicKeyInfo is the seventh element of the tbsCertificate sequence
|
| 236 |
+
return this.tbsCertificateObj.subs[6];
|
| 237 |
+
}
|
| 238 |
+
// Extensions can't be located by index because their position varies. Instead,
|
| 239 |
+
// we need to find the extensions context specific tag
|
| 240 |
+
// https://www.rfc-editor.org/rfc/rfc5280#section-4.1.2.9
|
| 241 |
+
get extensionsObj() {
|
| 242 |
+
return this.tbsCertificateObj.subs.find((sub) => sub.tag.isContextSpecific(0x03));
|
| 243 |
+
}
|
| 244 |
+
}
|
| 245 |
+
exports.X509Certificate = X509Certificate;
|