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

Import LDAP group types #1154

Closed
Exhei opened this issue Nov 24, 2023 · 4 comments · Fixed by #1157
Closed

Import LDAP group types #1154

Exhei opened this issue Nov 24, 2023 · 4 comments · Fixed by #1157
Labels
bug Something isn't working

Comments

@Exhei
Copy link

Exhei commented Nov 24, 2023

Is your feature request related to a problem? Please describe.
I am trying to configure groups for LDAP configuration done through k8s secret resource. The only group supported at the moment is the PosixGroupType. This really affects the permission and role assignment for LDAP. It can be more efficiently and effectively iterated through groups. If you assign 100 member a specific permission one doesn't have to go through all 100 members one by one but rather target the group they are part of in the LDAP tree.

Describe the solution you'd like
Import to settings.py all the LDAP group types:
https://django-auth-ldap.readthedocs.io/en/latest/reference.html#django_auth_ldap.config.MemberDNGroupType
https://django-auth-ldap.readthedocs.io/en/latest/reference.html#django_auth_ldap.config.NestedMemberDNGroupType

and subgroups:
https://django-auth-ldap.readthedocs.io/en/latest/reference.html#django_auth_ldap.config.GroupOfNamesType
https://django-auth-ldap.readthedocs.io/en/latest/reference.html#django_auth_ldap.config.NestedGroupOfNamesType
https://django-auth-ldap.readthedocs.io/en/latest/reference.html#django_auth_ldap.config.GroupOfUniqueNamesType
https://django-auth-ldap.readthedocs.io/en/latest/reference.html#django_auth_ldap.config.NestedGroupOfUniqueNamesType
https://django-auth-ldap.readthedocs.io/en/latest/reference.html#django_auth_ldap.config.ActiveDirectoryGroupType
https://django-auth-ldap.readthedocs.io/en/latest/reference.html#django_auth_ldap.config.NestedActiveDirectoryGroupType
https://django-auth-ldap.readthedocs.io/en/latest/reference.html#django_auth_ldap.config.OrganizationalRoleGroupType
https://django-auth-ldap.readthedocs.io/en/latest/reference.html#django_auth_ldap.config.NestedOrganizationalRoleGroupType

File "/usr/local/lib/python3.8/site-packages/dynaconf/loaders/py_loader.py", line 146, in import_from_filename exec(compile(config_file.read(), filename, "exec"), mod.__dict__) File "/etc/pulp/settings.py", line 56, in <module> AUTH_LDAP_GROUP_TYPE = ActiveDirectoryGroupType(name_attr='cn') NameError: name 'ActiveDirectoryGroupType' is not defined

@git-hyagi
Copy link
Collaborator

Thank you for opening this issue.
As of now, we are not importing all functions from django-auth-ldap which is causing the exception:

from django_auth_ldap.config import LDAPSearch, PosixGroupType

I'm working on this issue right now, but it will take some time to release a fix because I would like to also work on #1124 and release them together.

@git-hyagi git-hyagi added bug Something isn't working and removed Feature Triage-Needed labels Nov 27, 2023
@Exhei
Copy link
Author

Exhei commented Nov 27, 2023

@git-hyagi

Thank you for the prompt response and for actively working on this issue along with #1124. I understand that these improvements take time, and I truly appreciate your efforts. Is there any estimated timeframe for the fix ?

Your guidance on when we might expect a release would be helpful for planning purposes. If there's anything I can do to help expedite the process—whether it's testing, providing more details—please let me know.

Thanks again for your time and the solution you provided in Element :)

@git-hyagi
Copy link
Collaborator

git-hyagi commented Nov 27, 2023

Is there any estimated timeframe for the fix ?

Hum ... since it seems that it is somehow holding you, I'll open a PR until the end of the day with the possible fix first and then work on the CI update in another PR.

If there's anything I can do to help expedite the process—whether it's testing, providing more details—please let me know.

If you could test the PR (whenever I open it) it would be awesome!

Thank you for letting us know about this issue!

git-hyagi added a commit to git-hyagi/pulp-operator that referenced this issue Nov 27, 2023
@Denney-tech
Copy link
Contributor

Nice! I just manually made my own changes to the settings.py file to have all the ldap group_types available, this PR is a welcome change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants