Skip to content

Commit 6983a39

Browse files
committed
intoto and provenance types
Signed-off-by: CrazyMax <[email protected]>
1 parent 81e959d commit 6983a39

2 files changed

Lines changed: 89 additions & 0 deletions

File tree

src/types/intoto/intoto.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* Copyright 2024 actions-toolkit authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
// https://github.com/in-toto/in-toto-golang/blob/dd6278764ab1dae7301609c7510129888e2fd569/in_toto/envelope.go#L17
18+
export const MEDIATYPE_PAYLOAD = 'application/vnd.in-toto+json';
19+
20+
export const MEDIATYPE_PREDICATE = 'in-toto.io/predicate-type';
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/**
2+
* Copyright 2024 actions-toolkit authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
// https://github.com/in-toto/in-toto-golang/blob/master/in_toto/slsa_provenance/v0.2/provenance.go
18+
19+
export const PREDICATE_SLSA_PROVENANCE = 'https://slsa.dev/provenance/v0.2';
20+
21+
export interface ProvenancePredicate {
22+
builder: ProvenanceBuilder;
23+
buildType: string;
24+
invocation?: ProvenanceInvocation;
25+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
26+
buildConfig?: any;
27+
metadata: ProvenanceMetadata;
28+
materials?: Material[];
29+
}
30+
31+
export interface ProvenanceBuilder {
32+
id: string;
33+
}
34+
35+
export interface ProvenanceInvocation {
36+
configSource?: ConfigSource;
37+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
38+
parameters?: any;
39+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
40+
environment?: any;
41+
}
42+
43+
export interface DigestSet {
44+
[key: string]: string;
45+
}
46+
47+
export interface ConfigSource {
48+
uri?: string;
49+
digest?: DigestSet;
50+
entryPoint?: string;
51+
}
52+
53+
export interface Completeness {
54+
parameters?: boolean;
55+
environment?: boolean;
56+
materials?: boolean;
57+
}
58+
59+
export interface ProvenanceMetadata {
60+
buildInvocationId?: string;
61+
buildStartedOn?: string;
62+
completeness?: Completeness;
63+
reproducible?: boolean;
64+
}
65+
66+
export interface Material {
67+
uri: string;
68+
digest: DigestSet;
69+
}

0 commit comments

Comments
 (0)