Documentation ¶
Index ¶
- Constants
- type DiggerHttpPolicyProvider
- func (p *DiggerHttpPolicyProvider) GetAccessPolicy(organisation string, repo string, projectName string) (string, error)
- func (p *DiggerHttpPolicyProvider) GetDriftPolicy() (string, error)
- func (p *DiggerHttpPolicyProvider) GetOrganisation() string
- func (p *DiggerHttpPolicyProvider) GetPlanPolicy(organisation string, repo string, projectName string) (string, error)
- type DiggerPolicyChecker
- func (p DiggerPolicyChecker) CheckAccessPolicy(ciService orchestrator.OrgService, prService *orchestrator.PullRequestService, ...) (bool, error)
- func (p DiggerPolicyChecker) CheckDriftPolicy(SCMOrganisation string, SCMrepository string, projectName string) (bool, error)
- func (p DiggerPolicyChecker) CheckPlanPolicy(SCMrepository string, SCMOrganisation string, projectName string, ...) (bool, []string, error)
- type NoOpPolicyChecker
- func (p NoOpPolicyChecker) CheckAccessPolicy(_ orchestrator.OrgService, _ *orchestrator.PullRequestService, _ string, ...) (bool, error)
- func (p NoOpPolicyChecker) CheckDriftPolicy(SCMOrganisation string, SCMrepository string, projectname string) (bool, error)
- func (p NoOpPolicyChecker) CheckPlanPolicy(_ string, _ string, _ string, _ string) (bool, []string, error)
Constants ¶
View Source
const DefaultAccessPolicy = `
package digger
default allow = true
allow = (count(input.planPolicyViolations) == 0)
`
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiggerHttpPolicyProvider ¶
type DiggerHttpPolicyProvider struct { DiggerHost string DiggerOrganisation string AuthToken string HttpClient *http.Client }
func (*DiggerHttpPolicyProvider) GetAccessPolicy ¶
func (p *DiggerHttpPolicyProvider) GetAccessPolicy(organisation string, repo string, projectName string) (string, error)
GetPolicy fetches policy for particular project, if not found then it will fallback to org level policy
func (*DiggerHttpPolicyProvider) GetDriftPolicy ¶
func (p *DiggerHttpPolicyProvider) GetDriftPolicy() (string, error)
func (*DiggerHttpPolicyProvider) GetOrganisation ¶
func (p *DiggerHttpPolicyProvider) GetOrganisation() string
func (*DiggerHttpPolicyProvider) GetPlanPolicy ¶
type DiggerPolicyChecker ¶
func (DiggerPolicyChecker) CheckAccessPolicy ¶
func (p DiggerPolicyChecker) CheckAccessPolicy(ciService orchestrator.OrgService, prService *orchestrator.PullRequestService, SCMOrganisation string, SCMrepository string, projectName string, command string, prNumber *int, requestedBy string, planPolicyViolations []string) (bool, error)
TODO refactor to use AccessPolicyContext - too many arguments
func (DiggerPolicyChecker) CheckDriftPolicy ¶
func (DiggerPolicyChecker) CheckPlanPolicy ¶
type NoOpPolicyChecker ¶
type NoOpPolicyChecker struct { }
func (NoOpPolicyChecker) CheckAccessPolicy ¶
func (p NoOpPolicyChecker) CheckAccessPolicy(_ orchestrator.OrgService, _ *orchestrator.PullRequestService, _ string, _ string, _ string, _ string, _ *int, _ string, _ []string) (bool, error)
func (NoOpPolicyChecker) CheckDriftPolicy ¶
func (NoOpPolicyChecker) CheckPlanPolicy ¶
Click to show internal directories.
Click to hide internal directories.