blueprints: emit draft-07 definitions instead of $defs (cherry-pick #24981 to version-2026.8) - #24985
Conversation
* blueprints: emit draft-07 `definitions` instead of `$defs`
The generated blueprint schema declares draft-07:
"$schema": "http://json-schema.org/draft-07/schema"
but stored every model definition under `$defs` and referenced them as
`#/$defs/...`. `$defs` is 2020-12 vocabulary; draft-07 spells it `definitions`.
A validator honouring the declared dialect therefore cannot resolve any of
those references, so nothing consuming the published schema.json can validate
a blueprint at all — which is what #24248 reports.
Switching the declared dialect to 2020-12 instead is not a drop-in: the schema
also uses draft-07-style plain-fragment `$id` values (`#/properties/version`),
which 2020-12 does not permit — it uses `$anchor` for that. Renaming the
keyword keeps the schema internally consistent with what it already claims to
be, and is the smaller change.
Adds a regression test that validates the schema the way a consumer does:
serialized through `json_default`, exactly as `build_schema` writes it, since
the in-memory dict still holds gettext_lazy proxies. It asserts the schema
passes `Draft7Validator.check_schema` and that every `$ref` resolves to a real
definition.
Verified:
manage.py test authentik.blueprints.tests.test_schema.TestSchema -> 5 passed
reverting schema.py -> 3 failed
ruff check / ruff format -> clean
Note: authentik.blueprints.tests.test_v1.TestBlueprintsV1.test_import_yaml_tags
fails identically with and without this change on current main.
closes #24248
* re-gen
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
---------
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: Jens Langhammer <jens@goauthentik.io>
✅ Deploy Preview for authentik-integrations ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## version-2026.8 #24985 +/- ##
===============================================
Coverage 91.46% 91.47%
===============================================
Files 1148 1149 +1
Lines 72268 72307 +39
Branches 3875 3875
===============================================
+ Hits 66100 66140 +40
+ Misses 6133 6132 -1
Partials 35 35
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
|
authentik PR Installation instructions Instructions for docker-composeAdd the following block to your AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-1726b1c8e5716578d6f4b6f746d3907178336022
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)sAfterwards, run the upgrade commands from the latest release notes. Instructions for KubernetesAdd the following block to your authentik:
outposts:
container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
image:
repository: ghcr.io/goauthentik/dev-server
tag: gh-1726b1c8e5716578d6f4b6f746d3907178336022Afterwards, run the upgrade commands from the latest release notes. |
Cherry-pick of #24981 to
version-2026.8branch.Original PR: #24981
Original Author: @abhisheksharma2411
Cherry-picked commit: da1d219