gh_branch_protect

package
v0.0.66 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package gh_branch_protect provides the github branch protection remediation engine

Index

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

NewGhBranchProtectRemediator creates a new remediation engine that uses the GitHub API for branch protection

func (*GhBranchProtectRemediator) Class

Class returns the action type of the remediation engine

func (*GhBranchProtectRemediator) Do

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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL