Documentation ¶
Index ¶
- func ExtendContext(ctx context.Context) *extendedContext
- func NewAuthorizationService(p PolicyDataClientInterface, m messaging.MessagingService) (envoy_service_auth_v3.AuthorizationServer, error)
- type PolicyDataClientInterface
- type PolicyDataServiceResponse
- type PolicyEngine
- type PolicyEvalTargetArtefact
- type PolicyEvalTargetLicense
- type PolicyEvalTargetUpstream
- type PolicyEvalTargetVulnerability
- type PolicyInput
- type PolicyInputPrincipal
- type PolicyInputTarget
- type PolicyInputVersion
- type PolicyResponse
- type PolicyViolation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtendContext ¶
func NewAuthorizationService ¶
func NewAuthorizationService(p PolicyDataClientInterface, m messaging.MessagingService) (envoy_service_auth_v3.AuthorizationServer, error)
Types ¶
type PolicyDataClientInterface ¶
type PolicyDataClientInterface interface {
GetPackageMetaByVersion(ctx context.Context, ecosystem, group, name, version string) (PolicyDataServiceResponse, error)
}
func NewLocalPolicyDataClient ¶
func NewLocalPolicyDataClient(cc grpc.ClientConnInterface) PolicyDataClientInterface
func NewPolicyDataServiceClient ¶
func NewPolicyDataServiceClient(cfg *config_api.PdsClientConfig) (PolicyDataClientInterface, error)
func NewRayaPolicyDataServiceClient ¶
func NewRayaPolicyDataServiceClient(conn grpc.ClientConnInterface) PolicyDataClientInterface
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"` }
func NewPolicyInput ¶
func NewPolicyInput(target common_models.Artefact, upstream common_models.ArtefactUpStream, requester auth.AuthenticatedIdentity, enrichments PolicyDataServiceResponse) PolicyInput
type PolicyInputPrincipal ¶
type PolicyInputTarget ¶
type PolicyInputTarget struct { Artefact PolicyEvalTargetArtefact `json:"artefact"` Upstream PolicyEvalTargetUpstream `json:"upstream"` Vulnerabilities []PolicyEvalTargetVulnerability `json:"vulnerabilities"` Licenses []PolicyEvalTargetLicense `json:"licenses"` }
type PolicyInputVersion ¶
type PolicyResponse ¶
type PolicyResponse struct { Allow bool `json:"allow"` Violations []PolicyViolation `json:"violations"` }
func (PolicyResponse) Allowed ¶
func (s PolicyResponse) Allowed() bool
type PolicyViolation ¶
Click to show internal directories.
Click to hide internal directories.