policy

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultDeniedSchemas = []string{"pg_catalog", "information_schema"}

Functions

This section is empty.

Types

type Mode

type Mode string
const (
	ModeReadOnly Mode = "readonly"
	ModeOperator Mode = "operator"
	ModeAdmin    Mode = "admin"
)

func ParseMode

func ParseMode(value string) (Mode, error)

type Policy

type Policy struct {
	// contains filtered or unexported fields
}

func New

func New(mode Mode, deniedSchemas []string, mutationDatabases []string) Policy

func (Policy) AuthorizeAdmin

func (p Policy) AuthorizeAdmin(database string, statement sqlguard.Statement) error

func (Policy) AuthorizeDML

func (p Policy) AuthorizeDML(database string, statement sqlguard.Statement) error

func (Policy) AuthorizeExec

func (p Policy) AuthorizeExec(database string, statement sqlguard.Statement) error

func (Policy) AuthorizeQuery

func (p Policy) AuthorizeQuery(statement sqlguard.Statement) error

func (Policy) DeniedSchemas

func (p Policy) DeniedSchemas() []string

func (Policy) Mode

func (p Policy) Mode() Mode

func (Policy) MutationDatabases

func (p Policy) MutationDatabases() []string

Jump to

Keyboard shortcuts

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