rules

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompiledRuleTuple added in v1.0.0

type CompiledRuleTuple struct {
	UserResourceType   string
	Permission         string
	ObjectResourceType string
	ObjectResourceId   string
}

type CompiledRuleWithTuples added in v1.0.0

type CompiledRuleWithTuples struct {
	Method       string
	SegmentCount int
	StaticPrefix string
	PathRegex    string
	Priority     int
	Tuples       []CompiledRuleTuple
}

type RegexMatches

type RegexMatches map[string]string

RegexMatches maps named capture group identifiers to their captured values.

type RuleTuple

type RuleTuple struct {
	Id                 string `json:"id"`
	RuleId             string `json:"rule_id"`
	UserResourceType   string `json:"user_resource_type"`
	Permission         string `json:"permission"`
	ObjectResourceType string `json:"object_resource_type"`
	ObjectResourceId   string `json:"object_resource_id"`
}

type RuleWithTuples

type RuleWithTuples struct {
	Id           string       `json:"id"`
	ServiceId    string       `json:"service_id"`
	ServiceSlug  string       `json:"service_slug"`
	Method       string       `json:"method"`
	SegmentCount int          `json:"segment_count"`
	StaticPrefix string       `json:"static_prefix"`
	PathRegex    string       `json:"path_regex"`
	Priority     int          `json:"priority"`
	Tenant       *string      `json:"tenant"`
	Revision     string       `json:"revision"`
	RuleTuples   []*RuleTuple `json:"rule_tuples"`
}

type SeedFile added in v1.0.0

type SeedFile struct {
	Version     string     `yaml:"version"`
	Service     string     `yaml:"service"`
	Revision    string     `yaml:"revision"`
	Description string     `yaml:"description"`
	Rules       []SeedRule `yaml:"rules"`
	FilePath    string     `yaml:"-"`
}

type SeedRule added in v1.0.0

type SeedRule struct {
	Method   string      `yaml:"method"`
	Match    string      `yaml:"match"`
	Priority int         `yaml:"priority"`
	Tuples   []SeedTuple `yaml:"tuples"`
}

type SeedTuple added in v1.0.0

type SeedTuple struct {
	UserResourceType   string `yaml:"userResourceType"`
	Permission         string `yaml:"permission"`
	ObjectResourceType string `yaml:"objectResourceType"`
	ObjectResourceId   string `yaml:"objectResourceId"`
}

func (*SeedTuple) UnmarshalYAML added in v1.0.0

func (t *SeedTuple) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML implements custom unmarshaling to support both camelCase and snake_case keys in YAML files.

type Tuple

type Tuple struct {
	User         string
	Relation     string
	Object       string
	RuleTupleRef string
}

Jump to

Keyboard shortcuts

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