{"name":"@sigstore/tuf","version":"4.0.2","author":{"name":"bdehamer@github.com"},"license":"Apache-2.0","_id":"@sigstore/tuf@4.0.2","maintainers":[{"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":"7d2fa2abcd5afa5baf752671d14a1c6ed0ed3196","tarball":"http://registry-npm.ywwl.com/@sigstore/tuf/download/@sigstore/tuf-4.0.2.tgz","fileCount":14,"integrity":"sha512-TCAzTy0xzdP79EnxSjq9KQ3eaR7+FmudLC6eRKknVKZbV7ZNlGLClAAQb/HMNJ5n2OBNk2GT1tEmU0xuPr+SLQ==","signatures":[{"sig":"MEQCICrd7dblc10dk31RtZ1pQ6xEiqbb/dSO+kWKI6LAsgcgAiBKPWfzF6qjZtlFeAvUwRdZWxY2163+FON8fnhoWN8Xwg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@sigstore%2ftuf@4.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":48814,"size":18010,"noattachment":false,"key":"/@sigstore/tuf/-/@sigstore/tuf-4.0.2.tgz"},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":"^20.17.0 || >=22.9.0"},"gitHead":"f5e74a230bce732b021bf99e4ca56cbdadfc0eda","scripts":{"test":"jest","build":"tsc --build","clean":"shx rm -rf dist *.tsbuildinfo"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e25c47bb-9288-408b-af93-254e27a1cbc8"}},"repository":{"url":"git+https://github.com/sigstore/sigstore-js.git","type":"git"},"_npmVersion":"11.9.0","description":"Client for the Sigstore TUF repository","directories":{},"_nodeVersion":"24.14.0","dependencies":{"tuf-js":"^4.1.0","@sigstore/protobuf-specs":"^0.5.0"},"publishConfig":{"provenance":true},"_hasShrinkwrap":false,"devDependencies":{"@sigstore/jest":"^0.0.0","@tufjs/repo-mock":"^4.0.1","@types/make-fetch-happen":"^10.0.4"},"_npmOperationalInternal":{"tmp":"tmp/tuf_4.0.2_1773863528933_0.3010204124147138","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":1773863529099,"_cnpm_publish_time":1773863529099,"dist-tags":{"latest":"5.0.1"}}