Skip to content

Commit 92cfdb6

Browse files
authored
chore: use ossf/gemara@v0.3.10 in place of sci (#91)
This PR updates our dependency to reflect the move of sci to the ossf and the rename to gemara Signed-off-by: Travis Truman <trumant@gmail.com>
1 parent 06eee3d commit 92cfdb6

File tree

7 files changed

+23
-25
lines changed

7 files changed

+23
-25
lines changed

go.mod

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ go 1.23.4
55
toolchain go1.24.1
66

77
require (
8-
github.com/goccy/go-yaml v1.17.1
8+
github.com/goccy/go-yaml v1.18.0
99
github.com/hashicorp/go-hclog v1.6.3
1010
github.com/hashicorp/go-plugin v1.6.3
11-
github.com/revanite-io/sci v0.3.2
11+
github.com/ossf/gemara v0.3.10
1212
github.com/spf13/cobra v1.9.1
1313
github.com/spf13/viper v1.20.1
1414
)
@@ -41,5 +41,3 @@ require (
4141
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
4242
gopkg.in/yaml.v3 v3.0.1 // indirect
4343
)
44-
45-
// replace github.com/revanite-io/sci => ../../revanite-io/sci

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/
1313
github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
1414
github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss=
1515
github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
16-
github.com/goccy/go-yaml v1.17.1 h1:LI34wktB2xEE3ONG/2Ar54+/HJVBriAGJ55PHls4YuY=
17-
github.com/goccy/go-yaml v1.17.1/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
16+
github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=
17+
github.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
1818
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
1919
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
2020
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
@@ -49,12 +49,12 @@ github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPn
4949
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
5050
github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw=
5151
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
52+
github.com/ossf/gemara v0.3.10 h1:kweiPnzXEdKyrpl/XFcTn1BlVBHeKosW9TU/UFV6hJ4=
53+
github.com/ossf/gemara v0.3.10/go.mod h1:2EJVc3K4m0lLi0gGH0ptU43TCBv/EyeFYvDe9pG3Ryc=
5254
github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M=
5355
github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc=
5456
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
5557
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
56-
github.com/revanite-io/sci v0.3.2 h1:Rg0gUQZ4TF+hBXtqj3LF/zZH91jPJkUJooqQh3mqLm0=
57-
github.com/revanite-io/sci v0.3.2/go.mod h1:oF86d/9fyPH1ogfnYg9SvnpSYBzH1SVKhoxDGYOq5uk=
5858
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
5959
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
6060
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=

pluginkit/evaluation_orchestrator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"strings"
99

1010
"github.com/goccy/go-yaml"
11+
"github.com/ossf/gemara/layer4"
1112
"github.com/privateerproj/privateer-sdk/config"
12-
"github.com/revanite-io/sci/pkg/layer4"
1313
)
1414

1515
// The evaluation orchestrator gets the plugin in position to execute the specified evaluation suites

pluginkit/evaluation_orchestrator_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"strings"
66
"testing"
77

8+
"github.com/ossf/gemara/layer4"
89
"github.com/privateerproj/privateer-sdk/config"
9-
"github.com/revanite-io/sci/pkg/layer4"
1010
)
1111

1212
func TestSetPayload(t *testing.T) {

pluginkit/evaluation_suite.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"time"
1010

1111
"github.com/goccy/go-yaml"
12+
"github.com/ossf/gemara/layer4"
1213
"github.com/privateerproj/privateer-sdk/config"
13-
"github.com/revanite-io/sci/pkg/layer4"
1414
)
1515

1616
type TestSet func() (result layer4.ControlEvaluation)
@@ -48,15 +48,15 @@ func (e *EvaluationSuite) Evaluate(name string) error {
4848
evaluation.Evaluate(e.payload, e.config.Policy.Applicability, e.config.Invasive)
4949
evaluation.Cleanup()
5050
if !e.Corrupted_State {
51-
e.Corrupted_State = evaluation.Corrupted_State
51+
e.Corrupted_State = evaluation.CorruptedState
5252
}
5353

5454
// Make sure the evaluation result is updated based on the complete assessment results
5555
e.Result = layer4.UpdateAggregateResult(e.Result, evaluation.Result)
5656

5757
// Log each assessment result as a separate line
5858
for _, assessment := range evaluation.Assessments {
59-
message := fmt.Sprintf("%s: %s", assessment.Requirement_Id, assessment.Message)
59+
message := fmt.Sprintf("%s: %s", assessment.RequirementId, assessment.Message)
6060
// switch case the code below
6161
switch assessment.Result {
6262
case layer4.Passed:
@@ -173,8 +173,8 @@ func (e *EvaluationSuite) writeControlEvaluationsToFile(serviceName string, resu
173173
func (e *EvaluationSuite) cleanup() (passed bool) {
174174
for _, result := range e.Control_Evaluations {
175175
result.Cleanup()
176-
if result.Corrupted_State {
177-
e.Corrupted_State = result.Corrupted_State
176+
if result.CorruptedState {
177+
e.Corrupted_State = result.CorruptedState
178178
}
179179
}
180180
return !e.Corrupted_State

pluginkit/evaluation_suite_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package pluginkit
33
import (
44
"testing"
55

6-
"github.com/revanite-io/sci/pkg/layer4"
6+
"github.com/ossf/gemara/layer4"
77
)
88

99
func TestCleanup(t *testing.T) {
@@ -31,10 +31,10 @@ func TestCleanup(t *testing.T) {
3131
}
3232
data.config = setBasicConfig()
3333
for _, eval := range data.Control_Evaluations {
34-
expectedCorrupted := eval.Corrupted_State
34+
expectedCorrupted := eval.CorruptedState
3535
eval.Cleanup()
36-
if eval.Corrupted_State != expectedCorrupted {
37-
t.Errorf("Expected control evaluation corruption to be %v, but got %v", expectedCorrupted, eval.Corrupted_State)
36+
if eval.CorruptedState != expectedCorrupted {
37+
t.Errorf("Expected control evaluation corruption to be %v, but got %v", expectedCorrupted, eval.CorruptedState)
3838
}
3939
result := data.cleanup()
4040
if result == expectedCorrupted {
@@ -76,7 +76,7 @@ func TestEvaluate(t *testing.T) {
7676
t.Errorf("Expected %s, but got %s", test.expectedEvalSuiteError, err)
7777
}
7878
for _, eval := range suite.Control_Evaluations {
79-
if (eval.Result == layer4.Passed) && eval.Corrupted_State {
79+
if (eval.Result == layer4.Passed) && eval.CorruptedState {
8080
t.Errorf("Control evaluation was marked 'Passed' and Corrupted_State=true")
8181
}
8282
// TODO: test more of the evaluation suite behavior

pluginkit/test_data.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package pluginkit
33
import (
44
"fmt"
55

6-
"github.com/revanite-io/sci/pkg/layer4"
6+
"github.com/ossf/gemara/layer4"
77
"github.com/spf13/viper"
88

99
"github.com/privateerproj/privateer-sdk/config"
@@ -25,7 +25,7 @@ func examplePayload(_ *config.Config) (interface{}, error) {
2525

2626
func passingEvaluation() (evaluation *layer4.ControlEvaluation) {
2727
evaluation = &layer4.ControlEvaluation{
28-
Control_Id: "good-evaluation",
28+
ControlID: "good-evaluation",
2929
}
3030

3131
assessment := evaluation.AddAssessment(
@@ -53,7 +53,7 @@ func passingEvaluation() (evaluation *layer4.ControlEvaluation) {
5353

5454
func failingEvaluation() (evaluation *layer4.ControlEvaluation) {
5555
evaluation = &layer4.ControlEvaluation{
56-
Control_Id: "bad-evaluation",
56+
ControlID: "bad-evaluation",
5757
}
5858

5959
evaluation.AddAssessment(
@@ -70,7 +70,7 @@ func failingEvaluation() (evaluation *layer4.ControlEvaluation) {
7070

7171
func needsReviewEvaluation() (evaluation *layer4.ControlEvaluation) {
7272
evaluation = &layer4.ControlEvaluation{
73-
Control_Id: "needs-review-evaluation",
73+
ControlID: "needs-review-evaluation",
7474
}
7575

7676
evaluation.AddAssessment(
@@ -86,7 +86,7 @@ func needsReviewEvaluation() (evaluation *layer4.ControlEvaluation) {
8686

8787
func corruptedEvaluation() (evaluation *layer4.ControlEvaluation) {
8888
evaluation = &layer4.ControlEvaluation{
89-
Control_Id: "corrupted-evaluation",
89+
ControlID: "corrupted-evaluation",
9090
}
9191

9292
assessment := evaluation.AddAssessment(

0 commit comments

Comments
 (0)