Skip to content

Commit

Permalink
refactor!: Rule(-Set) related configuration properties mechanisms ,…
Browse files Browse the repository at this point in the history
… `default` and `providers` moved one level up and renamed (#1028)
  • Loading branch information
dadrus authored Nov 14, 2023
1 parent dad14d9 commit f6ce3b8
Show file tree
Hide file tree
Showing 33 changed files with 1,412 additions and 1,464 deletions.
49 changes: 24 additions & 25 deletions charts/heimdall/templates/demo/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,31 +58,30 @@ data:
{{- toYaml . | nindent 6 }}
{{- end }}
rules:
mechanisms:
authenticators:
- id: anonymous_authenticator
type: anonymous
authorizers:
- id: deny_all_requests
type: deny
- id: allow_all_requests
type: allow
finalizers:
- id: create_jwt
type: jwt
- id: noop_finalizer
type: noop
mechanisms:
authenticators:
- id: anonymous_authenticator
type: anonymous
authorizers:
- id: deny_all_requests
type: deny
- id: allow_all_requests
type: allow
finalizers:
- id: create_jwt
type: jwt
- id: noop_finalizer
type: noop
default:
methods:
- GET
- POST
execute:
- authenticator: anonymous_authenticator
- authorizer: deny_all_requests
- finalizer: create_jwt
default_rule:
methods:
- GET
- POST
execute:
- authenticator: anonymous_authenticator
- authorizer: deny_all_requests
- finalizer: create_jwt
providers:
kubernetes: {}
providers:
kubernetes: {}
{{- end }}
14 changes: 12 additions & 2 deletions charts/heimdall/templates/heimdall/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,18 @@ data:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.rules }}
rules:
{{- with .Values.mechanisms }}
mechanisms:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.default_rule }}
default_rule:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.providers }}
providers:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion cmd/validate/ruleset.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func validateRuleSet(cmd *cobra.Command, args []string) error {
return err
}

conf.Rules.Providers.FileSystem = map[string]any{"src": args[0]}
conf.Providers.FileSystem = map[string]any{"src": args[0]}

mFactory, err := mechanisms.NewFactory(conf, logger)
if err != nil {
Expand Down
Loading

0 comments on commit f6ce3b8

Please sign in to comment.