policy

package
v1.7.0-beta0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccumulateOr

func AccumulateOr(results []core.PolicyEvalResult) core.PolicyEvalResult

AccumulateOr combines multiple policy evaluation results using OR logic. Dominant results (Always, Never) take precedence. If conflicting dominant results exist, it defaults. Otherwise, Allow takes precedence over Deny, which takes precedence over Default. Returns Error if any input result is Error.

func IsDominant

func IsDominant(result core.PolicyEvalResult) (bool, bool)

IsDominant checks if a policy evaluation result is dominant (Always or Never). It returns true and the boolean value (true for Always, false for Never) if dominant, otherwise returns false, false.

func NewService

func NewService(repository Repository, client cc.Client, globalPolicy core.Policy, config core.Config) core.PolicyService

Types

type Repository

type Repository interface {
	Get(ctx context.Context, url string) (core.Policy, error)
}

func NewRepository

func NewRepository(rdb *redis.Client) Repository

Jump to

Keyboard shortcuts

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