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

Allow SAML_USERS_LOOKUP_ATTRIBUTE[1] to be callable #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Neitsch
Copy link

@Neitsch Neitsch commented Apr 17, 2021

Implements my request from #44 . SAML_USERS_LOOKUP_ATTRIBUTE[1] can now be a callable. That allows to construct more complex values for the user id based on multiple attributes if needed.

Unfortunately no tests cover this part of the code.

@Neitsch Neitsch changed the title Allow v[1] to be callable Allow SAML_USERS_LOOKUP_ATTRIBUTE[1] to be callable Apr 17, 2021
Copy link
Member

@shepdelacreme shepdelacreme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty straightforward. I left a few comments. Can you add some documentation around the callable and how to use this?

else:
lookup_map = {lookup_attr[0]: final_map[lookup_attr[1]]}
final_map[lookup_val]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be assigning final_map[lookup_val] to lookup_res?

if lookup_val == "NameId":
lookup_res = saml_auth.get_nameid()
elif callable(lookup_val):
lookup_res = lookup_val(saml_auth, final_map)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the callable will have a standard signature. Can we get this documented and an example added for how to use this?

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.

None yet

2 participants