Skip to content
This repository has been archived by the owner on Oct 26, 2021. It is now read-only.

Support for aliases #2

Merged
merged 6 commits into from Dec 21, 2016
Merged

Support for aliases #2

merged 6 commits into from Dec 21, 2016

Conversation

jdow
Copy link
Contributor

@jdow jdow commented Nov 10, 2016

Please review and check my logic on this. Before, the script would look at any auth0 accounts that came from the LDAP connection and then check whether they still exist in LDAP and block if not.

The new logic is instead to look at any accounts where the e-mail address is in our list of ldap-managed e-mail domains and if found, then first check if there's a canonical account that matches, if not, check for any aliases that match, finally if not found, then block the account in auth0.

This doesn't handle non-employee LDAP accounts at all, but I added the identities to the api call, so that can be parsed and added as a separate function. I want to get a review on what I have so far and make sure the logic is sound before proceeding.

@@ -26,7 +26,8 @@ def list_all_users():
should_return = False
return_list = []
fetch_url = "%s/users" % auth0_config['auth0_api_url']
payload = {'connection': "%s" % auth0_config['auth0_connection'], 'fields': 'user_id,email,blocked', 'include_fields': 'true'}
# payload = {'connection': "%s" % auth0_config['auth0_connection'], 'fields': 'user_id,email,blocked', 'include_fields': 'true'}
Copy link
Contributor

Choose a reason for hiding this comment

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

no commented out code =)

@@ -132,12 +137,14 @@ def main(prog_args=None):
print "Cannot get id attribute for user"
Copy link
Contributor

Choose a reason for hiding this comment

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

wont the code fail here, if id is not defined/defined to last value from previous loop?
(also just noticed: id is a reserved python var, should use another name)

Copy link
Contributor

@gdestuynder gdestuynder left a comment

Choose a reason for hiding this comment

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

while there's still some outstanding issues, script works reasonably well - we can move these to issue requests (error reporting, unit testing, style)

@gdestuynder gdestuynder merged commit 3c0fe76 into mozilla-iam:master Dec 21, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants