{"action":"created","comment":{"url":"https://api.github.com/repos/portainer/portainer/pulls/comments/213110382","pull_request_review_id":149878359,"id":213110382,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMzExMDM4Mg==","diff_hunk":"@@ -161,6 +164,14 @@ func getGroups(userDN string, conn *ldap.Conn, settings []portainer.LDAPGroupSea\n \treturn groups\n }\n \n+func escapeADFilterCharacters(str string) string {","path":"api/ldap/ldap.go","position":null,"original_position":34,"commit_id":"074b64bfce2c6f927383b184e4a966ad97307eb0","original_commit_id":"25eca7d4d453a1090f35f7fab31b216a6df520c6","user":{"login":"lukaspj","id":2369614,"node_id":"MDQ6VXNlcjIzNjk2MTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/2369614?v=4","gravatar_id":"","url":"https://api.github.com/users/lukaspj","html_url":"https://github.com/lukaspj","followers_url":"https://api.github.com/users/lukaspj/followers","following_url":"https://api.github.com/users/lukaspj/following{/other_user}","gists_url":"https://api.github.com/users/lukaspj/gists{/gist_id}","starred_url":"https://api.github.com/users/lukaspj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukaspj/subscriptions","organizations_url":"https://api.github.com/users/lukaspj/orgs","repos_url":"https://api.github.com/users/lukaspj/repos","events_url":"https://api.github.com/users/lukaspj/events{/privacy}","received_events_url":"https://api.github.com/users/lukaspj/received_events","type":"User","site_admin":false},"body":"Definetly, in my fight with the editor / getting the code compiling I forgot to RTFM.\r\n\r\nI have created a new commit instead of the old one, which uses ldap.EscapeFilter instead of the custom function.","created_at":"2018-08-27T20:48:52Z","updated_at":"2018-08-27T20:48:52Z","html_url":"https://github.com/portainer/portainer/pull/2209#discussion_r213110382","pull_request_url":"https://api.github.com/repos/portainer/portainer/pulls/2209","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/portainer/portainer/pulls/comments/213110382"},"html":{"href":"https://github.com/portainer/portainer/pull/2209#discussion_r213110382"},"pull_request":{"href":"https://api.github.com/repos/portainer/portainer/pulls/2209"}},"in_reply_to_id":213092705},"pull_request":{"url":"https://api.github.com/repos/portainer/portainer/pulls/2209","id":210538639,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEwNTM4NjM5","html_url":"https://github.com/portainer/portainer/pull/2209","diff_url":"https://github.com/portainer/portainer/pull/2209.diff","patch_url":"https://github.com/portainer/portainer/pull/2209.patch","issue_url":"https://api.github.com/repos/portainer/portainer/issues/2209","number":2209,"state":"open","locked":false,"title":"fix(authentication): escape LDAP filters","user":{"login":"lukaspj","id":2369614,"node_id":"MDQ6VXNlcjIzNjk2MTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/2369614?v=4","gravatar_id":"","url":"https://api.github.com/users/lukaspj","html_url":"https://github.com/lukaspj","followers_url":"https://api.github.com/users/lukaspj/followers","following_url":"https://api.github.com/users/lukaspj/following{/other_user}","gists_url":"https://api.github.com/users/lukaspj/gists{/gist_id}","starred_url":"https://api.github.com/users/lukaspj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukaspj/subscriptions","organizations_url":"https://api.github.com/users/lukaspj/orgs","repos_url":"https://api.github.com/users/lukaspj/repos","events_url":"https://api.github.com/users/lukaspj/events{/privacy}","received_events_url":"https://api.github.com/users/lukaspj/received_events","type":"User","site_admin":false},"body":"Hi guys,\r\n\r\nThis seeks to solve #2177 \r\n\r\nLDAP filters need to be escaped when run against an AD backend.\r\n\r\nThis PR does simple string replace of a few possible characters, in order to allow those in the user CN.\r\n\r\n**NB:** I'm fairly new to the various Go tools, and I couldn't make GoLand understand the .godir file, so I haven't been able to actually compile this code. You should probably be very skeptic of this code.\r\n\r\nUnfortunately, I'm short on time due to work and I really want to use Portainer at my work, so I wanted to do my best to fix this issue.\r\nIf nothing else it might serve as a base for someone else to pick this up.\r\n\r\n_Thanks for an awesome project!_","created_at":"2018-08-23T18:37:03Z","updated_at":"2018-08-27T20:48:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"26b1fc250b36f580f3b858981d02eea7b79eaa51","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":476594704,"node_id":"MDU6TGFiZWw0NzY1OTQ3MDQ=","url":"https://api.github.com/repos/portainer/portainer/labels/contrib/tech-review-in-progress","name":"contrib/tech-review-in-progress","color":"d4c5f9","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/portainer/portainer/pulls/2209/commits","review_comments_url":"https://api.github.com/repos/portainer/portainer/pulls/2209/comments","review_comment_url":"https://api.github.com/repos/portainer/portainer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/portainer/portainer/issues/2209/comments","statuses_url":"https://api.github.com/repos/portainer/portainer/statuses/074b64bfce2c6f927383b184e4a966ad97307eb0","head":{"label":"lukaspj:fix2177-escape-ldap-filters","ref":"fix2177-escape-ldap-filters","sha":"074b64bfce2c6f927383b184e4a966ad97307eb0","user":{"login":"lukaspj","id":2369614,"node_id":"MDQ6VXNlcjIzNjk2MTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/2369614?v=4","gravatar_id":"","url":"https://api.github.com/users/lukaspj","html_url":"https://github.com/lukaspj","followers_url":"https://api.github.com/users/lukaspj/followers","following_url":"https://api.github.com/users/lukaspj/following{/other_user}","gists_url":"https://api.github.com/users/lukaspj/gists{/gist_id}","starred_url":"https://api.github.com/users/lukaspj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukaspj/subscriptions","organizations_url":"https://api.github.com/users/lukaspj/orgs","repos_url":"https://api.github.com/users/lukaspj/repos","events_url":"https://api.github.com/users/lukaspj/events{/privacy}","received_events_url":"https://api.github.com/users/lukaspj/received_events","type":"User","site_admin":false},"repo":{"id":145892506,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU4OTI1MDY=","name":"portainer","full_name":"lukaspj/portainer","owner":{"login":"lukaspj","id":2369614,"node_id":"MDQ6VXNlcjIzNjk2MTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/2369614?v=4","gravatar_id":"","url":"https://api.github.com/users/lukaspj","html_url":"https://github.com/lukaspj","followers_url":"https://api.github.com/users/lukaspj/followers","following_url":"https://api.github.com/users/lukaspj/following{/other_user}","gists_url":"https://api.github.com/users/lukaspj/gists{/gist_id}","starred_url":"https://api.github.com/users/lukaspj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukaspj/subscriptions","organizations_url":"https://api.github.com/users/lukaspj/orgs","repos_url":"https://api.github.com/users/lukaspj/repos","events_url":"https://api.github.com/users/lukaspj/events{/privacy}","received_events_url":"https://api.github.com/users/lukaspj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lukaspj/portainer","description":"Simple management UI for Docker","fork":true,"url":"https://api.github.com/repos/lukaspj/portainer","forks_url":"https://api.github.com/repos/lukaspj/portainer/forks","keys_url":"https://api.github.com/repos/lukaspj/portainer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lukaspj/portainer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lukaspj/portainer/teams","hooks_url":"https://api.github.com/repos/lukaspj/portainer/hooks","issue_events_url":"https://api.github.com/repos/lukaspj/portainer/issues/events{/number}","events_url":"https://api.github.com/repos/lukaspj/portainer/events","assignees_url":"https://api.github.com/repos/lukaspj/portainer/assignees{/user}","branches_url":"https://api.github.com/repos/lukaspj/portainer/branches{/branch}","tags_url":"https://api.github.com/repos/lukaspj/portainer/tags","blobs_url":"https://api.github.com/repos/lukaspj/portainer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lukaspj/portainer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lukaspj/portainer/git/refs{/sha}","trees_url":"https://api.github.com/repos/lukaspj/portainer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lukaspj/portainer/statuses/{sha}","languages_url":"https://api.github.com/repos/lukaspj/portainer/languages","stargazers_url":"https://api.github.com/repos/lukaspj/portainer/stargazers","contributors_url":"https://api.github.com/repos/lukaspj/portainer/contributors","subscribers_url":"https://api.github.com/repos/lukaspj/portainer/subscribers","subscription_url":"https://api.github.com/repos/lukaspj/portainer/subscription","commits_url":"https://api.github.com/repos/lukaspj/portainer/commits{/sha}","git_commits_url":"https://api.github.com/repos/lukaspj/portainer/git/commits{/sha}","comments_url":"https://api.github.com/repos/lukaspj/portainer/comments{/number}","issue_comment_url":"https://api.github.com/repos/lukaspj/portainer/issues/comments{/number}","contents_url":"https://api.github.com/repos/lukaspj/portainer/contents/{+path}","compare_url":"https://api.github.com/repos/lukaspj/portainer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lukaspj/portainer/merges","archive_url":"https://api.github.com/repos/lukaspj/portainer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lukaspj/portainer/downloads","issues_url":"https://api.github.com/repos/lukaspj/portainer/issues{/number}","pulls_url":"https://api.github.com/repos/lukaspj/portainer/pulls{/number}","milestones_url":"https://api.github.com/repos/lukaspj/portainer/milestones{/number}","notifications_url":"https://api.github.com/repos/lukaspj/portainer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lukaspj/portainer/labels{/name}","releases_url":"https://api.github.com/repos/lukaspj/portainer/releases{/id}","deployments_url":"https://api.github.com/repos/lukaspj/portainer/deployments","created_at":"2018-08-23T18:28:43Z","updated_at":"2018-08-23T18:28:46Z","pushed_at":"2018-08-27T20:44:59Z","git_url":"git://github.com/lukaspj/portainer.git","ssh_url":"git@github.com:lukaspj/portainer.git","clone_url":"https://github.com/lukaspj/portainer.git","svn_url":"https://github.com/lukaspj/portainer","homepage":"http://portainer.io","size":17380,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"zlib","name":"zlib License","spdx_id":"Zlib","url":"https://api.github.com/licenses/zlib","node_id":"MDc6TGljZW5zZTI3"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"portainer:develop","ref":"develop","sha":"bfccf55729d497897c505c65433661507e9e7265","user":{"login":"portainer","id":22225832,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMjI1ODMy","avatar_url":"https://avatars0.githubusercontent.com/u/22225832?v=4","gravatar_id":"","url":"https://api.github.com/users/portainer","html_url":"https://github.com/portainer","followers_url":"https://api.github.com/users/portainer/followers","following_url":"https://api.github.com/users/portainer/following{/other_user}","gists_url":"https://api.github.com/users/portainer/gists{/gist_id}","starred_url":"https://api.github.com/users/portainer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/portainer/subscriptions","organizations_url":"https://api.github.com/users/portainer/orgs","repos_url":"https://api.github.com/users/portainer/repos","events_url":"https://api.github.com/users/portainer/events{/privacy}","received_events_url":"https://api.github.com/users/portainer/received_events","type":"Organization","site_admin":false},"repo":{"id":59239347,"node_id":"MDEwOlJlcG9zaXRvcnk1OTIzOTM0Nw==","name":"portainer","full_name":"portainer/portainer","owner":{"login":"portainer","id":22225832,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMjI1ODMy","avatar_url":"https://avatars0.githubusercontent.com/u/22225832?v=4","gravatar_id":"","url":"https://api.github.com/users/portainer","html_url":"https://github.com/portainer","followers_url":"https://api.github.com/users/portainer/followers","following_url":"https://api.github.com/users/portainer/following{/other_user}","gists_url":"https://api.github.com/users/portainer/gists{/gist_id}","starred_url":"https://api.github.com/users/portainer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/portainer/subscriptions","organizations_url":"https://api.github.com/users/portainer/orgs","repos_url":"https://api.github.com/users/portainer/repos","events_url":"https://api.github.com/users/portainer/events{/privacy}","received_events_url":"https://api.github.com/users/portainer/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/portainer/portainer","description":"Simple management UI for Docker","fork":false,"url":"https://api.github.com/repos/portainer/portainer","forks_url":"https://api.github.com/repos/portainer/portainer/forks","keys_url":"https://api.github.com/repos/portainer/portainer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/portainer/portainer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/portainer/portainer/teams","hooks_url":"https://api.github.com/repos/portainer/portainer/hooks","issue_events_url":"https://api.github.com/repos/portainer/portainer/issues/events{/number}","events_url":"https://api.github.com/repos/portainer/portainer/events","assignees_url":"https://api.github.com/repos/portainer/portainer/assignees{/user}","branches_url":"https://api.github.com/repos/portainer/portainer/branches{/branch}","tags_url":"https://api.github.com/repos/portainer/portainer/tags","blobs_url":"https://api.github.com/repos/portainer/portainer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/portainer/portainer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/portainer/portainer/git/refs{/sha}","trees_url":"https://api.github.com/repos/portainer/portainer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/portainer/portainer/statuses/{sha}","languages_url":"https://api.github.com/repos/portainer/portainer/languages","stargazers_url":"https://api.github.com/repos/portainer/portainer/stargazers","contributors_url":"https://api.github.com/repos/portainer/portainer/contributors","subscribers_url":"https://api.github.com/repos/portainer/portainer/subscribers","subscription_url":"https://api.github.com/repos/portainer/portainer/subscription","commits_url":"https://api.github.com/repos/portainer/portainer/commits{/sha}","git_commits_url":"https://api.github.com/repos/portainer/portainer/git/commits{/sha}","comments_url":"https://api.github.com/repos/portainer/portainer/comments{/number}","issue_comment_url":"https://api.github.com/repos/portainer/portainer/issues/comments{/number}","contents_url":"https://api.github.com/repos/portainer/portainer/contents/{+path}","compare_url":"https://api.github.com/repos/portainer/portainer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/portainer/portainer/merges","archive_url":"https://api.github.com/repos/portainer/portainer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/portainer/portainer/downloads","issues_url":"https://api.github.com/repos/portainer/portainer/issues{/number}","pulls_url":"https://api.github.com/repos/portainer/portainer/pulls{/number}","milestones_url":"https://api.github.com/repos/portainer/portainer/milestones{/number}","notifications_url":"https://api.github.com/repos/portainer/portainer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/portainer/portainer/labels{/name}","releases_url":"https://api.github.com/repos/portainer/portainer/releases{/id}","deployments_url":"https://api.github.com/repos/portainer/portainer/deployments","created_at":"2016-05-19T20:15:28Z","updated_at":"2018-08-27T19:44:07Z","pushed_at":"2018-08-27T20:45:00Z","git_url":"git://github.com/portainer/portainer.git","ssh_url":"git@github.com:portainer/portainer.git","clone_url":"https://github.com/portainer/portainer.git","svn_url":"https://github.com/portainer/portainer","homepage":"http://portainer.io","size":17336,"stargazers_count":9046,"watchers_count":9046,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":877,"mirror_url":null,"archived":false,"open_issues_count":362,"license":{"key":"zlib","name":"zlib License","spdx_id":"Zlib","url":"https://api.github.com/licenses/zlib","node_id":"MDc6TGljZW5zZTI3"},"forks":877,"open_issues":362,"watchers":9046,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/portainer/portainer/pulls/2209"},"html":{"href":"https://github.com/portainer/portainer/pull/2209"},"issue":{"href":"https://api.github.com/repos/portainer/portainer/issues/2209"},"comments":{"href":"https://api.github.com/repos/portainer/portainer/issues/2209/comments"},"review_comments":{"href":"https://api.github.com/repos/portainer/portainer/pulls/2209/comments"},"review_comment":{"href":"https://api.github.com/repos/portainer/portainer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/portainer/portainer/pulls/2209/commits"},"statuses":{"href":"https://api.github.com/repos/portainer/portainer/statuses/074b64bfce2c6f927383b184e4a966ad97307eb0"}},"author_association":"NONE"}}
{"actor":{"display_login":"lukaspj"}}