Ajout d'un filtre de connexion configurable pour l'utilisateur

This commit is contained in:
2020-08-13 10:29:52 +02:00
parent 5790c91d82
commit 32c19bace3
8 changed files with 176 additions and 1 deletions

View File

@ -18,6 +18,7 @@ type Config struct {
HTTP HTTPConfig `yaml:"http"`
OIDC OIDCConfig `yaml:"oidc"`
Database DatabaseConfig `yaml:"database"`
Auth AuthConfig `yaml:"auth"`
}
// NewFromFile retrieves the configuration from the given file
@ -69,6 +70,10 @@ type DatabaseConfig struct {
DSN string `yaml:"dsn" env:"DATABASE_DSN"`
}
type AuthConfig struct {
Rules []string `yaml:"rules" env:"AUTH_RULES"`
}
func NewDumpDefault() *Config {
config := NewDefault()
return config
@ -102,6 +107,11 @@ func NewDefault() *Config {
Database: DatabaseConfig{
DSN: "host=localhost database=daddy",
},
Auth: AuthConfig{
Rules: []string{
"user.Email endsWith 'cadoles.com'",
},
},
}
}