goauthentik / goauthentik/authentik
Overwrite default blueprints deterministically
- Dominant language
- Python
- Stars
- 25.6k
- Forks
- 2k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 644
Description
**Writing custom blueprints that change parts of the default blueprints**
Often I want to change only some small parts of the default configuration. I.e. change the title of a default flow, add or remove a stage...
One way to do this is to copy the complete default blueprint and apply the small changes.
The Problem is that this causes a lot of configuration redundancy and I will miss all upstream configuration updates/changes.
Therefore I prefer to overwrite only the necessary default objects.
With `authentik_blueprints.metaapplyblueprint` I can create all the dependencies that need to be applied before my custom blueprints overwrite their objects.
**Problem: nondeterministic blueprint execution**
Even if I define the needed dependencies, this doesn't prevent the default blueprints to be applied afterwards again, so my changes might be overwritten by the default values again.
**Possible solution**
Define the blueprint execution order by the `authentik_blueprints.metaapplyblueprint` dependencies. This requires to read all blueprints to create a dependency graph. This must also handle circular dependencies, i.e. throw an error.
Always when a blueprint is applied all the blueprints that depend on that should be applied in the correct order as well.
**Alternative Solutions**
* Define the execution order by the blueprint filenames, i.e. `8_custom_blueprint.yaml`
* As blueprint file changes trigger a reapplication, all blueprints that come after the applied blueprint have to be reapplied in the correct order.
* Add a way to deactivate the automatic execution of default blueprints:
i.e. an env variable like `DEACTIVATE_DEFAULT_BLUEPRINTS=TRUE`
Deactivated blueprints should be able to be applied as dependency using `authentik_blueprints.metaapplyblueprint`.
This way all the required default blueprints could be specified explicitly.
Contributor guide
Assessment
This issue has not been assessed yet.