Skip to content

Commit

Permalink
move TUF seeds into JSON file (#948)
Browse files Browse the repository at this point in the history
Signed-off-by: Brian DeHamer <bdehamer@github.com>
  • Loading branch information
bdehamer authored Jan 11, 2024
1 parent 4089730 commit da83e69
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 22 deletions.
5 changes: 5 additions & 0 deletions .changeset/yellow-phones-know.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sigstore/tuf": patch
---

Move TUF seeds into JSON file
3 changes: 2 additions & 1 deletion packages/tuf/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"test": "jest"
},
"files": [
"dist"
"dist",
"seeds.json"
],
"author": "bdehamer@github.com",
"license": "Apache-2.0",
Expand Down
1 change: 1 addition & 0 deletions packages/tuf/seeds.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"https://tuf-repo-cdn.sigstore.dev":{"root.json":"eyJzaWduZWQiOnsiX3R5cGUiOiJyb290Iiwic3BlY192ZXJzaW9uIjoiMS4wIiwidmVyc2lvbiI6NywiZXhwaXJlcyI6IjIwMjMtMTAtMDRUMTM6MDg6MTFaIiwia2V5cyI6eyIyNWEwZWI0NTBmZDNlZTJiZDc5MjE4Yzk2M2RjZTNmMWNjNjExOGJhZGYyNTFiZjE0OWYwYmQwN2Q1Y2FiZTk5Ijp7ImtleXR5cGUiOiJlY2RzYS1zaGEyLW5pc3RwMjU2Iiwic2NoZW1lIjoiZWNkc2Etc2hhMi1uaXN0cDI1NiIsImtleWlkX2hhc2hfYWxnb3JpdGhtcyI6WyJzaGEyNTYiLCJzaGE1MTIiXSwia2V5dmFsIjp7InB1YmxpYyI6Ii0tLS0tQkVHSU4gUFVCTElDIEtFWS0tLS0tXG5NRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUVFWHN6M1NaWEZiOGpNVjQyajZwSmx5amJqUjhLXG5OM0J3b2NleHE2TE1JYjVxc1dLT1F2TE4xNk5VZWZM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KICAgICAgInZhbGlkRm9yIjogewogICAgICAgICJzdGFydCI6ICIyMDIzLTA0LTE0VDAwOjAwOjAwLjAwMFoiCiAgICAgIH0KICAgIH0KICBdCn0K","registry.npmjs.org%2Fkeys.json":"ewogICAgImtleXMiOiBbCiAgICAgICAgewogICAgICAgICAgICAia2V5SWQiOiAiU0hBMjU2OmpsM2J3c3d1ODBQampva0NnaDBvMnc1YzJVNExoUUFFNTdnajljejFrekEiLAogICAgICAgICAgICAia2V5VXNhZ2UiOiAibnBtOnNpZ25hdHVyZXMiLAogICAgICAgICAgICAicHVibGljS2V5IjogewogICAgICAgICAgICAgICAgInJhd0J5dGVzIjogIk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRTFPbGIzek1BRkZ4WEtIaUlrUU81Y0ozWWhsNWk2VVBwK0lodXRlQkpidUhjQTVVb2dLbzBFV3RsV3dXNktTYUtvVE5FWUw3SmxDUWlWbmtoQmt0VWdnPT0iLAogICAgICAgICAgICAgICAgImtleURldGFpbHMiOiAiUEtJWF9FQ0RTQV9QMjU2X1NIQV8yNTYiLAogICAgICAgICAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgICAgICAgICAgICJzdGFydCI6ICIxOTk5LTAxLTAxVDAwOjAwOjAwLjAwMFoiCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9LAogICAgICAgIHsKICAgICAgICAgICAgImtleUlkIjogIlNIQTI1NjpqbDNid3N3dTgwUGpqb2tDZ2gwbzJ3NWMyVTRMaFFBRTU3Z2o5Y3oxa3pBIiwKICAgICAgICAgICAgImtleVVzYWdlIjogIm5wbTphdHRlc3RhdGlvbnMiLAogICAgICAgICAgICAicHVibGljS2V5IjogewogICAgICAgICAgICAgICAgInJhd0J5dGVzIjogIk1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRTFPbGIzek1BRkZ4WEtIaUlrUU81Y0ozWWhsNWk2VVBwK0lodXRlQkpidUhjQTVVb2dLbzBFV3RsV3dXNktTYUtvVE5FWUw3SmxDUWlWbmtoQmt0VWdnPT0iLAogICAgICAgICAgICAgICAgImtleURldGFpbHMiOiAiUEtJWF9FQ0RTQV9QMjU2X1NIQV8yNTYiLAogICAgICAgICAgICAgICAgInZhbGlkRm9yIjogewogICAgICAgICAgICAgICAgICAgICJzdGFydCI6ICIyMDIyLTEyLTAxVDAwOjAwOjAwLjAwMFoiCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICBdCn0K"}}}
6 changes: 4 additions & 2 deletions packages/tuf/src/__tests__/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ import os from 'os';
import path from 'path';
import { TUFClient, TUFOptions } from '../client';
import { TUFError } from '../error';
import { REPO_SEEDS } from '../store';

describe('TUFClient', () => {
describe('constructor', () => {
const repoSeeds = JSON.parse(
fs.readFileSync(require.resolve('../../seeds.json')).toString('utf-8')
);
let rootSeedDir: string;
let rootPath: string;

Expand All @@ -43,7 +45,7 @@ describe('TUFClient', () => {
fs.writeFileSync(
rootPath,
Buffer.from(
REPO_SEEDS['https://tuf-repo-cdn.sigstore.dev']['root.json'],
repoSeeds['https://tuf-repo-cdn.sigstore.dev']['root.json'],
'base64'
)
);
Expand Down
15 changes: 13 additions & 2 deletions packages/tuf/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,22 @@ import fs from 'fs';
import path from 'path';
import { Config, Updater } from 'tuf-js';
import { TUFError } from '.';
import { REPO_SEEDS } from './store';
import { readTarget } from './target';

import type { MakeFetchHappenOptions } from 'make-fetch-happen';

export type Retry = MakeFetchHappenOptions['retry'];

const TUF_SEEDS_PATH = require.resolve('../seeds.json');
const TARGETS_DIR_NAME = 'targets';

type RepoSeed = {
'root.json': string;
targets: Record<string, string>;
};

type RepoSeeds = Record<string, RepoSeed>;

type FetchOptions = {
retry?: Retry;
timeout?: number;
Expand Down Expand Up @@ -118,7 +125,11 @@ function seedCache({
if (tufRootPath) {
fs.copyFileSync(tufRootPath, cachedRootPath);
} else {
const repoSeed = REPO_SEEDS[mirrorURL];
// Load the embedded repo seeds
const seeds: RepoSeeds = JSON.parse(
fs.readFileSync(TUF_SEEDS_PATH).toString('utf-8')
);
const repoSeed = seeds[mirrorURL];

if (!repoSeed) {
throw new TUFError({
Expand Down
Loading

0 comments on commit da83e69

Please sign in to comment.