{"action":"created","comment":{"url":"https://api.github.com/repos/Mirantis/kqueen/pulls/comments/180763202","pull_request_review_id":111240456,"id":180763202,"diff_hunk":"@@ -15,38 +16,50 @@ def __init__(self, *args, **kwargs):\n         \"\"\"\n \n         super(LDAPAuth, self).__init__(*args, **kwargs)\n+        if not all(hasattr(self, attr) for attr in ['uri', 'admin_dn', 'password']):\n+            logger.error('Failed to configure LDAP synchronization error.')\n+            raise ImproperlyConfigured\n+\n+        # Define Kqueen rdn for all dc's\n+        dc_list = []","path":"kqueen/auth/ldap.py","position":17,"original_position":17,"commit_id":"d825f737ffcfd0b020d0bab1af332d57268dcc8a","original_commit_id":"d825f737ffcfd0b020d0bab1af332d57268dcc8a","user":{"login":"atengler","id":11465219,"avatar_url":"https://avatars2.githubusercontent.com/u/11465219?v=4","gravatar_id":"","url":"https://api.github.com/users/atengler","html_url":"https://github.com/atengler","followers_url":"https://api.github.com/users/atengler/followers","following_url":"https://api.github.com/users/atengler/following{/other_user}","gists_url":"https://api.github.com/users/atengler/gists{/gist_id}","starred_url":"https://api.github.com/users/atengler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atengler/subscriptions","organizations_url":"https://api.github.com/users/atengler/orgs","repos_url":"https://api.github.com/users/atengler/repos","events_url":"https://api.github.com/users/atengler/events{/privacy}","received_events_url":"https://api.github.com/users/atengler/received_events","type":"User","site_admin":false},"body":"Maybe replace this with something like:\r\n```\r\nd_names = ldap.dn.explode_dn(self.admin_dn)\r\ndc_list = [dc for dc in d_names if dc.startswith('dc=')\r\n```\r\nFeels a bit better and I don't really like using single letter variable names outside of generator like this\r\n","created_at":"2018-04-11T13:58:05Z","updated_at":"2018-04-11T14:03:27Z","html_url":"https://github.com/Mirantis/kqueen/pull/266#discussion_r180763202","pull_request_url":"https://api.github.com/repos/Mirantis/kqueen/pulls/266","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/Mirantis/kqueen/pulls/comments/180763202"},"html":{"href":"https://github.com/Mirantis/kqueen/pull/266#discussion_r180763202"},"pull_request":{"href":"https://api.github.com/repos/Mirantis/kqueen/pulls/266"}}},"pull_request":{"url":"https://api.github.com/repos/Mirantis/kqueen/pulls/266","id":180267097,"html_url":"https://github.com/Mirantis/kqueen/pull/266","diff_url":"https://github.com/Mirantis/kqueen/pull/266.diff","patch_url":"https://github.com/Mirantis/kqueen/pull/266.patch","issue_url":"https://api.github.com/repos/Mirantis/kqueen/issues/266","number":266,"state":"open","locked":false,"title":"Refactor Ldap Search-verify mechanism","user":{"login":"naumvd95","id":18596213,"avatar_url":"https://avatars2.githubusercontent.com/u/18596213?v=4","gravatar_id":"","url":"https://api.github.com/users/naumvd95","html_url":"https://github.com/naumvd95","followers_url":"https://api.github.com/users/naumvd95/followers","following_url":"https://api.github.com/users/naumvd95/following{/other_user}","gists_url":"https://api.github.com/users/naumvd95/gists{/gist_id}","starred_url":"https://api.github.com/users/naumvd95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naumvd95/subscriptions","organizations_url":"https://api.github.com/users/naumvd95/orgs","repos_url":"https://api.github.com/users/naumvd95/repos","events_url":"https://api.github.com/users/naumvd95/events{/privacy}","received_events_url":"https://api.github.com/users/naumvd95/received_events","type":"User","site_admin":false},"body":"    Refactor Ldap Search-verify mechanism\r\n\r\n    - Search by provided dn segments to get full dn\r\n    - possibility of adding full dn to user metadata\r\n    - logging\r\n    - docs updated\r\n    - env variables for read-only user for Ldap-search\r\n\r\n    Ldap-user adding scheme will be:\r\n\r\n    UI:\r\n    invite ldap user with cn 'kqueen'\r\n\r\n    API:\r\n    1. get dc's from predefined kqueen-ldap user\r\n    2. search in all OU by cn and dc's and paste all matched cases into list\r\n\r\n    UI:\r\n    try to enter login and text 'password'\r\n\r\n    API:\r\n    3. try to bind_s with list of mathced_dn and provided 'password'\r\n    4. in case of success, store valid full-dn into user-metadata, and re-use it without search-duplicating\r\n\r\n    P.s. afaik in LDAP user 'CN' should be absolutely equal.Its absolutely independent of OU,Posix groups.\r\n    Ldap doesnot allow to create users in diff groups with equal 'CN'. So , it's avoid us of several searching problems\r\nPAY ATTENTION:\r\nThis PR depends on UI changes related to Invite form improvement @katyafervent ","created_at":"2018-04-09T10:14:48Z","updated_at":"2018-04-11T14:03:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ab2f1db11a96447c40a13880b83701a9d44a994d","assignee":null,"assignees":[],"requested_reviewers":[{"login":"mikezuniga","id":1145658,"avatar_url":"https://avatars1.githubusercontent.com/u/1145658?v=4","gravatar_id":"","url":"https://api.github.com/users/mikezuniga","html_url":"https://github.com/mikezuniga","followers_url":"https://api.github.com/users/mikezuniga/followers","following_url":"https://api.github.com/users/mikezuniga/following{/other_user}","gists_url":"https://api.github.com/users/mikezuniga/gists{/gist_id}","starred_url":"https://api.github.com/users/mikezuniga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikezuniga/subscriptions","organizations_url":"https://api.github.com/users/mikezuniga/orgs","repos_url":"https://api.github.com/users/mikezuniga/repos","events_url":"https://api.github.com/users/mikezuniga/events{/privacy}","received_events_url":"https://api.github.com/users/mikezuniga/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":721349400,"url":"https://api.github.com/repos/Mirantis/kqueen/labels/WIP","name":"WIP","color":"f9e172","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Mirantis/kqueen/pulls/266/commits","review_comments_url":"https://api.github.com/repos/Mirantis/kqueen/pulls/266/comments","review_comment_url":"https://api.github.com/repos/Mirantis/kqueen/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Mirantis/kqueen/issues/266/comments","statuses_url":"https://api.github.com/repos/Mirantis/kqueen/statuses/d825f737ffcfd0b020d0bab1af332d57268dcc8a","head":{"label":"Mirantis:ldap-search","ref":"ldap-search","sha":"d825f737ffcfd0b020d0bab1af332d57268dcc8a","user":{"login":"Mirantis","id":609319,"avatar_url":"https://avatars2.githubusercontent.com/u/609319?v=4","gravatar_id":"","url":"https://api.github.com/users/Mirantis","html_url":"https://github.com/Mirantis","followers_url":"https://api.github.com/users/Mirantis/followers","following_url":"https://api.github.com/users/Mirantis/following{/other_user}","gists_url":"https://api.github.com/users/Mirantis/gists{/gist_id}","starred_url":"https://api.github.com/users/Mirantis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mirantis/subscriptions","organizations_url":"https://api.github.com/users/Mirantis/orgs","repos_url":"https://api.github.com/users/Mirantis/repos","events_url":"https://api.github.com/users/Mirantis/events{/privacy}","received_events_url":"https://api.github.com/users/Mirantis/received_events","type":"Organization","site_admin":false},"repo":{"id":104763063,"name":"kqueen","full_name":"Mirantis/kqueen","owner":{"login":"Mirantis","id":609319,"avatar_url":"https://avatars2.githubusercontent.com/u/609319?v=4","gravatar_id":"","url":"https://api.github.com/users/Mirantis","html_url":"https://github.com/Mirantis","followers_url":"https://api.github.com/users/Mirantis/followers","following_url":"https://api.github.com/users/Mirantis/following{/other_user}","gists_url":"https://api.github.com/users/Mirantis/gists{/gist_id}","starred_url":"https://api.github.com/users/Mirantis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mirantis/subscriptions","organizations_url":"https://api.github.com/users/Mirantis/orgs","repos_url":"https://api.github.com/users/Mirantis/repos","events_url":"https://api.github.com/users/Mirantis/events{/privacy}","received_events_url":"https://api.github.com/users/Mirantis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Mirantis/kqueen","description":"Kubernetes queen - cluster manager","fork":false,"url":"https://api.github.com/repos/Mirantis/kqueen","forks_url":"https://api.github.com/repos/Mirantis/kqueen/forks","keys_url":"https://api.github.com/repos/Mirantis/kqueen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Mirantis/kqueen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Mirantis/kqueen/teams","hooks_url":"https://api.github.com/repos/Mirantis/kqueen/hooks","issue_events_url":"https://api.github.com/repos/Mirantis/kqueen/issues/events{/number}","events_url":"https://api.github.com/repos/Mirantis/kqueen/events","assignees_url":"https://api.github.com/repos/Mirantis/kqueen/assignees{/user}","branches_url":"https://api.github.com/repos/Mirantis/kqueen/branches{/branch}","tags_url":"https://api.github.com/repos/Mirantis/kqueen/tags","blobs_url":"https://api.github.com/repos/Mirantis/kqueen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Mirantis/kqueen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Mirantis/kqueen/git/refs{/sha}","trees_url":"https://api.github.com/repos/Mirantis/kqueen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Mirantis/kqueen/statuses/{sha}","languages_url":"https://api.github.com/repos/Mirantis/kqueen/languages","stargazers_url":"https://api.github.com/repos/Mirantis/kqueen/stargazers","contributors_url":"https://api.github.com/repos/Mirantis/kqueen/contributors","subscribers_url":"https://api.github.com/repos/Mirantis/kqueen/subscribers","subscription_url":"https://api.github.com/repos/Mirantis/kqueen/subscription","commits_url":"https://api.github.com/repos/Mirantis/kqueen/commits{/sha}","git_commits_url":"https://api.github.com/repos/Mirantis/kqueen/git/commits{/sha}","comments_url":"https://api.github.com/repos/Mirantis/kqueen/comments{/number}","issue_comment_url":"https://api.github.com/repos/Mirantis/kqueen/issues/comments{/number}","contents_url":"https://api.github.com/repos/Mirantis/kqueen/contents/{+path}","compare_url":"https://api.github.com/repos/Mirantis/kqueen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Mirantis/kqueen/merges","archive_url":"https://api.github.com/repos/Mirantis/kqueen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Mirantis/kqueen/downloads","issues_url":"https://api.github.com/repos/Mirantis/kqueen/issues{/number}","pulls_url":"https://api.github.com/repos/Mirantis/kqueen/pulls{/number}","milestones_url":"https://api.github.com/repos/Mirantis/kqueen/milestones{/number}","notifications_url":"https://api.github.com/repos/Mirantis/kqueen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Mirantis/kqueen/labels{/name}","releases_url":"https://api.github.com/repos/Mirantis/kqueen/releases{/id}","deployments_url":"https://api.github.com/repos/Mirantis/kqueen/deployments","created_at":"2017-09-25T14:47:07Z","updated_at":"2018-04-06T10:30:55Z","pushed_at":"2018-04-11T09:09:33Z","git_url":"git://github.com/Mirantis/kqueen.git","ssh_url":"git@github.com:Mirantis/kqueen.git","clone_url":"https://github.com/Mirantis/kqueen.git","svn_url":"https://github.com/Mirantis/kqueen","homepage":"","size":2916,"stargazers_count":37,"watchers_count":37,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":19,"mirror_url":null,"archived":false,"open_issues_count":25,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":19,"open_issues":25,"watchers":37,"default_branch":"master"}},"base":{"label":"Mirantis:master","ref":"master","sha":"7191e0d679a8f5d03af78c134e65454b1c5ef7b0","user":{"login":"Mirantis","id":609319,"avatar_url":"https://avatars2.githubusercontent.com/u/609319?v=4","gravatar_id":"","url":"https://api.github.com/users/Mirantis","html_url":"https://github.com/Mirantis","followers_url":"https://api.github.com/users/Mirantis/followers","following_url":"https://api.github.com/users/Mirantis/following{/other_user}","gists_url":"https://api.github.com/users/Mirantis/gists{/gist_id}","starred_url":"https://api.github.com/users/Mirantis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mirantis/subscriptions","organizations_url":"https://api.github.com/users/Mirantis/orgs","repos_url":"https://api.github.com/users/Mirantis/repos","events_url":"https://api.github.com/users/Mirantis/events{/privacy}","received_events_url":"https://api.github.com/users/Mirantis/received_events","type":"Organization","site_admin":false},"repo":{"id":104763063,"name":"kqueen","full_name":"Mirantis/kqueen","owner":{"login":"Mirantis","id":609319,"avatar_url":"https://avatars2.githubusercontent.com/u/609319?v=4","gravatar_id":"","url":"https://api.github.com/users/Mirantis","html_url":"https://github.com/Mirantis","followers_url":"https://api.github.com/users/Mirantis/followers","following_url":"https://api.github.com/users/Mirantis/following{/other_user}","gists_url":"https://api.github.com/users/Mirantis/gists{/gist_id}","starred_url":"https://api.github.com/users/Mirantis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mirantis/subscriptions","organizations_url":"https://api.github.com/users/Mirantis/orgs","repos_url":"https://api.github.com/users/Mirantis/repos","events_url":"https://api.github.com/users/Mirantis/events{/privacy}","received_events_url":"https://api.github.com/users/Mirantis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Mirantis/kqueen","description":"Kubernetes queen - cluster manager","fork":false,"url":"https://api.github.com/repos/Mirantis/kqueen","forks_url":"https://api.github.com/repos/Mirantis/kqueen/forks","keys_url":"https://api.github.com/repos/Mirantis/kqueen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Mirantis/kqueen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Mirantis/kqueen/teams","hooks_url":"https://api.github.com/repos/Mirantis/kqueen/hooks","issue_events_url":"https://api.github.com/repos/Mirantis/kqueen/issues/events{/number}","events_url":"https://api.github.com/repos/Mirantis/kqueen/events","assignees_url":"https://api.github.com/repos/Mirantis/kqueen/assignees{/user}","branches_url":"https://api.github.com/repos/Mirantis/kqueen/branches{/branch}","tags_url":"https://api.github.com/repos/Mirantis/kqueen/tags","blobs_url":"https://api.github.com/repos/Mirantis/kqueen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Mirantis/kqueen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Mirantis/kqueen/git/refs{/sha}","trees_url":"https://api.github.com/repos/Mirantis/kqueen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Mirantis/kqueen/statuses/{sha}","languages_url":"https://api.github.com/repos/Mirantis/kqueen/languages","stargazers_url":"https://api.github.com/repos/Mirantis/kqueen/stargazers","contributors_url":"https://api.github.com/repos/Mirantis/kqueen/contributors","subscribers_url":"https://api.github.com/repos/Mirantis/kqueen/subscribers","subscription_url":"https://api.github.com/repos/Mirantis/kqueen/subscription","commits_url":"https://api.github.com/repos/Mirantis/kqueen/commits{/sha}","git_commits_url":"https://api.github.com/repos/Mirantis/kqueen/git/commits{/sha}","comments_url":"https://api.github.com/repos/Mirantis/kqueen/comments{/number}","issue_comment_url":"https://api.github.com/repos/Mirantis/kqueen/issues/comments{/number}","contents_url":"https://api.github.com/repos/Mirantis/kqueen/contents/{+path}","compare_url":"https://api.github.com/repos/Mirantis/kqueen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Mirantis/kqueen/merges","archive_url":"https://api.github.com/repos/Mirantis/kqueen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Mirantis/kqueen/downloads","issues_url":"https://api.github.com/repos/Mirantis/kqueen/issues{/number}","pulls_url":"https://api.github.com/repos/Mirantis/kqueen/pulls{/number}","milestones_url":"https://api.github.com/repos/Mirantis/kqueen/milestones{/number}","notifications_url":"https://api.github.com/repos/Mirantis/kqueen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Mirantis/kqueen/labels{/name}","releases_url":"https://api.github.com/repos/Mirantis/kqueen/releases{/id}","deployments_url":"https://api.github.com/repos/Mirantis/kqueen/deployments","created_at":"2017-09-25T14:47:07Z","updated_at":"2018-04-06T10:30:55Z","pushed_at":"2018-04-11T09:09:33Z","git_url":"git://github.com/Mirantis/kqueen.git","ssh_url":"git@github.com:Mirantis/kqueen.git","clone_url":"https://github.com/Mirantis/kqueen.git","svn_url":"https://github.com/Mirantis/kqueen","homepage":"","size":2916,"stargazers_count":37,"watchers_count":37,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":19,"mirror_url":null,"archived":false,"open_issues_count":25,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":19,"open_issues":25,"watchers":37,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Mirantis/kqueen/pulls/266"},"html":{"href":"https://github.com/Mirantis/kqueen/pull/266"},"issue":{"href":"https://api.github.com/repos/Mirantis/kqueen/issues/266"},"comments":{"href":"https://api.github.com/repos/Mirantis/kqueen/issues/266/comments"},"review_comments":{"href":"https://api.github.com/repos/Mirantis/kqueen/pulls/266/comments"},"review_comment":{"href":"https://api.github.com/repos/Mirantis/kqueen/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Mirantis/kqueen/pulls/266/commits"},"statuses":{"href":"https://api.github.com/repos/Mirantis/kqueen/statuses/d825f737ffcfd0b020d0bab1af332d57268dcc8a"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"atengler"}}