config

package
v0.0.0-...-84f1f66 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEF_MONGOBD_DATABASE        = "identity"
	DEF_MONGODB_TIMEOUT         = 5
	DEF_REDIS_TIMEOUT           = 5
	DEF_GRPC_ADMIN_PORT         = 1984
	DEF_GRPC_CLIENT_PORT        = 1985
	DEF_TOTP_RECOVERY_LENGTH    = 4
	DEF_TOTP_RECOVERY_SIZE      = 8
	DEF_TOTP_ISSUER             = "identity"
	DEF_KEY_LENGTH              = 32
	DEF_JWT_ISSUER              = "identity"
	DEF_TOTP_REQUEST_MINUTES    = 10
	DEF_VALIDATION_MINUTES      = 1440 // 24 h
	DEF_LOGIN_SESSION_MINUTES   = 30
	DEF_MACHINE_KEY_MINUTES     = 525_600 // 1 y
	DEF_CHANGE_PASSWORD_MINUTES = 1440    // 24 h
	DEF_WEBAUTHN_LOGIN_MINUTES  = 10
	DEF_LOGIN_MAX_FAILS         = 3
	DEF_LOGIN_LOCKOUT_MINUTES   = 30
)
View Source
const (
	ENV_MASTER_KEY_B64   = "ID_MASTER_KEY_B64"
	ENV_MONGODB_URI      = "ID_MONGODB_URI"
	ENV_REDIS_HOST       = "ID_REDIS_HOST"
	ENV_REDIS_PASSWORD   = "ID_REDIS_PASSWORD"
	ENV_TOTP_ISSUER      = "ID_TOTP_ISSUER"
	ENV_JWT_ISSUER       = "ID_JWT_ISSUER"
	ENV_ADMIN_CERT_FILE  = "ID_ADMIN_CERT_FILE"
	ENV_ADMIN_KEY_FILE   = "ID_ADMIN_KEY_FILE"
	ENV_CLIENT_CERT_FILE = "ID_CLIENT_CERT_FILE"
	ENV_CLIENT_KEY_FILE  = "ID_CLIENT_KEY_FILE"
	ENV_WEBAUTHN_ORIGIN  = "ID_WEBAUTHN_ORIGIN"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MongoDb    MongoDbConfig
	Redis      RedisConfig
	AdminGrpc  GrpcConfig
	ClientGrpc GrpcConfig
	Totp       TotpConfig
	Jwt        JwtConfig
	Session    SessionConfig
	Login      LoginConfig
	Keys       SecureKeyConfig
	WebAuthn   WebAuthnConfig
}

func GetConfiguration

func GetConfiguration() (cfg Config, err error)

func GetDefaultConfiguration

func GetDefaultConfiguration() Config

type GrpcConfig

type GrpcConfig struct {
	Port     int
	CertFile string
	KeyFile  string
}

type JwtConfig

type JwtConfig struct {
	Issuer string
}

type LoginConfig

type LoginConfig struct {
	MaxFails       int
	LockoutMinutes int
}

type MongoDbConfig

type MongoDbConfig struct {
	Uri      string
	Database string
	Timeout  int
}

type RecoveryTokensConfig

type RecoveryTokensConfig struct {
	Length int
	Size   int
}

type RedisConfig

type RedisConfig struct {
	Host     string
	Password string
	Timeout  int
}

type SecureKeyConfig

type SecureKeyConfig struct {
	Length    int
	MasterKey keys.MasterKey
}

type SessionConfig

type SessionConfig struct {
	TotpRequestMinutes  int
	ValidationMinutes   int
	LoginSessionMinutes int
	MachineKeyMinutes   int
	AuthChangeMinutes   int
	WebauthLoginMinutes int
}

type TotpConfig

type TotpConfig struct {
	Issuer         string
	RecoveryTokens RecoveryTokensConfig
}

type WebAuthnConfig

type WebAuthnConfig struct {
	DisplayName string
	Origin      string
}

Jump to

Keyboard shortcuts

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