config

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACL

type ACL struct {
	User   UserID   `json:"user"`
	Op     Op       `json:"op"`
	Target TargetID `json:"target"`
	Tbl    string   `json:"tbl"`
	Allow  bool     `json:"allow"`
}

type AuthType added in v0.9.0

type AuthType string
const (
	AuthTypeConfig AuthType = "config"
	AuthTypeOIDC   AuthType = "oidc"
)

type Config

type Config struct {
	Targets []Target     `json:"targets"`
	Users   UsersConfig  `json:"users"`
	ACLs    []ACL        `json:"acls"`
	Facade  FacadeConfig `json:"facade"`
}

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"`
}

type IProvider added in v0.9.0

type IProvider interface {
	Type() AuthType
	// contains filtered or unexported methods
}

type Op

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

type Target

type Target struct {
	ID         TargetID      `json:"id"`
	Type       string        `json:"type"`
	Connection Connection    `json:"connection"`
	Tables     []TargetTable `json:"tables"`
}

type TargetID added in v0.9.0

type TargetID string

type TargetTable

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

type User

type User struct {
	ID       UserID `json:"id"`
	Username string `json:"username"`
	Password string `json:"password"`
}

type UserID added in v0.9.0

type UserID string

type UsersConfig added in v0.9.0

type UsersConfig struct {
	Provider IProvider
}

func (*UsersConfig) UnmarshalJSON added in v0.9.0

func (u *UsersConfig) UnmarshalJSON(data []byte) error

type UsersProviderConfig added in v0.9.0

type UsersProviderConfig []User

func (UsersProviderConfig) Type added in v0.9.0

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"`
}

func (UsersProviderOIDC) Type added in v0.9.0

func (UsersProviderOIDC) Type() AuthType

Jump to

Keyboard shortcuts

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