config

package
v0.0.0-...-0149ed5 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SessionIDCookieName = "sid"
	SessionTTL          = 24 * time.Hour * 30 // 30 days
	SessionIDCookieTTL  = SessionTTL
)
View Source
const (
	AuthCodeTTL     = 10 * time.Minute
	AccessTokenTTL  = 30 * time.Minute
	RefreshTokenTTL = SessionTTL
	IDTokenTTL      = SessionTTL
)
View Source
const (
	AuthCodeLength     = 30
	ClientIDLength     = 30
	ClientSecretLength = 30
)
View Source
const (
	AuthorizationCodeGrantType typedef.GrantType = "authorization_code"
	RefreshTokenGrantType      typedef.GrantType = "refresh_token"
)
View Source
const AccessLoggerTagValue = "access"
View Source
const AppLoggerTagValue = "app"
View Source
const (
	AppName = "idp"
)
View Source
const (
	BearerTokenType typedef.TokenType = "Bearer"
)
View Source
const (
	Issuer = "https://localhost:4443"
)
View Source
const LoggerTagKey = "type"
View Source
const OIDCRootPath = "connect"
View Source
const UserRootPath = "user"

Variables

This section is empty.

Functions

func AuthorizationPath

func AuthorizationPath() string

func TokenPath

func TokenPath() string

func UserAuthenticationPath

func UserAuthenticationPath() string

func UserConsentPath

func UserConsentPath() string

func UserInfoPath

func UserInfoPath() string

func UserRegistrationPath

func UserRegistrationPath() string

Types

type Config

type Config struct {
	Port                int           `env:"PORT" envDefault:"80"`
	DBHost              string        `env:"DB_HOST" envDefault:"127.0.0.1"`
	DBPort              int           `env:"DB_PORT" envDefault:"3306"`
	DBAdmin             string        `env:"DB_USER" envDefault:"idp"`
	DBPassword          string        `env:"DB_PASSWORD" envDefault:"idp"`
	DBName              string        `env:"DB_NAME" envDefault:"idp"`
	RedisHost           string        `env:"REDIS_HOST" envDefault:"127.0.0.1"`
	RedisPort           int           `env:"REDIS_PORT" envDefault:"6379"`
	RedisPassword       string        `env:"REDIS_PASSWORD" envDefault:""`
	RedisDB             int           `env:"REDIS_DB" envDefault:"0"`
	LogLevel            zerolog.Level `env:"ZEROLOG_LEVEL" envDefault:"0"` // debug
	IdpHost             string        `env:"IDP_HOST" envDefault:"https://localhost:4443"`
	EnableDebugDBClient bool          `env:"ENABLE_DEBUG_DB_CLIENT" envDefault:"true"`
	EnableProfiler      bool          `env:"ENABLE_PROFILER" envDefault:"true"`
}

func New

func New() (*Config, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳