policy

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPolicyDenied = errors.New("policy denied")

Functions

This section is empty.

Types

type Policy

type Policy struct {
	AllowedDomains  []string `json:"allowed_domains,omitempty"`
	BlockedDomains  []string `json:"blocked_domains,omitempty"`
	MaxNavigations  int      `json:"max_navigations,omitempty"`
	AllowFileUpload bool     `json:"allow_file_upload"`
	AllowClipboard  bool     `json:"allow_clipboard"`
	AllowEval       bool     `json:"allow_eval"`
	// contains filtered or unexported fields
}

func FromDomains

func FromDomains(domains []string) *Policy

func Load

func Load(path string) (*Policy, error)

func (*Policy) AllowAction

func (p *Policy) AllowAction(action string) error

func (*Policy) AllowURL

func (p *Policy) AllowURL(rawURL string) error

Jump to

Keyboard shortcuts

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