config

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Targets []Target          `json:"targets"`
	Users   UsersProviderOIDC `json:"users"`
	Policy  PolicyConfig      `json:"policy"`
	Facade  FacadeConfig      `json:"facade"`
	Storage PostgresConfig    `json:"storage"`
}

func (*Config) Validate

func (c *Config) Validate() error

type Connection

type Connection struct {
	Host        string `json:"host"`
	Port        int    `json:"port"`
	User        string `json:"user"`
	Password    string `json:"password"`
	DB          string `json:"db"`
	UseSSL      bool   `json:"use_ssl"`
	MaxPoolSize int    `json:"max_pool_size"`
}

type FacadeConfig added in v0.9.0

type FacadeConfig struct {
	Port               int    `json:"port"`
	CookieSecret       string `json:"cookie_secret"`
	UnsafeCORSAllowAll bool   `json:"unsafe_cors_allow_all"`
}

type Op

type Op string
const (
	OpSelect Op = "select"
	OpInsert Op = "insert"
	OpUpdate Op = "update"
	OpDelete Op = "delete"
)

func (Op) S added in v0.12.0

func (op Op) S() string

type PolicyConfig added in v0.19.0

type PolicyConfig struct {
	Path string `json:"path"` // directory with .rego modules; relative paths are resolved from the config file location
}

type PostgresConfig added in v0.13.0

type PostgresConfig struct {
	Host        string `json:"host"`
	Port        int    `json:"port"`
	Database    string `json:"database"`
	Username    string `json:"username"`
	Password    string `json:"password"`
	UseSSL      bool   `json:"use_ssl"`
	MaxPoolSize int    `json:"max_pool_size"`
}

type Role added in v0.17.8

type Role string
const (
	RoleAdmin Role = "admin"
	RoleUser  Role = "user"
)

func (Role) IsValid added in v0.17.8

func (r Role) IsValid() bool

func (Role) S added in v0.17.8

func (r Role) S() string

type Target

type Target struct {
	ID            TargetID      `json:"id"`
	Description   string        `json:"description"`
	Tags          []string      `json:"tags"`
	Type          string        `json:"type"`
	Connection    Connection    `json:"connection"`
	DefaultSchema string        `json:"default_schema"`
	Tables        []TargetTable `json:"tables"`
}

type TargetID added in v0.9.0

type TargetID string

func (TargetID) S added in v0.12.0

func (t TargetID) S() string

type TargetTable

type TargetTable struct {
	Table  string   `json:"table"`
	Fields []string `json:"fields"`
}

type UserID added in v0.9.0

type UserID string

func (UserID) S added in v0.12.0

func (u UserID) S() string

type UsersProviderOIDC added in v0.9.0

type UsersProviderOIDC struct {
	ClientID            string          `json:"client_id"`
	ClientSecret        string          `json:"client_secret"`
	IssuerURL           string          `json:"issuer_url"`
	RedirectURL         string          `json:"redirect_url"`
	Scopes              []string        `json:"scopes"`
	AccessTokenAudience string          `json:"access_token_audience"`
	RoleClaim           string          `json:"role_claim"            validate:"required"`
	RoleMapping         map[string]Role `json:"role_mapping"          validate:"required"`
}

Jump to

Keyboard shortcuts

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