authorityattribution

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package authorityattribution holds shared attribution dimensions, matchers, and readiness aggregation used by usage authority, concurrency authority, and authority coordination.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AggregateReadiness

func AggregateReadiness(values ...authority.Readiness) authority.Readiness

AggregateReadiness picks the most severe readiness among inputs.

func IsSafeLabelKey

func IsSafeLabelKey(key string) bool

IsSafeLabelKey reports whether key is safe as a policy-label dimension key.

func ReadinessRank

func ReadinessRank(r authority.Readiness) int

ReadinessRank returns the severity rank for one readiness value. Canonical order: ready (0) < degraded (1) < disabled (2) < unavailable (3).

Types

type DimensionKey

type DimensionKey string

DimensionKey is a deterministic encoding of Dimensions.

type DimensionMatcher

type DimensionMatcher struct {
	Value        scope.Value
	MatchUnknown bool
}

DimensionMatcher matches one attribution field.

func (DimensionMatcher) Matches

func (m DimensionMatcher) Matches(actual scope.Value) bool

Matches reports whether actual satisfies the matcher.

type Dimensions

type Dimensions struct {
	Principal    scope.Value
	Credential   scope.Value
	Tenant       scope.Value
	Organization scope.Value
	Workspace    scope.Value
	Project      scope.Value
	Department   scope.Value
	CostCenter   scope.Value
	Backend      scope.Value
	Model        scope.Value
	Route        scope.Value
	PolicyLabels map[string]scope.Value
}

Dimensions are safe attribution fields for rule matching and identity.

func DimensionsFromScope

func DimensionsFromScope(view scope.PrincipalScopeView) Dimensions

DimensionsFromScope projects a principal scope view onto dimensions.

func (Dimensions) Key

func (d Dimensions) Key() DimensionKey

Key returns a deterministic dimension encoding. Invalid label keys are omitted.

func (Dimensions) KeyErr

func (d Dimensions) KeyErr() (DimensionKey, error)

KeyErr returns a deterministic dimension encoding or an error for unsafe labels.

type DimensionsMatcher

type DimensionsMatcher struct {
	Principal    DimensionMatcher
	Credential   DimensionMatcher
	Tenant       DimensionMatcher
	Organization DimensionMatcher
	Workspace    DimensionMatcher
	Project      DimensionMatcher
	Department   DimensionMatcher
	CostCenter   DimensionMatcher
	Backend      DimensionMatcher
	Model        DimensionMatcher
	Route        DimensionMatcher
	Labels       map[string]DimensionMatcher
}

DimensionsMatcher is a safe multi-dimension rule matcher.

func (DimensionsMatcher) Matches

func (m DimensionsMatcher) Matches(actual Dimensions) bool

Matches reports whether actual satisfies every configured matcher.

Jump to

Keyboard shortcuts

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