From 04a33f22efc97f22de0cf43b9ffe5a5976dd4e39 Mon Sep 17 00:00:00 2001 From: Dimitrij Drus Date: Fri, 21 Oct 2022 16:07:09 +0200 Subject: [PATCH] refactor!: file system provider rename (#281) --- docs/content/docs/configuration/rules/providers.adoc | 6 +++--- internal/config/rule_provider.go | 2 +- internal/config/test_data/test_config.yaml | 2 +- schema/config.schema.json | 2 +- test_config.yaml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/content/docs/configuration/rules/providers.adoc b/docs/content/docs/configuration/rules/providers.adoc index bf8d73fc8..5a4080326 100644 --- a/docs/content/docs/configuration/rules/providers.adoc +++ b/docs/content/docs/configuration/rules/providers.adoc @@ -15,7 +15,7 @@ Supported providers, including the corresponding configuration options are descr == Filesystem -The filesystem provider allows loading of rule sets from a file system. The configuration of this provider goes into the `file` property. This provider is handy for e.g. starting playing around with Heimdall, e.g. locally, or using Docker, as well as if your deployment strategy considers deploying a Heimdall instance as a Side-Car for each of your services. +The filesystem provider allows loading of rule sets from a file system. The configuration of this provider goes into the `file_system` property. This provider is handy for e.g. starting playing around with Heimdall, e.g. locally, or using Docker, as well as if your deployment strategy considers deploying a Heimdall instance as a Side-Car for each of your services. Following configuration options are supported: @@ -33,7 +33,7 @@ This provider doesn't need any additional configuration for a rule set. So the c ==== [source, yaml] ---- -file: +file_system: src: /path/to/rules/dir watch: true ---- @@ -43,7 +43,7 @@ file: ==== [source, yaml] ---- -file: +file_system: src: /path/to/rules.yaml ---- ==== diff --git a/internal/config/rule_provider.go b/internal/config/rule_provider.go index fd2a566b2..d9bad2b2e 100644 --- a/internal/config/rule_provider.go +++ b/internal/config/rule_provider.go @@ -1,7 +1,7 @@ package config type RuleProviders struct { - FileSystem *FileBasedRuleProviderConfig `koanf:"file,omitempty"` + FileSystem *FileBasedRuleProviderConfig `koanf:"file_system,omitempty"` HTTPEndpoint map[string]any `koanf:"http_endpoint,omitempty"` } diff --git a/internal/config/test_data/test_config.yaml b/internal/config/test_data/test_config.yaml index c5469da43..8cef966ea 100644 --- a/internal/config/test_data/test_config.yaml +++ b/internal/config/test_data/test_config.yaml @@ -267,7 +267,7 @@ rules: - error_handler: authenticate_with_kratos providers: - file: + file_system: src: test_rules.yaml watch: true diff --git a/schema/config.schema.json b/schema/config.schema.json index 8f4ebaee7..4fdf1b41a 100644 --- a/schema/config.schema.json +++ b/schema/config.schema.json @@ -1685,7 +1685,7 @@ "type": "object", "additionalProperties": false, "properties": { - "file": { + "file_system": { "$ref": "#/definitions/fileSystemProvider" }, "http_endpoint": { diff --git a/test_config.yaml b/test_config.yaml index e41247772..ace6cae22 100644 --- a/test_config.yaml +++ b/test_config.yaml @@ -169,7 +169,7 @@ rules: - error_handler: authenticate_with_kratos providers: - file: + file_system: src: test_rules.yaml watch: true