add RegexSelector

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
Jörn Friedrich Dreyer
2021-07-23 08:22:40 +00:00
parent 40c8031441
commit 4385d3dacb
3 changed files with 98 additions and 4 deletions
+8
View File
@@ -142,6 +142,7 @@ type PolicySelector struct {
Static *StaticSelectorConf
Migration *MigrationSelectorConf
Claims *ClaimsSelectorConf
Regex *RegexSelectorConf
}
// StaticSelectorConf is the config for the static-policy-selector
@@ -173,6 +174,13 @@ type ClaimsSelectorConf struct {
UnauthenticatedPolicy string `mapstructure:"unauthenticated_policy"`
}
// RegexSelectorConf is the config for the regex-selector
type RegexSelectorConf struct {
DefaultPolicy string `mapstructure:"default_policy"`
MatchesPolicies map[string]map[string]string `mapstructure:"matches_policies"`
UnauthenticatedPolicy string `mapstructure:"unauthenticated_policy"`
}
// New initializes a new configuration
func New() *Config {
return &Config{