mirror of
https://github.com/ChristianLight/tutor.git
synced 2025-01-10 09:02:14 +00:00
Add CONFIG_USER Filter (#1021)
This commit is contained in:
parent
5d2d7fadef
commit
2520d93fb0
@ -0,0 +1 @@
|
|||||||
|
- [Feature] Introduces the CONFIG_USER Filter. Used to declare unique key:value pairs in config.yml that will be overwritten when running tutor config save. Useful for injecting secrets from an external secrets manager into edx, or other values that may change over time that you need to programmatically fetch. (by @abonnell)
|
@ -111,6 +111,9 @@ def get_user(root: str) -> Config:
|
|||||||
config = get_yaml_file(path)
|
config = get_yaml_file(path)
|
||||||
upgrade_obsolete(config)
|
upgrade_obsolete(config)
|
||||||
update_with_env(config)
|
update_with_env(config)
|
||||||
|
|
||||||
|
for name, value in hooks.Filters.CONFIG_USER.iterate():
|
||||||
|
config[name] = value
|
||||||
return config
|
return config
|
||||||
|
|
||||||
|
|
||||||
|
@ -257,6 +257,17 @@ class Filters:
|
|||||||
#: names must be prefixed with the plugin name in all-caps.
|
#: names must be prefixed with the plugin name in all-caps.
|
||||||
CONFIG_UNIQUE: Filter[list[tuple[str, Any]], []] = Filter()
|
CONFIG_UNIQUE: Filter[list[tuple[str, Any]], []] = Filter()
|
||||||
|
|
||||||
|
#: Used to declare unique key:value pairs in the ``config.yml`` file that will be overwritten on ``tutor config save``.
|
||||||
|
#: This is where you should declare passwords and other secrets that need to be fetched live from an external secrets
|
||||||
|
#: store. Most users will not need to use this filter but it will allow you to programmatically fetch and set secrets
|
||||||
|
#: from an external secrets store such as AWS Secrets Manager via boto3.
|
||||||
|
#:
|
||||||
|
#: Values passed in to this filter will overwrite existing values in the ``config.yml`` file.
|
||||||
|
#:
|
||||||
|
#: :parameter list[tuple[str, ...]] items: list of (name, value) new settings. All
|
||||||
|
#: names must be prefixed with the plugin name in all-caps.
|
||||||
|
CONFIG_USER: Filter[list[tuple[str, Any]], []] = Filter()
|
||||||
|
|
||||||
#: Use this filter to modify the ``docker build`` command.
|
#: Use this filter to modify the ``docker build`` command.
|
||||||
#:
|
#:
|
||||||
#: :parameter list[str] command: the full build command, including options and
|
#: :parameter list[str] command: the full build command, including options and
|
||||||
|
Loading…
Reference in New Issue
Block a user