Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changed provenance version #106

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;

/** Implementation of the https://slsa.dev/provenance/v0.1 */
/** Implementation of the https://slsa.dev/provenance/v0.2 */
public class Provenance extends Predicate {

/**
Expand Down Expand Up @@ -109,6 +109,6 @@ public int hashCode() {

@Override
public String getPredicateType() {
return "https://slsa.dev/provenance/v0.1";
return "https://slsa.dev/provenance/v0.2";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ public class IntotoHelperTest {
assertNotNull(jsonStatement);
String JSON_STATEMENT =
"{\n"
+ " \"_type\" : \"https://in-toto.io/Statement/v0.1\",\n"
+ " \"_type\" : \"https://in-toto.io/Statement/v0.2\",\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Statement should remain v0.1

+ " \"subject\" : [ {\n"
+ " \"name\" : \"curl-7.72.0.tar.bz2\",\n"
+ " \"digest\" : {\n"
+ " \"sha256\" : \"d4d5899a3868fbb6ae1856c3e55a32ce35913de3956d1973caccd37bd0174fa2\"\n"
+ " }\n"
+ " } ],\n"
+ " \"predicateType\" : \"https://slsa.dev/provenance/v0.1\",\n"
+ " \"predicateType\" : \"https://slsa.dev/provenance/v0.2\",\n"
+ " \"predicate\" : {\n"
+ " \"builder\" : {\n"
+ " \"id\" : \"mailto:person@example.com\"\n"
Expand Down Expand Up @@ -156,14 +156,14 @@ public void validateAndTransformToJson_shouldTransformStatementToJsonString_With
assertNotNull(jsonStatement);
String EXPECTED_JSON_STATEMENT =
"{\n"
+ " \"_type\" : \"https://in-toto.io/Statement/v0.1\",\n"
+ " \"_type\" : \"https://in-toto.io/Statement/v0.2\",\n"
+ " \"subject\" : [ {\n"
+ " \"name\" : \"curl-7.72.0.tar.bz2\",\n"
+ " \"digest\" : {\n"
+ " \"sha256\" : \"d4d5899a3868fbb6ae1856c3e55a32ce35913de3956d1973caccd37bd0174fa2\"\n"
+ " }\n"
+ " } ],\n"
+ " \"predicateType\" : \"https://slsa.dev/provenance/v0.1\",\n"
+ " \"predicateType\" : \"https://slsa.dev/provenance/v0.2\",\n"
+ " \"predicate\" : {\n"
+ " \"builder\" : {\n"
+ " \"id\" : \"mailto:person@example.com\"\n"
Expand Down Expand Up @@ -674,7 +674,7 @@ public void createPreAuthenticationEncoding_shouldCorrectlyEncode_withUtfCharact
assertNotNull(intotoEnvelope);

final String EXPECTED_DSSE_PAYLOAD =
"DSSEv1 28 application/vnd.in-toto+json 562 {\"_type\":\"https://in-toto.io/Statement/v0.1\",\"subject\":[{\"name\":\"curl-7.72.0.tar.bz2\",\"digest\":{\"sha256\":\"d4d5899a3868fbb6ae1856c3e55a32ce35913de3956d1973caccd37bd0174fa2\"}}],\"predicateType\":\"https://slsa.dev/provenance/v0.1\",\"predicate\":{\"builder\":{\"id\":\"mailto:person@example.com\"},\"buildType\":\"https://example.com/Makefile\",\"invocation\":{\"configSource\":{\"uri\":\"https://example.com/example-1.2.3.tar.gz\",\"digest\":{\"sha256\":\"323d323edvgd\"},\"entryPoint\":\"src:foo\"}},\"materials\":[{\"uri\":\"https://example.com/example-1.2.3.tar.gz\",\"digest\":{\"sha256\":\"1234...\"}}]}}";
"DSSEv1 28 application/vnd.in-toto+json 562 {\"_type\":\"https://in-toto.io/Statement/v0.2\",\"subject\":[{\"name\":\"curl-7.72.0.tar.bz2\",\"digest\":{\"sha256\":\"d4d5899a3868fbb6ae1856c3e55a32ce35913de3956d1973caccd37bd0174fa2\"}}],\"predicateType\":\"https://slsa.dev/provenance/v0.2\",\"predicate\":{\"builder\":{\"id\":\"mailto:person@example.com\"},\"buildType\":\"https://example.com/Makefile\",\"invocation\":{\"configSource\":{\"uri\":\"https://example.com/example-1.2.3.tar.gz\",\"digest\":{\"sha256\":\"323d323edvgd\"},\"entryPoint\":\"src:foo\"}},\"materials\":[{\"uri\":\"https://example.com/example-1.2.3.tar.gz\",\"digest\":{\"sha256\":\"1234...\"}}]}}";

SimpleECDSAVerifier verifier = new SimpleECDSAVerifier();

Expand Down