Documentation ¶
Index ¶
- Variables
- type NewRegistryConfig
- type PolicyProvider
- func (p *PolicyProvider) Resolve(policyName, orgName, token string) (*schemaapi.Policy, *PolicyReference, error)
- func (p *PolicyProvider) ResolveGroup(groupName, orgName, token string) (*schemaapi.PolicyGroup, *PolicyReference, error)
- func (p *PolicyProvider) ValidateAttachment(att *schemaapi.PolicyAttachment, token string) error
- type PolicyReference
- type ProviderResponse
- type RawMessage
- type Registry
- type ValidateRequest
- type ValidateResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = fmt.Errorf("policy not found")
Functions ¶
This section is empty.
Types ¶
type NewRegistryConfig ¶
type PolicyProvider ¶
type PolicyProvider struct {
// contains filtered or unexported fields
}
PolicyProvider represents an external policy provider
func (*PolicyProvider) Resolve ¶
func (p *PolicyProvider) Resolve(policyName, orgName, 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, orgName, token string) (*schemaapi.PolicyGroup, *PolicyReference, error)
ResolveGroup calls remote provider for retrieving a policy group definition
func (*PolicyProvider) ValidateAttachment ¶ added in v0.144.0
func (p *PolicyProvider) ValidateAttachment(att *schemaapi.PolicyAttachment, token string) error
type PolicyReference ¶ added in v0.96.5
type ProviderResponse ¶
type ProviderResponse struct { // Deprecated: Raw is the preferred approach Data map[string]any `json:"data"` Digest string `json:"digest"` Raw *RawMessage `json:"raw"` }
type RawMessage ¶ added in v0.97.7
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
type ValidateRequest ¶ added in v0.144.0
type ValidateRequest struct {
PolicyAttachment string `json:"policy_attachment"`
}
type ValidateResponse ¶ added in v0.144.0
Click to show internal directories.
Click to hide internal directories.