Documentation ¶
Index ¶
- Constants
- func RecordTeamAndPipeline(ctx context.Context, teamName, pipelineName string) context.Context
- func RegisterAgent(factory AgentFactory)
- func TeamAndPipelineFromContext(ctx context.Context) (string, string)
- func WireCheckers(group *flags.Group)
- type Agent
- type AgentFactory
- type Checker
- type Filter
- type PolicyCheckInput
- type PolicyCheckNotPass
Constants ¶
View Source
const ActionUseImage = "UseImage"
Variables ¶
This section is empty.
Functions ¶
func RecordTeamAndPipeline ¶
func RegisterAgent ¶
func RegisterAgent(factory AgentFactory)
func WireCheckers ¶
func WireCheckers(group *flags.Group)
Types ¶
type Agent ¶
type Agent interface { // Check returns true if passes policy check. If not goes through policy // check, just return true. Check(PolicyCheckInput) (bool, error) }
Agent should be implemented by policy agents.
type AgentFactory ¶
type Checker ¶
type Checker struct {
// contains filtered or unexported fields
}
func Initialize ¶
func (*Checker) ShouldCheckAction ¶
func (*Checker) ShouldCheckHttpMethod ¶
func (*Checker) ShouldSkipAction ¶
type Filter ¶
type Filter struct { HttpMethods []string `long:"policy-check-filter-http-method" description:"API http method to go through policy check"` Actions []string `long:"policy-check-filter-action" description:"Actions in the list will go through policy check"` ActionsToSkip []string `long:"policy-check-filter-action-skip" description:"Actions the list will not go through policy check"` }
type PolicyCheckInput ¶
type PolicyCheckInput struct { Service string `json:"service"` ClusterName string `json:"cluster_name"` ClusterVersion string `json:"cluster_version"` HttpMethod string `json:"http_method,omitempty"` Action string `json:"action"` User string `json:"user,omitempty"` Team string `json:"team,omitempty"` Pipeline string `json:"pipeline,omitempty"` Data interface{} `json:"data,omitempty"` }
type PolicyCheckNotPass ¶
type PolicyCheckNotPass struct{}
func (PolicyCheckNotPass) Error ¶
func (e PolicyCheckNotPass) Error() string
Click to show internal directories.
Click to hide internal directories.