policies

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEnabledByPolicies

func IsEnabledByPolicies(toolPolicies any) bool

IsEnabledByPolicies checks if the tool is enabled by policies If the tool policies are nil, it returns true If the tool policies are not nil, it returns the value of the Enabled field If the tool policies are not a valid ToolPolicies struct, it returns false

func IsReadOnlyByPolicies

func IsReadOnlyByPolicies(toolPolicies any) bool

IsReadOnlyByPolicies checks if the tool must be read-only by policies If the tool policies are nil, it returns false If the tool policies are not nil, it returns the value of the ReadOnly field If the tool policies are not a valid ToolPolicies struct, it returns true

func WithPolicies

func WithPolicies(ctx context.Context, policies *Policies) context.Context

Types

type Policies

type Policies struct {
	Tools map[string]any `yaml:"tools"`
}

func GetPolicies

func GetPolicies(ctx context.Context) *Policies

func Read

func Read(policiesFile string) (*Policies, error)

type ToolPolicies

type ToolPolicies struct {
	Enabled  bool `yaml:"enabled" json:"enabled"`
	ReadOnly bool `yaml:"read-only" json:"read-only"`
}

Jump to

Keyboard shortcuts

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