Skip to content

blueprints: Add support for nested !Context values - #20577

Merged
rissson merged 8 commits into
goauthentik:mainfrom
astro-stan:add-support-for-nested-contexts
Aug 28, 2026
Merged

rissson merged 8 commits into
goauthentik:mainfrom
astro-stan:add-support-for-nested-contexts

Conversation

@astro-stan

@astro-stan astro-stan commented Feb 25, 2026 •

Copy link
Copy Markdown
Contributor

Details

This PR adds a backwards- compatible support for resolving nested values within a blueprint's context.

Example:

context:
 goauthentik.io: priority-value
 goauthentik:
   io: non-priority-value
  foo:
    bar:
      - baz: value
entries:
  - ...
    key1: !Context foo.bar.0.baz # Resolves to `value`
    key2: !Context goauthentik.io # Resolves to `priority-value`, even though a nested dot notation key with the same name exists

Why is this needed?

When writing more complex blueprints, I frequently want to group context values by "category" or take part of another key's value. Until now I had to write all keys using their full paths i.e. authentication.something.setting1, authentication.something.setting2, etc instead of writing them as a dictionary like so:

authentication:
  something:
    setting1: ...
    setting2: ...

Moreover, sometimes I've had use cases where I want to take the value of 1 element in a list, for example:

context:
  some-list:
     - value 1
     - value 2  # I want this value only 

This was impossible to do until now

Checklist

  • Local tests pass (ak test authentik/)
  • The code has been formatted (make lint-fix)

If an API change has been made

  • The API schema has been updated (make gen-build)

If changes to the frontend have been made

  • The code has been formatted (make web)

If applicable

  • The documentation has been updated
  • The documentation has been formatted (make docs)

@astro-stan
astro-stan requested review from a team as code owners February 25, 2026 21:11
@netlify

netlify Bot commented Feb 25, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit c9c61e4
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/699f6894f88e1900084b8258
😎 Deploy Preview https://deploy-preview-20577--authentik-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Feb 25, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit 1a4efb3
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/6a91994e04465d00084b84be
😎 Deploy Preview https://deploy-preview-20577--authentik-integrations.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Feb 25, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 1a4efb3
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6a91994ef5347300086abd69
😎 Deploy Preview https://deploy-preview-20577--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Feb 25, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.14286% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 91.66%. Comparing base (75f9c40) to head (1a4efb3).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
authentik/blueprints/v1/common.py 96.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #20577      +/-   ##
==========================================
- Coverage   91.67%   91.66%   -0.02%     
==========================================
  Files        1151     1151              
  Lines       73416    73456      +40     
  Branches     4054     4054              
==========================================
+ Hits        67301    67330      +29     
- Misses       6073     6084      +11     
  Partials       42       42              
Flag Coverage Δ
conformance 34.39% <5.71%> (-0.02%) ⬇️
e2e 39.06% <5.71%> (-0.01%) ⬇️
integration 30.54% <5.71%> (-0.47%) ⬇️
rust 42.92% <ø> (ø)
unit 93.23% <97.14%> (+0.01%) ⬆️
unit-migrate 93.24% <97.14%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@astro-stan astro-stan changed the title feat: Add support for nested !Context values blueprints: Add support for nested !Context values Feb 25, 2026
@dewi-tik
dewi-tik requested a review from rissson August 27, 2026 16:43
@rissson rissson self-assigned this Aug 27, 2026
@github-project-automation github-project-automation Bot moved this from Todo to In Progress in authentik Core Aug 28, 2026
@rissson
rissson merged commit 5826825 into goauthentik:main Aug 28, 2026
137 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in authentik Core Aug 28, 2026
@rissson

rissson commented Aug 28, 2026

Copy link
Copy Markdown
Member

thank you for your contribution!

@astro-stan
astro-stan deleted the add-support-for-nested-contexts branch August 28, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants