config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: Apache-2.0 Imports: 8 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 {
	AdminConfig         []model.AdminCreateArgs     `json:"adminConfig"`
	BaseURL             *jt.JSONType[*url.URL]      `json:"baseURL"`
	Iss                 string                      `json:"iss"`
	JWKS                JWKS                        `json:"jwks"`
	LogJSON             bool                        `json:"logJSON"`
	LogLevel            LogLevel                    `json:"logLevel"`
	Port                uint16                      `json:"port"`
	PreventRobots       PreventRobots               `json:"preventRobots"`
	RelativeRedirectURL *jt.JSONType[*url.URL]      `json:"relativeRedirectURL"`
	RequestTimeout      *jt.JSONType[time.Duration] `json:"requestTimeout"`
	RequestMaxBodyBytes int64                       `json:"requestMaxBodyBytes"`
	SecretQueryKey      string                      `json:"secretQueryKey"`
	ShutdownTimeout     *jt.JSONType[time.Duration] `json:"shutdownTimeout"`
	Validation          model.Validation            `json:"validation"`
}

Config is the configuration for the magiclinksdev server.

func (Config) DefaultsAndValidate

func (c Config) DefaultsAndValidate() (Config, error)

DefaultsAndValidate implements the jsontype.Config interface.

type JWKS

type JWKS struct {
	IgnoreDefault bool `json:"ignoreDefault"`
}

JWKS is the JSON Web Key Set configuration.

func (JWKS) DefaultsAndValidate

func (j JWKS) DefaultsAndValidate() (JWKS, error)

DefaultsAndValidate implements the jsontype.Config interface.

type LogLevel

type LogLevel string
const (
	LogLevelDebug LogLevel = "debug"
	LogLevelInfo  LogLevel = "info"
	LogLevelWarn  LogLevel = "warn"
	LogLevelError LogLevel = "error"
)

type PreventRobots

type PreventRobots struct {
	Method      PreventRobotsMethod         `json:"method"`
	ReCAPTCHAV3 magiclink.ReCAPTCHAV3Config `json:"recaptchav3"`
}

PreventRobots is the configuration for preventing robots from following magic links.

func (PreventRobots) DefaultsAndValidate

func (p PreventRobots) DefaultsAndValidate() (PreventRobots, error)

DefaultsAndValidate implements the jsontype.Config interface.

type PreventRobotsMethod

type PreventRobotsMethod string

PreventRobotsMethod is a set of string constants that indicate how to prevent robots from following magic links.

const (
	// PreventRobotsReCAPTCHAV3 indicates that ReCAPTCHA V3 should be used to prevent robots from following magic links.
	PreventRobotsReCAPTCHAV3 PreventRobotsMethod = "recaptchav3"
)

Jump to

Keyboard shortcuts

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