policy

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package policy resolves stored permissions and enforces column access.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasBroadTableGrant

func HasBroadTableGrant(patterns []string, table model.ObjectRef) bool

HasBroadTableGrant reports whether a global or schema wildcard grants all columns on table. An exact table grant is intentionally not broad.

func MatchesAnyTable

func MatchesAnyTable(patterns []string, table model.ObjectRef) bool

MatchesAnyTable applies the exact wildcard semantics consumed by R010: *, schema.*, or an exact unqualified/qualified table name.

func ValidateTablePatterns

func ValidateTablePatterns(patterns []string) error

ValidateTablePatterns validates the exact, global, and schema wildcard patterns shared by the policy resolver and R010.

Types

type Resolver

type Resolver struct{}

Resolver merges already-loaded policy rows without accessing storage.

func NewResolver

func NewResolver() *Resolver

NewResolver returns a stateless policy resolver.

func (*Resolver) Resolve

func (resolver *Resolver) Resolve(
	policies []model.Policy,
	level string,
) (*model.PolicyDecision, error)

Resolve merges policy rows for one Agent and datasource. The caller supplies the authenticated Agent level; the resolver never infers it.

type SchemaColumn

type SchemaColumn struct {
	Schema string
	Table  string
	Column string
}

SchemaColumn identifies one column returned by a schema-listing source.

func FilterColumnsForSchema

func FilterColumnsForSchema(
	columns []SchemaColumn,
	decision *model.PolicyDecision,
) ([]SchemaColumn, error)

FilterColumnsForSchema removes unauthorized schema columns while preserving input order. It never synthesizes columns. A table without a ColumnACL entry receives no extra column restriction once its table authorization succeeds.

Jump to

Keyboard shortcuts

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