config

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ptr

func Ptr[T any](v T) *T

Types

type Config

type Config struct {
	Port int    `hcl:"port,optional"`
	Bind string `hcl:"bind,optional"`

	Tls *ProxyTLS `hcl:"tls,block"`

	Nomad      *NomadServer `hcl:"nomad,block"`
	Validators []Validator  `hcl:"validator,block"`
	Mutators   []Mutator    `hcl:"mutator,block"`

	Telemetry *Telemetry `hcl:"telemetry,block"`
}

func DefaultConfig

func DefaultConfig() *Config

func LoadConfig

func LoadConfig(name string) (*Config, error)

type Logging

type Logging struct {
	Level       string       `hcl:"level,optional"`
	SlogLogging *SlogLogging `hcl:"slog,block"`
	OtelLogging *OtelLogging `hcl:"otel,block"`
}

type Metrics

type Metrics struct {
	Enabled bool `hcl:"enabled,optional"`
}

type Mutator

type Mutator struct {
	Type         string   `hcl:"type,label"`
	Name         string   `hcl:"name,label"`
	OpaRule      *OpaRule `hcl:"opa_rule,block"`
	Webhook      *Webhook `hcl:"webhook,block"`
	ResolveToken bool     `hcl:"resolve_token,optional"`
}

type NomadServer

type NomadServer struct {
	Address string          `hcl:"address"`
	TLS     *NomadServerTLS `hcl:"tls,block"`
}

type NomadServerTLS

type NomadServerTLS struct {
	CaFile             string `hcl:"ca_file"`
	CertFile           string `hcl:"cert_file"`
	KeyFile            string `hcl:"key_file"`
	InsecureSkipVerify bool   `hcl:"insecure_skip_verify,optional"`
}

type NotationVerifierConfig

type NotationVerifierConfig struct {
	TrustPolicyFile     string `hcl:"trust_policy_file"`
	TrustStoreDir       string `hcl:"trust_store_dir"`
	RepoPlainHTTP       bool   `hcl:"repo_plain_http,optional"`
	MaxSigAttempts      int    `hcl:"max_sig_attempts,optional"`
	CredentialStoreFile string `hcl:"credential_store_file,optional"`
}

type OpaRule

type OpaRule struct {
	Query    string                  `hcl:"query"`
	Filename string                  `hcl:"filename"`
	Notation *NotationVerifierConfig `hcl:"notation,block"`
}

type OtelLogging

type OtelLogging struct {
	Enabled *bool `hcl:"enabled,optional"`
}

type ProxyTLS

type ProxyTLS struct {
	CertFile     string `hcl:"cert_file"`
	KeyFile      string `hcl:"key_file"`
	CaFile       string `hcl:"ca_file"`
	NoClientCert bool   `hcl:"no_client_cert,optional"`
}

type RequestContext

type RequestContext struct {
	ClientIP     string        `json:"clientIP"`
	AccessorID   string        `json:"accessorID"`
	ResolveToken bool          `json:"resolveToken"`
	TokenInfo    *api.ACLToken `json:"tokenInfo,omitempty"`
}

type SlogLogging

type SlogLogging struct {
	Text    *bool   `hcl:"text,optional"`
	TextOut *string `hcl:"text_out,optional"`

	Json    *bool   `hcl:"json,optional"`
	JsonOut *string `hcl:"json_out,optional"`
}

type Telemetry

type Telemetry struct {
	Logging *Logging `hcl:"logging,block"`
	Metrics *Metrics `hcl:"metrics,block"`
	Tracing *Tracing `hcl:"tracing,block"`
}

type Tracing

type Tracing struct {
	Enabled bool `hcl:"enabled,optional"`
}

type Validator

type Validator struct {
	Type         string   `hcl:"type,label"`
	Name         string   `hcl:"name,label"`
	OpaRule      *OpaRule `hcl:"opa_rule,block"`
	Webhook      *Webhook `hcl:"webhook,block"`
	ResolveToken bool     `hcl:"resolve_token,optional"`

	Notation *NotationVerifierConfig `hcl:"notation,block"`
}

type Webhook

type Webhook struct {
	Endpoint string `hcl:"endpoint"`
	Method   string `hcl:"method"`
}

Jump to

Keyboard shortcuts

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