Documentation
¶
Overview ¶
Package gh_branch_protect provides the github branch protection remediation engine
Index ¶
- Constants
- type GhBranchProtectRemediator
- func (r *GhBranchProtectRemediator) Class() interfaces.ActionType
- func (r *GhBranchProtectRemediator) Do(ctx context.Context, cmd interfaces.ActionCmd, remAction models.ActionOpt, ...) (json.RawMessage, error)
- func (_ *GhBranchProtectRemediator) GetOnOffState(actionOpt models.ActionOpt) models.ActionOpt
- func (_ *GhBranchProtectRemediator) Type() string
- type PatchTemplateParams
Constants ¶
View Source
const ( // RemediateType is the type of the REST remediation engine RemediateType = "gh_branch_protection" // PatchTemplateLimit is the maximum number of bytes for the patch template // Since patches may be medium sized JSON objects, we set a limit to avoid // excessive memory usage. PatchTemplateLimit = 2048 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GhBranchProtectRemediator ¶
type GhBranchProtectRemediator struct {
// contains filtered or unexported fields
}
GhBranchProtectRemediator keeps the status for a rule type that uses GH API to remediate branch protection
func NewGhBranchProtectRemediator ¶
func NewGhBranchProtectRemediator( actionType interfaces.ActionType, ghp *pb.RuleType_Definition_Remediate_GhBranchProtectionType, cli provifv1.GitHub, ) (*GhBranchProtectRemediator, error)
NewGhBranchProtectRemediator creates a new remediation engine that uses the GitHub API for branch protection
func (*GhBranchProtectRemediator) Class ¶
func (r *GhBranchProtectRemediator) Class() interfaces.ActionType
Class returns the action type of the remediation engine
func (*GhBranchProtectRemediator) Do ¶
func (r *GhBranchProtectRemediator) Do( ctx context.Context, cmd interfaces.ActionCmd, remAction models.ActionOpt, ent protoreflect.ProtoMessage, params interfaces.ActionsParams, _ *json.RawMessage, ) (json.RawMessage, error)
Do perform the remediation
func (*GhBranchProtectRemediator) GetOnOffState ¶
func (_ *GhBranchProtectRemediator) GetOnOffState(actionOpt models.ActionOpt) models.ActionOpt
GetOnOffState returns the alert action state read from the profile
func (*GhBranchProtectRemediator) Type ¶
func (_ *GhBranchProtectRemediator) Type() string
Type returns the action subtype of the remediation engine
type PatchTemplateParams ¶
type PatchTemplateParams struct { // Entity is the entity to be evaluated Entity any // Profile are the parameters to be used in the template Profile map[string]any // Profile are the parameters to be used in the template Params map[string]any }
PatchTemplateParams is the parameters for the REST endpoint template
Click to show internal directories.
Click to hide internal directories.