util

package
v0.0.0-...-52d5c43 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JsonSerializer     = "json"
	CborSerializer     = "cbor"
	MsgPackSerializer  = "msgpack"
	ProtobufSerializer = "protobuf"

	BurstStrategy       = "burst"
	LeakyBucketStrategy = "leakybucket"
)

Variables

View Source
var URIRegex = regexp.MustCompile(`^([^\s.#]+\.)*([^\s.#]+)$`)

Functions

func StartServerFromConfigFile

func StartServerFromConfigFile(configFile string) ([]io.Closer, error)

Types

type Anonymous

type Anonymous struct {
	AuthID string `yaml:"authid"`
	Realm  string `yaml:"realm"`
	Role   string `yaml:"role"`
}

type Authenticator

type Authenticator struct {
	// contains filtered or unexported fields
}

func NewAuthenticator

func NewAuthenticator(authenticators Authenticators) *Authenticator

func (*Authenticator) Authenticate

func (a *Authenticator) Authenticate(request auth.Request) (auth.Response, error)

func (*Authenticator) Methods

func (a *Authenticator) Methods() []auth.Method

type Authenticators

type Authenticators struct {
	CryptoSign []CryptoSign `yaml:"cryptosign"`
	WAMPCRA    []WAMPCRA    `yaml:"wampcra"`
	Ticket     []Ticket     `yaml:"ticket"`
	Anonymous  []Anonymous  `yaml:"anonymous"`
}

type Config

type Config struct {
	Version        string         `yaml:"version"`
	Realms         []Realm        `yaml:"realms"`
	Transports     []Transport    `yaml:"transports"`
	Authenticators Authenticators `yaml:"authenticators"`
}

func (Config) Validate

func (c Config) Validate() error

type CryptoSign

type CryptoSign struct {
	AuthID         string   `yaml:"authid"`
	Realm          string   `yaml:"realm"`
	Role           string   `yaml:"role"`
	AuthorizedKeys []string `yaml:"authorized_keys"`
}

type RateLimit

type RateLimit struct {
	Rate     uint   `yaml:"rate"`
	Interval int    `yaml:"interval"`
	Strategy string `yaml:"strategy"`
}

type Realm

type Realm struct {
	Name string `yaml:"name"`
}

type Ticket

type Ticket struct {
	AuthID string `yaml:"authid"`
	Realm  string `yaml:"realm"`
	Role   string `yaml:"role"`
	Ticket string `yaml:"ticket"`
}

type Transport

type Transport struct {
	Type        string    `yaml:"type"`
	Host        string    `yaml:"host"`
	Port        int       `yaml:"port"`
	Serializers []string  `yaml:"serializers"`
	RateLimit   RateLimit `yaml:"ratelimit"`
}

type WAMPCRA

type WAMPCRA struct {
	AuthID     string `yaml:"authid"`
	Realm      string `yaml:"realm"`
	Role       string `yaml:"role"`
	Secret     string `yaml:"secret"`
	Salt       string `yaml:"salt"`
	Iterations int    `yaml:"iterations"`
	KeyLen     int    `yaml:"keylen"`
}

Jump to

Keyboard shortcuts

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