pdp

package
v0.0.0-...-d9b5379 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2022 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtendContext

func ExtendContext(ctx context.Context) *extendedContext

Types

type PolicyDataClientInterface

type PolicyDataClientInterface interface {
	GetPackageMetaByVersion(ctx context.Context, ecosystem, group, name, version string) (PolicyDataServiceResponse, error)
}

type PolicyDataServiceResponse

type PolicyDataServiceResponse struct {
	Vulnerabilities []common_models.ArtefactVulnerability `json:"vulnerabilities"`
	Licenses        []common_models.ArtefactLicense       `json:"licenses"`
	Scorecard       openssf.ProjectScorecard
}

type PolicyEngine

type PolicyEngine struct {
	// contains filtered or unexported fields
}

func NewPolicyEngine

func NewPolicyEngine(path string, changeMonitor bool) (*PolicyEngine, error)

func (*PolicyEngine) Evaluate

func (svc *PolicyEngine) Evaluate(ctx context.Context, input PolicyInput) (PolicyResponse, error)

func (*PolicyEngine) Load

func (svc *PolicyEngine) Load(changeMonitor bool) error

type PolicyEvalTargetArtefact

type PolicyEvalTargetArtefact struct {
	common_models.Artefact
}

type PolicyEvalTargetLicense

type PolicyEvalTargetLicense struct {
	common_models.ArtefactLicense
}

type PolicyEvalTargetUpstream

type PolicyEvalTargetUpstream struct {
	common_models.ArtefactUpStream
}

type PolicyEvalTargetVulnerability

type PolicyEvalTargetVulnerability struct {
	common_models.ArtefactVulnerability
}

type PolicyInput

type PolicyInput struct {
	Kind      string               `json:"kind"`
	Version   PolicyInputVersion   `json:"version"`
	Target    PolicyInputTarget    `json:"target"`
	Principal PolicyInputPrincipal `json:"principal"`
}

type PolicyInputPrincipal

type PolicyInputPrincipal struct {
	UserId    string `json:"userId"`
	OrgId     string `json:"orgId"`
	ProjectId string `json:"projectId"`
}

type PolicyInputTarget

type PolicyInputTarget struct {
	Artefact        PolicyEvalTargetArtefact        `json:"artefact"`
	Upstream        PolicyEvalTargetUpstream        `json:"upstream"`
	Vulnerabilities []PolicyEvalTargetVulnerability `json:"vulnerabilities"`
	Licenses        []PolicyEvalTargetLicense       `json:"licenses"`
}

type PolicyInputVersion

type PolicyInputVersion struct {
	Major int8 `json:"major"`
	Minor int8 `json:"minor"`
	Patch int8 `json:"patch"`
}

type PolicyResponse

type PolicyResponse struct {
	Allow      bool              `json:"allow"`
	Violations []PolicyViolation `json:"violations"`
}

func (PolicyResponse) Allowed

func (s PolicyResponse) Allowed() bool

type PolicyViolation

type PolicyViolation struct {
	Code    int64  `json:"code"`
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL