Skip to content

website/docs: Fix documentation about attribute merging for indirect membership#12168

Merged
tanberry merged 1 commit intogoauthentik:mainfrom
pklaschka:patch-1
Nov 26, 2024
Merged

website/docs: Fix documentation about attribute merging for indirect membership#12168
tanberry merged 1 commit intogoauthentik:mainfrom
pklaschka:patch-1

Conversation

@pklaschka
Copy link
Contributor

tl;dr: the documentation about how attributes get merged was correct before #6017, but is now out of date. This change fixes that.

Details

While for role memberships, it is true that they are only applied for direct memberships, this does not appear to be the case for attributes (which is good as this also follows the "Hierarchy" system documented in the same file).

In terms of the implementation, this is the case due to the call to all_groups() in

for group in self.all_groups().order_by("name"):
always_merger.merge(final_attributes, group.attributes)
, introduced in #6017. Looking through the files in there, it is clear that this line in the documentation is from before that point:
Attributes of groups are recursively merged, for all groups the user is a _direct_ member of.
.


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 website)

…membership

While for role memberships, it is true that they are only applied for _direct_ memberships, this does not appear to be the case for attributes (which is good as this also follows the "Hierarchy" system documented in the same file).

In terms of the implementation, this is the case due to the call to `all_groups()` in https://github.com/goauthentik/authentik/blob/3d5a189fa732ef462dbbd73b88c128ebaf1833f9/authentik/core/models.py#L312-L313, introduced in goauthentik#6017. Looking through the files in there, it is clear that this line in the documentation is from before that point: https://github.com/goauthentik/authentik/blob/95e60a035df11d6f89db18cba3ae978d13d212b8/website/docs/user-group/group.md?plain=1#L15.

tl;dr: the documentation was correct before goauthentik#6017, but is now out of date. This change fixes that.

Signed-off-by: Zuri Klaschka <pklaschka@users.noreply.github.com>
@pklaschka pklaschka requested a review from a team as a code owner November 24, 2024 13:52
@netlify
Copy link

netlify bot commented Nov 24, 2024

Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 5f28c55
🔍 Latest deploy log https://app.netlify.com/sites/authentik-docs/deploys/67432f9881c6bf0008ec44a6
😎 Deploy Preview https://deploy-preview-12168--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 site configuration.

@netlify
Copy link

netlify bot commented Nov 24, 2024

Deploy Preview for authentik-storybook canceled.

Name Link
🔨 Latest commit 5f28c55
🔍 Latest deploy log https://app.netlify.com/sites/authentik-storybook/deploys/67432f9870fa3800084427e9

@tanberry
Copy link
Contributor

Thanks very much @pklaschka for this catch! And for the link to #6017.

We appreciate you helping us keep the Docs up-to-date!

@codecov
Copy link

codecov bot commented Nov 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.50%. Comparing base (3d5a189) to head (5f28c55).
Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12168      +/-   ##
==========================================
- Coverage   92.67%   92.50%   -0.17%     
==========================================
  Files         761      761              
  Lines       38025    38025              
==========================================
- Hits        35239    35175      -64     
- Misses       2786     2850      +64     
Flag Coverage Δ
e2e 48.65% <ø> (-0.52%) ⬇️
integration 24.83% <ø> (ø)
unit 90.21% <ø> (ø)

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

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

@tanberry tanberry merged commit 709e413 into goauthentik:main Nov 26, 2024
@pklaschka pklaschka deleted the patch-1 branch November 26, 2024 15:56
kensternberg-authentik added a commit that referenced this pull request Nov 26, 2024
* main:
  website/docs: Add note about single group per role (#12169)
  website/docs: Fix documentation about attribute merging for indirect membership (#12168)
  root: support running authentik in subpath (#8675)
  docs: fix contribution link (#12189)
  core, web: update translations (#12190)
  core: Bump msgraph-sdk from 1.12.0 to 1.13.0 (#12191)
  core: Bump selenium from 4.26.1 to 4.27.0 (#12192)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants