outside

package
Version: v0.0.0-...-005854d Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package Outside implements the Outside Collaborators security policy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOutside

func NewOutside() policydef.Policy

NewOutside returns a new Outside Collaborators policy.

Types

type OrgConfig

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

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

	// PushAllowed defined if outside collaboraters are allowed to have push
	// access, default true.
	PushAllowed bool `yaml:"pushAllowed"`

	// AdminAllowed defined if outside collaboraters are allowed to have admin
	// access, default false.
	AdminAllowed bool `yaml:"adminAllowed"`
}

OrgConfig is the org-level config definition for Outside Collaborators security policy.

type Outside

type Outside bool

Outside is the Outside Collaborators policy object, implements policydef.Policy.

func (Outside) Check

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

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

func (Outside) Fix

func (o Outside) 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 (Outside) GetAction

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

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

func (Outside) Name

func (o Outside) Name() string

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

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"`

	// PushAllowed overrides the same setting in org-level, only if present.
	PushAllowed *bool `yaml:"pushAllowed"`

	// AdminAllowed overrides the same setting in org-level, only if present.
	AdminAllowed *bool `yaml:"adminAllowed"`
}

RepoConfig is the repo-level config for Outside Collaborators security policy.

Source Files

Jump to

Keyboard shortcuts

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