Version: v0.0.0-...-84b402d Latest Latest

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

Go to latest
Published: Nov 22, 2021 License: Apache-2.0 Imports: 7 Imported by: 0



Package security implements the security policy.



This section is empty.


This section is empty.


func NewSecurity

func NewSecurity() policydef.Policy

NewSecurity returns a new policy.


type OrgConfig

type OrgConfig struct {
	// OptConfig is the standard org-level opt in/out config, RepoOverride applies to all
	// BP config.
	OptConfig config.OrgOptConfig `yaml:"optConfig"`

	// Action defines which action to take, default log, other: issue...
	Action string `yaml:"action"`

OrgConfig is the org-level config definition for Branch Protection.

type RepoConfig

type RepoConfig struct {
	// OptConfig is the standard repo-level opt in/out config.
	OptConfig config.RepoOptConfig `yaml:"optConfig"`

	// Action overrides the same setting in org-level, only if present.
	Action *string `yaml:"action"`

RepoConfig is the repo-level config for Branch Protection

type Security

type Security bool

Security is the policy object, implements policydef.Policy.

func (Security) Check

func (s Security) Check(ctx context.Context, c *github.Client, owner,
	repo string) (*policydef.Result, error)

Check performs the polcy check for policy based on the configuration stored in the org/repo, implementing policydef.Policy.Check()

func (Security) Fix

func (s Security) Fix(ctx context.Context, c *github.Client, owner, repo string) error

Fix implementing policydef.Policy.Fix(). Currently not supported. Plan to support this TODO.

func (Security) GetAction

func (s Security) GetAction(ctx context.Context, c *github.Client, owner, repo string) string

GetAction returns the configured action from policy's configuration stored in the org-level repo, default log. Implementing policydef.Policy.GetAction()

func (Security) Name

func (s Security) Name() string

Name returns the name of this policy, implementing policydef.Policy.Name()

Source Files

Jump to

Keyboard shortcuts

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