policies

package
v0.96.14 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = fmt.Errorf("policy not found")

Functions

This section is empty.

Types

type NewRegistryConfig

type NewRegistryConfig struct {
	Name string
	// Host is deprecated. Use URL instead
	Host    string
	URL     string
	Default bool
}

type PolicyProvider

type PolicyProvider struct {
	// contains filtered or unexported fields
}

PolicyProvider represents an external policy provider

func (*PolicyProvider) Resolve

func (p *PolicyProvider) Resolve(policyName string, token string) (*schemaapi.Policy, *PolicyReference, error)

Resolve calls the remote provider for retrieving a policy

func (*PolicyProvider) ResolveGroup added in v0.96.14

func (p *PolicyProvider) ResolveGroup(groupName string, token string) (*schemaapi.PolicyGroup, *PolicyReference, error)

ResolveGroup calls remote provider for retrieving a policy group definition

type PolicyReference added in v0.96.5

type PolicyReference struct {
	URL    string
	Digest string
}

type ProviderResponse

type ProviderResponse struct {
	Data   map[string]any `json:"data"`
	Digest string         `json:"digest"`
}

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry manages policy providers

func NewRegistry

func NewRegistry(logger log.Logger, conf ...*NewRegistryConfig) (*Registry, error)

func (*Registry) DefaultProvider

func (r *Registry) DefaultProvider() *PolicyProvider

func (*Registry) GetProvider

func (r *Registry) GetProvider(name string) *PolicyProvider

func (*Registry) GetProviderNames added in v0.96.5

func (r *Registry) GetProviderNames() []string

Jump to

Keyboard shortcuts

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