Repository navigation
sources/ldap: Switch to new connection tracking, deprecated attribute-based connection - #21392
Conversation
Signed-off-by: Jens Langhammer <[email protected]>
Signed-off-by: Jens Langhammer <[email protected]>
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #21392 +/- ##
=======================================
Coverage 92.62% 92.63%
=======================================
Files 1016 1018 +2
Lines 58378 58458 +80
Branches 1494 1494
=======================================
+ Hits 54075 54153 +78
- Misses 4263 4267 +4
+ Partials 40 38 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
authentik PR Installation instructions Instructions for docker-composeAdd the following block to your AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-f586e1e586de800fbb1c7b47b86be9150b852b15
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-f586e1e586de800fbb1c7b47b86be9150b852b15Afterwards, run the upgrade commands from the latest release notes. |
Signed-off-by: Jens Langhammer <[email protected]>
Signed-off-by: Jens Langhammer <[email protected]>
Signed-off-by: Jens Langhammer <[email protected]>
Signed-off-by: Jens Langhammer <[email protected]>
Signed-off-by: Jens Langhammer <[email protected]>
Signed-off-by: Jens Langhammer <[email protected]>
✅ Deploy Preview for authentik-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Signed-off-by: Jens Langhammer <[email protected]>
Signed-off-by: Jens Langhammer <[email protected]>
Signed-off-by: Jens Langhammer <[email protected]>
Signed-off-by: Jens Langhammer <[email protected]>
Signed-off-by: Jens Langhammer <[email protected]>
✅ Deploy Preview for authentik-integrations ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Signed-off-by: Jens Langhammer <[email protected]>
Signed-off-by: Jens Langhammer <[email protected]>
Signed-off-by: Jens Langhammer <[email protected]>
| @@ -0,0 +1,87 @@ | |||
| import "#elements/forms/DeleteBulkForm"; | |||
There was a problem hiding this comment.
I think this is something we want to do for all sources actually.
There was a problem hiding this comment.
well, we kinda do, ish
for sources like kerberos/ldap/scim it makes sense to have here, but for OAuth/SAML I think it makes more sense on the individual users' page? or Maybe both I suppose
There was a problem hiding this comment.
Yeah probably both for all sources
rissson
left a comment
There was a problem hiding this comment.
overall looks good, I haven't read the tests though.
| groups = GroupLDAPSourceConnection.objects.filter(identifier=group_uniq).select_related( | ||
| "group" | ||
| ) | ||
| if not groups.exists(): | ||
| if self._source.sync_groups: | ||
| self._task.info( | ||
| f"Group does not exist in our DB yet, run sync_groups first: '{group_dn}'", | ||
| group=group_dn, | ||
| ) | ||
| return None | ||
| self.group_cache[group_uniq] = groups.first() | ||
| self.group_cache[group_uniq] = groups.first().group |
There was a problem hiding this comment.
| groups = GroupLDAPSourceConnection.objects.filter(identifier=group_uniq).select_related( | |
| "group" | |
| ) | |
| if not groups.exists(): | |
| if self._source.sync_groups: | |
| self._task.info( | |
| f"Group does not exist in our DB yet, run sync_groups first: '{group_dn}'", | |
| group=group_dn, | |
| ) | |
| return None | |
| self.group_cache[group_uniq] = groups.first() | |
| self.group_cache[group_uniq] = groups.first().group | |
| group_source_connection = GroupLDAPSourceConnection.objects.filter(identifier=group_uniq).select_related( | |
| "group" | |
| ).first() | |
| if group_source_connection is None: | |
| if self._source.sync_groups: | |
| self._task.info( | |
| f"Group does not exist in our DB yet, run sync_groups first: '{group_dn}'", | |
| group=group_dn, | |
| ) | |
| return None | |
| self.group_cache[group_uniq] = group_source_connection.group |
saves a db query, but this is really nitpicking at this point
…-based connection (goauthentik#21392) * init user Signed-off-by: Jens Langhammer <[email protected]> * fix and update groups Signed-off-by: Jens Langhammer <[email protected]> * split api Signed-off-by: Jens Langhammer <[email protected]> * include user and group in ldap conn Signed-off-by: Jens Langhammer <[email protected]> * unrelated cleanup Signed-off-by: Jens Langhammer <[email protected]> * add ldap users/groups page Signed-off-by: Jens Langhammer <[email protected]> * ui cleanup Signed-off-by: Jens Langhammer <[email protected]> * fixup Signed-off-by: Jens Langhammer <[email protected]> * update error message Signed-off-by: Jens Langhammer <[email protected]> * fix import Signed-off-by: Jens Langhammer <[email protected]> * add forms for user/group connections Signed-off-by: Jens Langhammer <[email protected]> * fix py sync Signed-off-by: Jens Langhammer <[email protected]> * fixup web Signed-off-by: Jens Langhammer <[email protected]> * fix connection not always saved Signed-off-by: Jens Langhammer <[email protected]> * more tests Signed-off-by: Jens Langhammer <[email protected]> * fix help text Signed-off-by: Jens Langhammer <[email protected]> --------- Signed-off-by: Jens Langhammer <[email protected]>
…-based connection (goauthentik#21392) * init user Signed-off-by: Jens Langhammer <[email protected]> * fix and update groups Signed-off-by: Jens Langhammer <[email protected]> * split api Signed-off-by: Jens Langhammer <[email protected]> * include user and group in ldap conn Signed-off-by: Jens Langhammer <[email protected]> * unrelated cleanup Signed-off-by: Jens Langhammer <[email protected]> * add ldap users/groups page Signed-off-by: Jens Langhammer <[email protected]> * ui cleanup Signed-off-by: Jens Langhammer <[email protected]> * fixup Signed-off-by: Jens Langhammer <[email protected]> * update error message Signed-off-by: Jens Langhammer <[email protected]> * fix import Signed-off-by: Jens Langhammer <[email protected]> * add forms for user/group connections Signed-off-by: Jens Langhammer <[email protected]> * fix py sync Signed-off-by: Jens Langhammer <[email protected]> * fixup web Signed-off-by: Jens Langhammer <[email protected]> * fix connection not always saved Signed-off-by: Jens Langhammer <[email protected]> * more tests Signed-off-by: Jens Langhammer <[email protected]> * fix help text Signed-off-by: Jens Langhammer <[email protected]> --------- Signed-off-by: Jens Langhammer <[email protected]>
this is a requirement for #19069
We've been tracking user/group-source connections with proper connection objects since 7fd35b1 (#13796), but we still use
ldap_uniqin the attributes of the user/group to match users for sync.This switches the logic around to use the connection object first, with a fallback for the old setup (this shouldn't really occur). The goal is to eventually get rid of the
LDAP_UNIQUENESSconstant.This also contains the UI to show user/group connections and the ability to create those connections manually, mainly so we can adjust the error message to point to that new form, instead of the old attribute.
cc @krejcar25