opa: github.com/open-policy-agent/opa/config Index | Files

package config

import "github.com/open-policy-agent/opa/config"

Package config implements OPA configuration file parsing and validation.

Index

Package Files

config.go

type Config Uses

type Config struct {
    Services                     json.RawMessage            `json:"services"`
    Labels                       map[string]string          `json:"labels"`
    Discovery                    json.RawMessage            `json:"discovery"`
    Bundle                       json.RawMessage            `json:"bundle"` // Deprecated: Use `bundles` instead
    Bundles                      json.RawMessage            `json:"bundles"`
    DecisionLogs                 json.RawMessage            `json:"decision_logs"`
    Status                       json.RawMessage            `json:"status"`
    Plugins                      map[string]json.RawMessage `json:"plugins"`
    DefaultDecision              *string                    `json:"default_decision"`
    DefaultAuthorizationDecision *string                    `json:"default_authorization_decision"`
}

Config represents the configuration file that OPA can be started with.

func ParseConfig Uses

func ParseConfig(raw []byte, id string) (*Config, error)

ParseConfig returns a valid Config object with defaults injected. The id and version parameters will be set in the labels map.

func (Config) DefaultAuthorizationDecisionRef Uses

func (c Config) DefaultAuthorizationDecisionRef() ast.Ref

DefaultAuthorizationDecisionRef returns the default authorization decision as a reference.

func (Config) DefaultDecisionRef Uses

func (c Config) DefaultDecisionRef() ast.Ref

DefaultDecisionRef returns the default decision as a reference.

func (Config) PluginsEnabled Uses

func (c Config) PluginsEnabled() bool

PluginsEnabled returns true if one or more plugin features are enabled.

Package config imports 5 packages (graph) and is imported by 4 packages. Updated 2019-08-16. Refresh now. Tools for package owners.