feat(auth): add user access filtering rules

This commit is contained in:
2020-08-09 11:59:03 +02:00
parent a30d6b76d3
commit f55bce9ee2
8 changed files with 174 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,9 @@ func NewDefault() *Config {
Database: DatabaseConfig{
DSN: "host=localhost database=guesstimate",
},
Auth: AuthConfig{
Rules: []string{},
},
}
}