fluxpolicy

package
v0.2.21 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeAsk  = "ask"
	ModeAuto = "auto"
	ModeDeny = "deny"
)

Variables

This section is empty.

Functions

func WithPolicy

func WithPolicy(ctx context.Context, p *Policy) context.Context

Types

type AskFunc

type AskFunc func(ctx context.Context, action string, args map[string]interface{}, p *Policy) bool

type Config

type Config struct {
	Mode      string   `json:"mode,omitempty" yaml:"mode,omitempty"`
	AllowList []string `json:"allow,omitempty" yaml:"allow,omitempty"`
	BlockList []string `json:"block,omitempty" yaml:"block,omitempty"`
}

func ToConfig

func ToConfig(p *Policy) *Config

type Policy

type Policy struct {
	Mode      string
	AllowList []string
	BlockList []string
	Ask       AskFunc
}

func FromConfig

func FromConfig(c *Config) *Policy

func FromContext

func FromContext(ctx context.Context) *Policy

func (*Policy) IsAllowed

func (p *Policy) IsAllowed(action string) bool

Jump to

Keyboard shortcuts

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