authelia/internal/configuration/schema/session.go
James Elliott fc05b973ad
[FEATURE] Redis DB Index Selection (#653)
* [FEATURE] Redis DB Number Selection
- Allow users to specify the DB number
- This is so users who use their redis for multiple purposes can have clear demarcation between their data

* revert: import order

* Add default/example to config template with docs

* Set DB Index property name to be more clear
2020-02-28 11:14:44 +11:00

28 lines
1000 B
Go

package schema
// RedisSessionConfiguration represents the configuration related to redis session store.
type RedisSessionConfiguration struct {
Host string `mapstructure:"host"`
Port int64 `mapstructure:"port"`
Password string `mapstructure:"password"`
DatabaseIndex int `mapstructure:"database_index"`
}
// SessionConfiguration represents the configuration related to user sessions.
type SessionConfiguration struct {
Name string `mapstructure:"name"`
Secret string `mapstructure:"secret"`
// Expiration in seconds
Expiration int64 `mapstructure:"expiration"`
// Inactivity in seconds
Inactivity int64 `mapstructure:"inactivity"`
Domain string `mapstructure:"domain"`
Redis *RedisSessionConfiguration `mapstructure:"redis"`
}
// DefaultSessionConfiguration is the default session configuration
var DefaultSessionConfiguration = SessionConfiguration{
Name: "authelia_session",
Expiration: 3600,
}