{"name":"@sigstore/tuf","version":"3.1.0","author":{"name":"bdehamer@github.com"},"license":"Apache-2.0","_id":"@sigstore/tuf@3.1.0","maintainers":[{"name":"mylesborins","email":"myles.borins@gmail.com"},{"name":"bdehamer","email":"brian@dehamer.com"}],"homepage":"https://github.com/sigstore/sigstore-js/tree/main/packages/tuf#readme","bugs":{"url":"https://github.com/sigstore/sigstore-js/issues"},"dist":{"shasum":"f533ac8ac572c9f7e36f5e08f1effa6b2244f55a","tarball":"http://registry-npm.ywwl.com/@sigstore/tuf/download/@sigstore/tuf-3.1.0.tgz","fileCount":14,"integrity":"sha512-suVMQEA+sKdOz5hwP9qNcEjX6B45R+hFFr4LAWzbRc5O+U2IInwvay/bpG5a4s+qR35P/JK/PiKiRGjfuLy1IA==","signatures":[{"sig":"MEUCICH6davBTlwtMKIeC0E0tR47UXe9m3CnDu7wC66VODaRAiEA307bc1+6Wc+YDdP39AppZZGapcHbbUKMnjmBFLrDWPQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@sigstore%2ftuf@3.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":50762,"size":19182,"noattachment":false,"key":"/@sigstore/tuf/-/@sigstore/tuf-3.1.0.tgz"},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":"^18.17.0 || >=20.5.0"},"gitHead":"06cd267cbdc2eeaa04294995622db9f6ad2fa7cf","scripts":{"test":"jest","build":"tsc --build","clean":"shx rm -rf dist *.tsbuildinfo"},"_npmUser":{"name":"bdehamer","email":"brian@dehamer.com"},"repository":{"url":"git+https://github.com/sigstore/sigstore-js.git","type":"git"},"_npmVersion":"10.9.2","description":"Client for the Sigstore TUF repository","directories":{},"_nodeVersion":"18.17.0","dependencies":{"tuf-js":"^3.0.1","@sigstore/protobuf-specs":"^0.4.0"},"publishConfig":{"provenance":true},"_hasShrinkwrap":false,"devDependencies":{"@sigstore/jest":"^0.0.0","@tufjs/repo-mock":"^3.0.1","@types/make-fetch-happen":"^10.0.4"},"_npmOperationalInternal":{"tmp":"tmp/tuf_3.1.0_1738701348289_0.6503397365210546","host":"s3://npm-registry-packages-npm-production"},"readme":"# @sigstore/tuf &middot; [![npm version](https://img.shields.io/npm/v/@sigstore/tuf.svg?style=flat)](https://www.npmjs.com/package/@sigstore/tuf) [![CI Status](https://github.com/sigstore/sigstore-js/workflows/CI/badge.svg)](https://github.com/sigstore/sigstore-js/actions/workflows/ci.yml) [![Smoke Test Status](https://github.com/sigstore/sigstore-js/workflows/smoke-test/badge.svg)](https://github.com/sigstore/sigstore-js/actions/workflows/smoke-test.yml)\n\nA JavaScript library for securely retrieving targets from the Sigstore [TUF][1]\nrepository.\n\n## Features\n\n- Embeds the trutsted root metadata file necessary to bootstrap interaction\n  with the Sigstore TUF repository.\n- Automatically initializes the local TUF cache for storing metadata and\n  target files.\n\n## Prerequisites\n\n- Node.js version ^22.22.2 || ^24.15.0 || >=26.0.0\n\n## Installation\n\n```\nnpm install @sigstore/tuf\n```\n\n## Usage\n\n```javascript\nconst { initTUF } = require('@sigstore/tuf');\n```\n\n```javascript\nimport { initTUF } from '@sigstore/tuf';\n```\n\n### initTUF([options])\n\nReturns a TUF client which can be used to retrieve any target from the Sigstore\nTUF repository. The local TUF cache will be initialized and the TUF metadata\nfiles downloaded from the [remote repository][2] as part of the initialization\nprocess.\n\n- `options` `<Object>`\n  - `mirrorURL` `<string>`: Base URL for the Sigstore TUF repository. Defaults to `'https://tuf-repo-cdn.sigstore.dev'`\n  - `cachePath` `<string>`: Absolute path to the directory to be used for caching downloaded TUF metadata and targets. Defaults to a directory named \"sigstore-js\" within the platform-specific application data directory.\n  - `rootPath` `<string>`: Path to the initial trust root for the TUF repository. Defaults to the [embedded root](./store/public-good-instance-root.json).\n  - `forceInit` `boolean`: Force re-initialization of the TUF cache even if it already exists. Defaults to `false`.\n  - `forceCache` `boolean`: Prevents any downloads from the remote TUF repository as long as all cached metadata files are un-expired. Defaults to `false`.\n  - `force` `boolean`: Same as `forceInit` (deprecated).\n\nThe `TUF` client object returned from `initTUF` has a single `getTarget`\nfunction which takes the name of a target in the Sigstore TUF repository\nand returns the content of that target.\n\n### getTrustedRoot([options])\n\nRetrieves the most recent version of the \"trusted_root.json\" target from the\nSigstore TUF repository. The format of \"trusted_root.json\" file is described\nby the [TrustedRoot][3] protobuf and contains the complete set of trusted\nverification materials for the Sigstore public-good instance.\n\n- `options` `<Object>`\n  - `mirrorURL` `<string>`: Base URL for the Sigstore TUF repository. Defaults to `'https://tuf-repo-cdn.sigstore.dev'`\n  - `cachePath` `<string>`: Absolute path to the directory to be used for caching downloaded TUF metadata and targets. Defaults to a directory named \"sigstore-js\" within the platform-specific application data directory.\n  - `rootPath` `<string>`: Path to the initial trust root for the TUF repository. Defaults to the [embedded root](./store/public-good-instance-root.json).\n  - `forceInit` `boolean`: Force re-initialization of the TUF cache even if it already exists. Defaults to `false`.\n  - `forceCache` `boolean`: Prevents any downloads from the remote TUF repository as long as all cached metadata files are un-expired. Defaults to `false`.\n  - `force` `boolean`: Same as `forceInit` (deprecated).\n\n[1]: https://theupdateframework.io/\n[2]: https://sigstore-tuf-root.storage.googleapis.com/\n[3]: https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_trustroot.proto\n","publish_time":1738701348506,"_cnpm_publish_time":1738701348506,"dist-tags":{"latest":"5.0.1"}}