goauthentik / authentik

The authentication glue you need.
https://goauthentik.io
Other
13.67k stars 915 forks source link

Extend management commands to support "targeted" LDAP sync #12134

Open Puschek opened 16 hours ago

Puschek commented 16 hours ago

Is your feature request related to a problem? Please describe. Authentik provides Django management commands for triggering an LDAP sync (implementend in authentik/sources/ldap/management/commands/ldap_sync.py). These can only trigger a full sync of the whole directory (which can take hours).

Describe the solution you'd like The ideal solution would be to extend the ak ldap_sync - Command with parameters like $USER or $GROUP which triggers a limited sync of a specific user/group.

Describe alternatives you've considered To not change a lot of code, another idea would be to have a script which creates a new LDAP source with a specific user or group bind to be synct and delete this source after the process.

Additional context I would contribute this feature, since it is needed for our organization. Just wanted to know if I should consider to create a Pull Request for our implemented solution or not. As for as I can see, getting the ldap_sync to work with a single user or group isn't a small or trivial task, so I came up with a 'easier' solution.