Skip to content

Commit 4d7833c

Browse files
authored
Merge pull request #491 from sigstore/add-tuf-root-for-staging
Use tuf cdn, add staging
2 parents 96a4da9 + e466407 commit 4d7833c

File tree

12 files changed

+101
-336
lines changed

12 files changed

+101
-336
lines changed

sigstore-java/src/main/java/dev/sigstore/tuf/SigstoreTufClient.java

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public Builder usePublicGoodInstance() {
7272
}
7373
try {
7474
tufMirror(
75-
new URL("https://storage.googleapis.com/sigstore-tuf-root/"),
75+
new URL("https://tuf-repo-cdn.sigstore.dev"),
7676
Path.of(
7777
Resources.getResource("dev/sigstore/tuf/sigstore-tuf-root/root.json").getPath()));
7878
} catch (MalformedURLException e) {
@@ -81,6 +81,27 @@ public Builder usePublicGoodInstance() {
8181
return this;
8282
}
8383

84+
public Builder useStagingInstance() {
85+
if (remoteMirror != null || trustedRoot != null) {
86+
throw new IllegalStateException(
87+
"Using staging after configuring remoteMirror and trustedRoot");
88+
}
89+
try {
90+
tufMirror(
91+
new URL("https://tuf-repo-cdn.sigstage.dev"),
92+
Path.of(
93+
Resources.getResource("dev/sigstore/tuf/tuf-root-staging/root.json").getPath()));
94+
} catch (MalformedURLException e) {
95+
throw new AssertionError(e);
96+
}
97+
tufCacheLocation =
98+
Path.of(System.getProperty("user.home"))
99+
.resolve(".sigstore-java")
100+
.resolve("staging")
101+
.resolve("root");
102+
return this;
103+
}
104+
84105
public Builder tufMirror(URL mirror, Path trustedRoot) {
85106
this.remoteMirror = mirror;
86107
this.trustedRoot = trustedRoot;

sigstore-java/src/main/resources/dev/sigstore/tuf/tuf-root-staging/1.root.json

Lines changed: 0 additions & 87 deletions
This file was deleted.
Lines changed: 63 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,65 @@
11
{
2-
"signatures": [
3-
{
4-
"keyid": "baf73fa38311c699f6b2583a6493afb3e3974b333ed61c4a370d0787e2012093",
5-
"sig": "2f8194ea672740abe0bd38464f35af43ec6de5c8ef8fa43c49525e2bf9ae4dcd243c8f95d1975ea2137e58b7c0e305280ac940fe617b8ac2e37290f4059e6f04"
6-
}
7-
],
8-
"signed": {
9-
"_type": "root",
10-
"consistent_snapshot": false,
11-
"expires": "2032-04-28T20:21:11Z",
12-
"keys": {
13-
"26599e08a9fe425a8863c9a4bc2b87ba0d55a9540695eb49b8d267f5578f6bc0": {
14-
"keyid_hash_algorithms": [
15-
"sha256",
16-
"sha512"
17-
],
18-
"keytype": "ed25519",
19-
"keyval": {
20-
"public": "6625fa57e94e34a2f27a3c486eb88dc69da0162e425a5f16d1b5c9d4dad79aca"
21-
},
22-
"scheme": "ed25519"
23-
},
24-
"baf73fa38311c699f6b2583a6493afb3e3974b333ed61c4a370d0787e2012093": {
25-
"keyid_hash_algorithms": [
26-
"sha256",
27-
"sha512"
28-
],
29-
"keytype": "ed25519",
30-
"keyval": {
31-
"public": "f10da95f3c08b4906e366e1a9a1222659793bce03ce80a3c448fbedeb8974ef6"
32-
},
33-
"scheme": "ed25519"
34-
},
35-
"da02af6aec8ca4c93d4558b83b81ce7deb0ea4566879d017ccfb087a3a031321": {
36-
"keyid_hash_algorithms": [
37-
"sha256",
38-
"sha512"
39-
],
40-
"keytype": "ed25519",
41-
"keyval": {
42-
"public": "e66efde4c3db6bfdac5fc4e3f54260f2655afa2aa9167da5b135e4986aeadf5a"
43-
},
44-
"scheme": "ed25519"
45-
},
46-
"dbb3cc3a3752fd0a51066f840075262b1fd28d93c3098975e4773f669943507e": {
47-
"keyid_hash_algorithms": [
48-
"sha256",
49-
"sha512"
50-
],
51-
"keytype": "ed25519",
52-
"keyval": {
53-
"public": "2af53c16edb6db039cc209b56f8fdbbff9e77a23516823b0f560134803f3a072"
54-
},
55-
"scheme": "ed25519"
56-
}
57-
},
58-
"roles": {
59-
"root": {
60-
"keyids": [
61-
"baf73fa38311c699f6b2583a6493afb3e3974b333ed61c4a370d0787e2012093"
62-
],
63-
"threshold": 1
64-
},
65-
"snapshot": {
66-
"keyids": [
67-
"da02af6aec8ca4c93d4558b83b81ce7deb0ea4566879d017ccfb087a3a031321"
68-
],
69-
"threshold": 1
70-
},
71-
"targets": {
72-
"keyids": [
73-
"dbb3cc3a3752fd0a51066f840075262b1fd28d93c3098975e4773f669943507e"
74-
],
75-
"threshold": 1
76-
},
77-
"timestamp": {
78-
"keyids": [
79-
"26599e08a9fe425a8863c9a4bc2b87ba0d55a9540695eb49b8d267f5578f6bc0"
80-
],
81-
"threshold": 1
82-
}
83-
},
84-
"spec_version": "1.0",
85-
"version": 1
86-
}
2+
"signed": {
3+
"_type": "root",
4+
"spec_version": "1.0",
5+
"version": 3,
6+
"expires": "2029-02-17T23:05:14Z",
7+
"keys": {
8+
"314ae73abd3012fc73bfcc3783e31d03852716597642b891d6a33155c4baf600": {
9+
"keytype": "ecdsa-sha2-nistp256",
10+
"scheme": "ecdsa-sha2-nistp256",
11+
"keyid_hash_algorithms": [
12+
"sha256",
13+
"sha512"
14+
],
15+
"keyval": {
16+
"public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEXMZ7rD8tWDE4lK/+naJN7INMxNC7\nbMMANDqTQE7WpzyzffWOg59hc/MwbvJtvuxhO9mEu3GD3Cn0HffFlmVRiA==\n-----END PUBLIC KEY-----\n"
17+
}
18+
},
19+
"c8e09a68b5821b75462ae0df52151c81deb7f1838246dc1da8c34cc91ec12bda": {
20+
"keytype": "ecdsa-sha2-nistp256",
21+
"scheme": "ecdsa-sha2-nistp256",
22+
"keyid_hash_algorithms": [
23+
"sha256",
24+
"sha512"
25+
],
26+
"keyval": {
27+
"public": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEL3vL/VeaH6nBbo4rekyO4cc/QthS\n+nlyJXCXSnyIMAtLmVTa8Pf0qG6YIVaR0TmLkyk9YoSVsZakxuMTuaEwrg==\n-----END PUBLIC KEY-----\n"
28+
}
29+
}
30+
},
31+
"roles": {
32+
"root": {
33+
"keyids": [
34+
"c8e09a68b5821b75462ae0df52151c81deb7f1838246dc1da8c34cc91ec12bda"
35+
],
36+
"threshold": 1
37+
},
38+
"snapshot": {
39+
"keyids": [
40+
"314ae73abd3012fc73bfcc3783e31d03852716597642b891d6a33155c4baf600"
41+
],
42+
"threshold": 1
43+
},
44+
"targets": {
45+
"keyids": [
46+
"c8e09a68b5821b75462ae0df52151c81deb7f1838246dc1da8c34cc91ec12bda"
47+
],
48+
"threshold": 1
49+
},
50+
"timestamp": {
51+
"keyids": [
52+
"314ae73abd3012fc73bfcc3783e31d03852716597642b891d6a33155c4baf600"
53+
],
54+
"threshold": 1
55+
}
56+
},
57+
"consistent_snapshot": true
58+
},
59+
"signatures": [
60+
{
61+
"keyid": "c8e09a68b5821b75462ae0df52151c81deb7f1838246dc1da8c34cc91ec12bda",
62+
"sig": "3045022061a67fc07a5dd88f0087f394d4d3ef15237115d2ee24261f2d35db07715da097022100a0efc621c0b0ba697ae75827e579dd90eef30f7bc5fdbef2c44338f791a67eeb"
63+
}
64+
]
8765
}

sigstore-java/src/main/resources/dev/sigstore/tuf/tuf-root-staging/snapshot.json

Lines changed: 0 additions & 30 deletions
This file was deleted.

sigstore-java/src/main/resources/dev/sigstore/tuf/tuf-root-staging/targets.json

Lines changed: 0 additions & 64 deletions
This file was deleted.

sigstore-java/src/main/resources/dev/sigstore/tuf/tuf-root-staging/targets/ctfe.pub

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)