Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

source/ldap: lookup group memberships from user attribute #12661

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

krejcar25
Copy link

@krejcar25 krejcar25 commented Jan 13, 2025

Details

This MR implements lookups of group memberships from user attributes as an option alternative to lookups from group attributes. This also allows for nested group lookups in Active Directory using the :1.2.840.113556.1.4.1941: string.

Implements #3879

Some code taken from shawnweeks/authentik, originally submitted as #3936.


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)

@krejcar25 krejcar25 requested review from a team as code owners January 13, 2025 21:39
Copy link

netlify bot commented Jan 13, 2025

Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit b2d2cac
🔍 Latest deploy log https://app.netlify.com/sites/authentik-docs/deploys/6793a78c41d2ea00082f4e12
😎 Deploy Preview https://deploy-preview-12661--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.

Copy link

netlify bot commented Jan 13, 2025

Deploy Preview for authentik-storybook canceled.

Name Link
🔨 Latest commit b2d2cac
🔍 Latest deploy log https://app.netlify.com/sites/authentik-storybook/deploys/6793a78cb669160008646b05

@krejcar25 krejcar25 changed the title Feature/source ldap lookup groups from user source/ldap: lookup group memberships from user attribute Jan 14, 2025
@krejcar25 krejcar25 force-pushed the feature/source_ldap_lookup_groups_from_user branch from 603a728 to a6dfbcb Compare January 14, 2025 09:03
@krejcar25
Copy link
Author

Force-pushed to add PGP signature.

@krejcar25 krejcar25 force-pushed the feature/source_ldap_lookup_groups_from_user branch from c98ec42 to 96c44c6 Compare January 16, 2025 08:27
Copy link

codecov bot commented Jan 20, 2025

Codecov Report

Attention: Patch coverage is 46.66667% with 8 lines in your changes missing coverage. Please review.

Project coverage is 92.76%. Comparing base (9eef9ee) to head (9bc6141).

Files with missing lines Patch % Lines
authentik/sources/ldap/sync/membership.py 42.85% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12661      +/-   ##
==========================================
+ Coverage   92.70%   92.76%   +0.05%     
==========================================
  Files         769      769              
  Lines       38898    38910      +12     
==========================================
+ Hits        36062    36093      +31     
+ Misses       2836     2817      -19     
Flag Coverage Δ
e2e 48.63% <46.66%> (+0.13%) ⬆️
integration 24.62% <6.66%> (-0.01%) ⬇️
unit 90.38% <46.66%> (-0.02%) ⬇️

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.

@krejcar25
Copy link
Author

I just rechecked lint and web&website generation, all makes pass. I am however unsure how to improve the tests on this, I sadly don't understand the tests used too much, after attempting to read the current code for testing group sync. I would appreciate help with testing this.

…tory/index.md

Co-authored-by: Tana M Berry <[email protected]>
Signed-off-by: Amélie Krejčí <[email protected]>
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.

3 participants