Skip to content

Commit

Permalink
feat: add docs for feat 2
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Phillips <[email protected]>
  • Loading branch information
spiffcs committed Dec 8, 2023
1 parent edcd9e3 commit ca855d2
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 11 deletions.
38 changes: 37 additions & 1 deletion DEVELOPING.md
Original file line number Diff line number Diff line change
@@ -1 +1,37 @@
## Developing
## Developing

### Today
```
cmd/grant/
command/
check
list
grant/
license
package
policy
report/
...
```

### Future
```
cmd/grant/
command/
check
list
grant/
license
package
policy
report/
...
```
25 changes: 16 additions & 9 deletions grant/report/evaluation.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ import (
// <SOME NOUN> --> It's LIKE violations
type Result struct {
Request Request
Evaluations Evaluations
Evaluations LicenseEvaluations
Pass bool
}

type Results []Result

// Pass T/F + reasons for failure
// Validate() error ([]string reasons)
func (rs Results) Pass() bool {
//
panic("not implemented")
Expand All @@ -38,7 +40,12 @@ type EvaluationConfig struct {
// Reason string
//}

type Evaluation struct {
//type Evaluation interface {
// Validate() []error
// Reasons() []string
//}

type LicenseEvaluation struct {
RequestID string

// inputs into evaluation...
Expand All @@ -53,35 +60,35 @@ type Evaluation struct {
Pass bool // The final evaluation
}

type Evaluations []Evaluation
type LicenseEvaluations []LicenseEvaluation

func (ds Evaluations) Packages() []grant.Package {
func (ds LicenseEvaluations) Packages() []grant.Package {
// get the set of unique packages from the list...
panic("not implemented")

}

func (ds Evaluations) Licenses() []grant.License {
func (ds LicenseEvaluations) Licenses() []grant.License {
// get the set of unique license from the list...
panic("not implemented")

}

func (ds Evaluations) Policies() []grant.Policy {
func (ds LicenseEvaluations) Policies() []grant.Policy {
// get the set of unique policies from the list...
panic("not implemented")
}

func (ds Evaluations) IsFailed() bool {
func (ds LicenseEvaluations) IsFailed() bool {
panic("not implemented")
}

func NewDeterminationFromSBOM(ec EvaluationConfig, s sbom.SBOM) Result {
// return evalFromSBOM(ec, s)
return nil
return Result{}
}

func NewDeterminationFromLicense(ec EvaluationConfig, l grant.License) Result {
// return evalFromLicense(ec, l)
return nil
return Result{}
}
2 changes: 1 addition & 1 deletion grant/report/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
type Report struct {
ReportID string
//Requests []Request `json:"results" yaml:"results"`
Results []Result
Results Results
// Evaluation is a pass/fail for the entire report;
// It rolls up violations from all the requests
//Evaluation Evaluation `json:"evaluation" yaml:"evaluation"`
Expand Down

0 comments on commit ca855d2

Please sign in to comment.