Documentation
¶
Index ¶
- func ForbiddenPath(pattern, file string) bool
- func Validate(p Policy) error
- type Action
- type Binding
- type Defaults
- type Evidence
- type Input
- type Layer
- type Limits
- type Lists
- type Policy
- type Requirement
- type Resolved
- type Result
- type Scope
- type Service
- func (s *Service) Activate(ctx context.Context, session auth.Session, ...) (int64, error)
- func (s *Service) CreateVersion(ctx context.Context, session auth.Session, orgID string, scope Scope, p Policy, ...) (Version, error)
- func (s *Service) EvaluateTx(ctx context.Context, tx pgx.Tx, orgID, repoID string, in Input) (Result, error)
- func (s *Service) GetVersion(ctx context.Context, session auth.Session, orgID, id string) (Version, error)
- func (s *Service) ListVersions(ctx context.Context, session auth.Session, orgID string, scope Scope, ...) (domain.Page[Version], error)
- func (s *Service) Resolve(ctx context.Context, session auth.Session, orgID, repoID string) (Resolved, error)
- func (s *Service) ResolveTx(ctx context.Context, tx pgx.Tx, orgID, repoID string) (Resolved, error)
- func (s *Service) Simulate(ctx context.Context, session auth.Session, ...) (Simulation, error)
- type Simulation
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForbiddenPath ¶
Types ¶
type Binding ¶
type Binding struct {
Head string `json:"head"`
Target string `json:"target"`
Tested string `json:"tested"`
PolicyHash string `json:"policy_hash"`
ProviderRules string `json:"provider_rules"`
CapabilityVersion string `json:"capability_version"`
SourceSHA string `json:"source_sha"`
Artifact string `json:"artifact"`
}
type Input ¶
type Input struct {
Stage string `json:"stage,omitempty"`
Action Action `json:"action"`
Recipe string `json:"recipe"`
Model string `json:"model"`
Route string `json:"route"`
MergeMethod string `json:"merge_method"`
Environment string `json:"environment"`
Workflow string `json:"workflow"`
Paths []string `json:"paths"`
Usage Limits `json:"usage"`
Current Binding `json:"current"`
StartingPolicyHash string `json:"starting_policy_hash"`
Evidence []Evidence `json:"evidence"`
PausedScopes []string `json:"paused_scopes"`
Now time.Time `json:"now"`
}
type Limits ¶
type Limits struct {
Budget *int64 `json:"budget,omitempty"`
Concurrency *int64 `json:"concurrency,omitempty"`
Attempts *int64 `json:"attempts,omitempty"`
ChangedFiles *int64 `json:"changed_files,omitempty"`
ChangedLines *int64 `json:"changed_lines,omitempty"`
OpenChanges *int64 `json:"open_changes,omitempty"`
}
type Policy ¶
type Policy struct {
Schema string `json:"schema"`
Allow Lists `json:"allow"`
Deny []Action `json:"deny"`
ForbiddenPaths []string `json:"forbidden_paths"`
ReviewProofs []string `json:"review_proofs,omitempty"`
Limits Limits `json:"limits"`
Required []Requirement `json:"required"`
Defaults Defaults `json:"defaults"`
MaxEvidenceAgeSeconds *int64 `json:"max_evidence_age_seconds,omitempty"`
Paused bool `json:"paused"`
}
type Requirement ¶
type Resolved ¶
type Resolved struct {
Hash string `json:"hash"`
Layers []Layer `json:"layers"`
PrimaryTeamID string `json:"primary_team_id,omitempty"`
RepositoryID string `json:"repository_id"`
Paused bool `json:"paused"`
Policy Policy `json:"policy"`
ScopePaused bool `json:"scope_paused"`
MissingDefaults []string `json:"missing_defaults"`
Problems []string `json:"problems"`
}
type Result ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) CreateVersion ¶
func (*Service) EvaluateTx ¶
func (*Service) GetVersion ¶
func (*Service) ListVersions ¶
type Simulation ¶
Click to show internal directories.
Click to hide internal directories.