From aff1f2e95f01876cbb91acbd262dc9559aa318bc Mon Sep 17 00:00:00 2001 From: Christopher Phillips Date: Tue, 26 Sep 2023 10:40:13 -0400 Subject: [PATCH 1/3] chore: update to latest final 2.1.0 Signed-off-by: Christopher Phillips --- sarif/sarif.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sarif/sarif.go b/sarif/sarif.go index fa8aa83..fdaf117 100644 --- a/sarif/sarif.go +++ b/sarif/sarif.go @@ -15,7 +15,7 @@ type Version string const Version210 Version = "2.1.0" var versions = map[Version]string{ - Version210: "https://json.schemastore.org/sarif-2.1.0-rtm.5.json", + Version210: "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", } // Report is the encapsulating type representing a Sarif Report From dfe6d4cf77937cd160aec6c4821e5eb8b4c14c5a Mon Sep 17 00:00:00 2001 From: Christopher Phillips Date: Tue, 26 Sep 2023 10:46:35 -0400 Subject: [PATCH 2/3] chore: update all instances of rtm with final Signed-off-by: Christopher Phillips --- README.md | 2 +- test/report_test.go | 14 +++++++------- v2/sarif/sarif.go | 2 +- v2/test/report_test.go | 14 +++++++------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 968e571..6235420 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ This example is taken directly from the [Microsoft sarif pages](https://github.c ```json { "version": "2.1.0", - "$schema": "https://json.schemastore.org/sarif-2.1.0-rtm.5.json", + "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "runs": [ { "tool": { diff --git a/test/report_test.go b/test/report_test.go index 5bd4ccb..4dabead 100644 --- a/test/report_test.go +++ b/test/report_test.go @@ -13,7 +13,7 @@ func Test_new_simple_report_with_single_run(t *testing.T) { given.a_new_report(). with_a_run_added("tfsec", "https://tfsec.dev") - then.report_text_is(`{"version":"2.1.0","$schema":"https://json.schemastore.org/sarif-2.1.0-rtm.5.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"results":[]}]}`) + then.report_text_is(`{"version":"2.1.0","$schema":"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"results":[]}]}`) } func Test_new_report_with_empty_run(t *testing.T) { @@ -21,7 +21,7 @@ func Test_new_report_with_empty_run(t *testing.T) { given.a_new_report(). with_a_run_with_empty_result_added("tfsec", "https://tfsec.dev") - then.report_text_is(`{"version":"2.1.0","$schema":"https://json.schemastore.org/sarif-2.1.0-rtm.5.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"results":[]}]}`) + then.report_text_is(`{"version":"2.1.0","$schema":"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"results":[]}]}`) } func Test_new_simple_report_with_artifact(t *testing.T) { @@ -30,7 +30,7 @@ func Test_new_simple_report_with_artifact(t *testing.T) { run := given.a_new_report(). with_a_run_added("tfsec", "https://tfsec.dev") when.an_artifact_is_added_to_the_run(run, "file://broken.go") - then.report_text_is(`{"version":"2.1.0","$schema":"https://json.schemastore.org/sarif-2.1.0-rtm.5.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"artifacts":[{"location":{"uri":"file://broken.go"},"length":-1}],"results":[]}]}`) + then.report_text_is(`{"version":"2.1.0","$schema":"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"artifacts":[{"location":{"uri":"file://broken.go"},"length":-1}],"results":[]}]}`) } func Test_new_simple_report_with_propertybag(t *testing.T) { @@ -39,7 +39,7 @@ func Test_new_simple_report_with_propertybag(t *testing.T) { run := given.a_new_report(). with_a_run_added("tfsec", "https://tfsec.dev") when.some_properties_are_added_to_the_run(run) - then.report_text_is(`{"version":"2.1.0","$schema":"https://json.schemastore.org/sarif-2.1.0-rtm.5.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"results":[],"properties":{"integer_property":10,"string_property":"this is a string"}}]}`) + then.report_text_is(`{"version":"2.1.0","$schema":"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"results":[],"properties":{"integer_property":10,"string_property":"this is a string"}}]}`) } func Test_new_simple_report_with_duplicate_artifact(t *testing.T) { @@ -50,7 +50,7 @@ func Test_new_simple_report_with_duplicate_artifact(t *testing.T) { when.an_artifact_is_added_to_the_run(run, "file://broken.go"). and(). an_artifact_is_added_to_the_run(run, "file://broken.go") - then.report_text_is(`{"version":"2.1.0","$schema":"https://json.schemastore.org/sarif-2.1.0-rtm.5.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"artifacts":[{"location":{"uri":"file://broken.go"},"length":-1},{"location":{"uri":"file://broken.go"},"length":-1}],"results":[]}]}`) + then.report_text_is(`{"version":"2.1.0","$schema":"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"artifacts":[{"location":{"uri":"file://broken.go"},"length":-1},{"location":{"uri":"file://broken.go"},"length":-1}],"results":[]}]}`) } func Test_load_sarif_from_string(t *testing.T) { @@ -58,7 +58,7 @@ func Test_load_sarif_from_string(t *testing.T) { content := `{ "version": "2.1.0", - "$schema": "https://json.schemastore.org/sarif-2.1.0-rtm.5.json", + "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "runs": [ { "tool": { @@ -80,7 +80,7 @@ func Test_load_sarif_report_from_file(t *testing.T) { content := `{ "version": "2.1.0", - "$schema": "https://json.schemastore.org/sarif-2.1.0-rtm.5.json", + "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "runs": [ { "tool": { diff --git a/v2/sarif/sarif.go b/v2/sarif/sarif.go index 055aa9f..5f6208e 100644 --- a/v2/sarif/sarif.go +++ b/v2/sarif/sarif.go @@ -19,7 +19,7 @@ const ( var versions = map[Version]string{ Version210: "https://json.schemastore.org/sarif-2.1.0.json", - Version210RTM5: "https://json.schemastore.org/sarif-2.1.0-rtm.5.json", + Version210RTM5: "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", } // Report is the encapsulating type representing a Sarif Report diff --git a/v2/test/report_test.go b/v2/test/report_test.go index 5bd4ccb..4dabead 100644 --- a/v2/test/report_test.go +++ b/v2/test/report_test.go @@ -13,7 +13,7 @@ func Test_new_simple_report_with_single_run(t *testing.T) { given.a_new_report(). with_a_run_added("tfsec", "https://tfsec.dev") - then.report_text_is(`{"version":"2.1.0","$schema":"https://json.schemastore.org/sarif-2.1.0-rtm.5.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"results":[]}]}`) + then.report_text_is(`{"version":"2.1.0","$schema":"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"results":[]}]}`) } func Test_new_report_with_empty_run(t *testing.T) { @@ -21,7 +21,7 @@ func Test_new_report_with_empty_run(t *testing.T) { given.a_new_report(). with_a_run_with_empty_result_added("tfsec", "https://tfsec.dev") - then.report_text_is(`{"version":"2.1.0","$schema":"https://json.schemastore.org/sarif-2.1.0-rtm.5.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"results":[]}]}`) + then.report_text_is(`{"version":"2.1.0","$schema":"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"results":[]}]}`) } func Test_new_simple_report_with_artifact(t *testing.T) { @@ -30,7 +30,7 @@ func Test_new_simple_report_with_artifact(t *testing.T) { run := given.a_new_report(). with_a_run_added("tfsec", "https://tfsec.dev") when.an_artifact_is_added_to_the_run(run, "file://broken.go") - then.report_text_is(`{"version":"2.1.0","$schema":"https://json.schemastore.org/sarif-2.1.0-rtm.5.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"artifacts":[{"location":{"uri":"file://broken.go"},"length":-1}],"results":[]}]}`) + then.report_text_is(`{"version":"2.1.0","$schema":"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"artifacts":[{"location":{"uri":"file://broken.go"},"length":-1}],"results":[]}]}`) } func Test_new_simple_report_with_propertybag(t *testing.T) { @@ -39,7 +39,7 @@ func Test_new_simple_report_with_propertybag(t *testing.T) { run := given.a_new_report(). with_a_run_added("tfsec", "https://tfsec.dev") when.some_properties_are_added_to_the_run(run) - then.report_text_is(`{"version":"2.1.0","$schema":"https://json.schemastore.org/sarif-2.1.0-rtm.5.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"results":[],"properties":{"integer_property":10,"string_property":"this is a string"}}]}`) + then.report_text_is(`{"version":"2.1.0","$schema":"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"results":[],"properties":{"integer_property":10,"string_property":"this is a string"}}]}`) } func Test_new_simple_report_with_duplicate_artifact(t *testing.T) { @@ -50,7 +50,7 @@ func Test_new_simple_report_with_duplicate_artifact(t *testing.T) { when.an_artifact_is_added_to_the_run(run, "file://broken.go"). and(). an_artifact_is_added_to_the_run(run, "file://broken.go") - then.report_text_is(`{"version":"2.1.0","$schema":"https://json.schemastore.org/sarif-2.1.0-rtm.5.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"artifacts":[{"location":{"uri":"file://broken.go"},"length":-1},{"location":{"uri":"file://broken.go"},"length":-1}],"results":[]}]}`) + then.report_text_is(`{"version":"2.1.0","$schema":"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"artifacts":[{"location":{"uri":"file://broken.go"},"length":-1},{"location":{"uri":"file://broken.go"},"length":-1}],"results":[]}]}`) } func Test_load_sarif_from_string(t *testing.T) { @@ -58,7 +58,7 @@ func Test_load_sarif_from_string(t *testing.T) { content := `{ "version": "2.1.0", - "$schema": "https://json.schemastore.org/sarif-2.1.0-rtm.5.json", + "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "runs": [ { "tool": { @@ -80,7 +80,7 @@ func Test_load_sarif_report_from_file(t *testing.T) { content := `{ "version": "2.1.0", - "$schema": "https://json.schemastore.org/sarif-2.1.0-rtm.5.json", + "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "runs": [ { "tool": { From 1000f5e0555402a872c088f4ca21f8500c4dc070 Mon Sep 17 00:00:00 2001 From: Owen Rumney Date: Tue, 3 Oct 2023 13:26:07 +0100 Subject: [PATCH 3/3] chore: use the oasis-open endpoint --- README.md | 2 +- sarif/sarif.go | 2 +- test/report_test.go | 14 +++++++------- v2/sarif/sarif.go | 8 +++++--- v2/test/report_test.go | 14 +++++++------- 5 files changed, 21 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 6235420..5a0a5da 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ This example is taken directly from the [Microsoft sarif pages](https://github.c ```json { "version": "2.1.0", - "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", + "$schema": "https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json", "runs": [ { "tool": { diff --git a/sarif/sarif.go b/sarif/sarif.go index fdaf117..9b54465 100644 --- a/sarif/sarif.go +++ b/sarif/sarif.go @@ -15,7 +15,7 @@ type Version string const Version210 Version = "2.1.0" var versions = map[Version]string{ - Version210: "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", + Version210: "https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json", } // Report is the encapsulating type representing a Sarif Report diff --git a/test/report_test.go b/test/report_test.go index 4dabead..9431ff9 100644 --- a/test/report_test.go +++ b/test/report_test.go @@ -13,7 +13,7 @@ func Test_new_simple_report_with_single_run(t *testing.T) { given.a_new_report(). with_a_run_added("tfsec", "https://tfsec.dev") - then.report_text_is(`{"version":"2.1.0","$schema":"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"results":[]}]}`) + then.report_text_is(`{"version":"2.1.0","$schema":"https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"results":[]}]}`) } func Test_new_report_with_empty_run(t *testing.T) { @@ -21,7 +21,7 @@ func Test_new_report_with_empty_run(t *testing.T) { given.a_new_report(). with_a_run_with_empty_result_added("tfsec", "https://tfsec.dev") - then.report_text_is(`{"version":"2.1.0","$schema":"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"results":[]}]}`) + then.report_text_is(`{"version":"2.1.0","$schema":"https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"results":[]}]}`) } func Test_new_simple_report_with_artifact(t *testing.T) { @@ -30,7 +30,7 @@ func Test_new_simple_report_with_artifact(t *testing.T) { run := given.a_new_report(). with_a_run_added("tfsec", "https://tfsec.dev") when.an_artifact_is_added_to_the_run(run, "file://broken.go") - then.report_text_is(`{"version":"2.1.0","$schema":"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"artifacts":[{"location":{"uri":"file://broken.go"},"length":-1}],"results":[]}]}`) + then.report_text_is(`{"version":"2.1.0","$schema":"https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"artifacts":[{"location":{"uri":"file://broken.go"},"length":-1}],"results":[]}]}`) } func Test_new_simple_report_with_propertybag(t *testing.T) { @@ -39,7 +39,7 @@ func Test_new_simple_report_with_propertybag(t *testing.T) { run := given.a_new_report(). with_a_run_added("tfsec", "https://tfsec.dev") when.some_properties_are_added_to_the_run(run) - then.report_text_is(`{"version":"2.1.0","$schema":"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"results":[],"properties":{"integer_property":10,"string_property":"this is a string"}}]}`) + then.report_text_is(`{"version":"2.1.0","$schema":"https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"results":[],"properties":{"integer_property":10,"string_property":"this is a string"}}]}`) } func Test_new_simple_report_with_duplicate_artifact(t *testing.T) { @@ -50,7 +50,7 @@ func Test_new_simple_report_with_duplicate_artifact(t *testing.T) { when.an_artifact_is_added_to_the_run(run, "file://broken.go"). and(). an_artifact_is_added_to_the_run(run, "file://broken.go") - then.report_text_is(`{"version":"2.1.0","$schema":"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"artifacts":[{"location":{"uri":"file://broken.go"},"length":-1},{"location":{"uri":"file://broken.go"},"length":-1}],"results":[]}]}`) + then.report_text_is(`{"version":"2.1.0","$schema":"https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"artifacts":[{"location":{"uri":"file://broken.go"},"length":-1},{"location":{"uri":"file://broken.go"},"length":-1}],"results":[]}]}`) } func Test_load_sarif_from_string(t *testing.T) { @@ -58,7 +58,7 @@ func Test_load_sarif_from_string(t *testing.T) { content := `{ "version": "2.1.0", - "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", + "$schema": "https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json", "runs": [ { "tool": { @@ -80,7 +80,7 @@ func Test_load_sarif_report_from_file(t *testing.T) { content := `{ "version": "2.1.0", - "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", + "$schema": "https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json", "runs": [ { "tool": { diff --git a/v2/sarif/sarif.go b/v2/sarif/sarif.go index 5f6208e..6eeddb8 100644 --- a/v2/sarif/sarif.go +++ b/v2/sarif/sarif.go @@ -13,13 +13,15 @@ type Version string // Version210 represents Version210 of Sarif const ( - Version210 Version = "2.1.0" + Version210 Version = "2.1.0" + // @Deprecated - use Version210 instead Version210RTM5 Version = "2.1.0-rtm.5" ) var versions = map[Version]string{ - Version210: "https://json.schemastore.org/sarif-2.1.0.json", - Version210RTM5: "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", + Version210: "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", + // keeping this for backwards support but marked as deprecated + Version210RTM5: "https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json", } // Report is the encapsulating type representing a Sarif Report diff --git a/v2/test/report_test.go b/v2/test/report_test.go index 4dabead..9431ff9 100644 --- a/v2/test/report_test.go +++ b/v2/test/report_test.go @@ -13,7 +13,7 @@ func Test_new_simple_report_with_single_run(t *testing.T) { given.a_new_report(). with_a_run_added("tfsec", "https://tfsec.dev") - then.report_text_is(`{"version":"2.1.0","$schema":"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"results":[]}]}`) + then.report_text_is(`{"version":"2.1.0","$schema":"https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"results":[]}]}`) } func Test_new_report_with_empty_run(t *testing.T) { @@ -21,7 +21,7 @@ func Test_new_report_with_empty_run(t *testing.T) { given.a_new_report(). with_a_run_with_empty_result_added("tfsec", "https://tfsec.dev") - then.report_text_is(`{"version":"2.1.0","$schema":"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"results":[]}]}`) + then.report_text_is(`{"version":"2.1.0","$schema":"https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"results":[]}]}`) } func Test_new_simple_report_with_artifact(t *testing.T) { @@ -30,7 +30,7 @@ func Test_new_simple_report_with_artifact(t *testing.T) { run := given.a_new_report(). with_a_run_added("tfsec", "https://tfsec.dev") when.an_artifact_is_added_to_the_run(run, "file://broken.go") - then.report_text_is(`{"version":"2.1.0","$schema":"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"artifacts":[{"location":{"uri":"file://broken.go"},"length":-1}],"results":[]}]}`) + then.report_text_is(`{"version":"2.1.0","$schema":"https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"artifacts":[{"location":{"uri":"file://broken.go"},"length":-1}],"results":[]}]}`) } func Test_new_simple_report_with_propertybag(t *testing.T) { @@ -39,7 +39,7 @@ func Test_new_simple_report_with_propertybag(t *testing.T) { run := given.a_new_report(). with_a_run_added("tfsec", "https://tfsec.dev") when.some_properties_are_added_to_the_run(run) - then.report_text_is(`{"version":"2.1.0","$schema":"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"results":[],"properties":{"integer_property":10,"string_property":"this is a string"}}]}`) + then.report_text_is(`{"version":"2.1.0","$schema":"https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"results":[],"properties":{"integer_property":10,"string_property":"this is a string"}}]}`) } func Test_new_simple_report_with_duplicate_artifact(t *testing.T) { @@ -50,7 +50,7 @@ func Test_new_simple_report_with_duplicate_artifact(t *testing.T) { when.an_artifact_is_added_to_the_run(run, "file://broken.go"). and(). an_artifact_is_added_to_the_run(run, "file://broken.go") - then.report_text_is(`{"version":"2.1.0","$schema":"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"artifacts":[{"location":{"uri":"file://broken.go"},"length":-1},{"location":{"uri":"file://broken.go"},"length":-1}],"results":[]}]}`) + then.report_text_is(`{"version":"2.1.0","$schema":"https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json","runs":[{"tool":{"driver":{"name":"tfsec","informationUri":"https://tfsec.dev"}},"artifacts":[{"location":{"uri":"file://broken.go"},"length":-1},{"location":{"uri":"file://broken.go"},"length":-1}],"results":[]}]}`) } func Test_load_sarif_from_string(t *testing.T) { @@ -58,7 +58,7 @@ func Test_load_sarif_from_string(t *testing.T) { content := `{ "version": "2.1.0", - "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", + "$schema": "https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json", "runs": [ { "tool": { @@ -80,7 +80,7 @@ func Test_load_sarif_report_from_file(t *testing.T) { content := `{ "version": "2.1.0", - "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", + "$schema": "https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json", "runs": [ { "tool": {