{"action":"created","comment":{"url":"https://api.github.com/repos/cloudera/livy/pulls/comments/72369098","id":72369098,"diff_hunk":"@@ -0,0 +1,49 @@\n+/*\n+ * Licensed to Cloudera, Inc. under one\n+ * or more contributor license agreements.  See the NOTICE file\n+ * distributed with this work for additional information\n+ * regarding copyright ownership.  Cloudera, Inc. licenses this file\n+ * to you under the Apache License, Version 2.0 (the\n+ * \"License\"); you may not use this file except in compliance\n+ * with the License.  You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+package com.cloudera.livy.server\n+\n+import javax.servlet._\n+import javax.servlet.http.{HttpServletRequest, HttpServletResponse}\n+\n+import com.cloudera.livy.LivyConf\n+\n+class AccessFilter extends Filter {\n+\n+  val allowedUsers = scala.collection.mutable.Set[String]()\n+\n+  override def init(filterConfig: FilterConfig): Unit = {\n+    val users = filterConfig.getInitParameter(LivyConf.ACCESS_CONTROL_USERS.key)","path":"server/src/main/scala/com/cloudera/livy/server/AccessFilter.scala","position":31,"original_position":31,"commit_id":"96afdc6bd59bffbeca6d69fa9b63e9c090441424","original_commit_id":"96afdc6bd59bffbeca6d69fa9b63e9c090441424","user":{"login":"vanzin","id":1694083,"avatar_url":"https://avatars.githubusercontent.com/u/1694083?v=3","gravatar_id":"","url":"https://api.github.com/users/vanzin","html_url":"https://github.com/vanzin","followers_url":"https://api.github.com/users/vanzin/followers","following_url":"https://api.github.com/users/vanzin/following{/other_user}","gists_url":"https://api.github.com/users/vanzin/gists{/gist_id}","starred_url":"https://api.github.com/users/vanzin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vanzin/subscriptions","organizations_url":"https://api.github.com/users/vanzin/orgs","repos_url":"https://api.github.com/users/vanzin/repos","events_url":"https://api.github.com/users/vanzin/events{/privacy}","received_events_url":"https://api.github.com/users/vanzin/received_events","type":"User","site_admin":false},"body":"I'd suggest doing something similar to the `superusers` method in `LivyConf`. Then you can reuse some of the code for parsing lists too, and avoid the mutable set (not a big deal but I prefer to avoid mutable types unless really needed).","created_at":"2016-07-27T01:47:24Z","updated_at":"2016-07-27T01:47:24Z","html_url":"https://github.com/cloudera/livy/pull/171#discussion_r72369098","pull_request_url":"https://api.github.com/repos/cloudera/livy/pulls/171","_links":{"self":{"href":"https://api.github.com/repos/cloudera/livy/pulls/comments/72369098"},"html":{"href":"https://github.com/cloudera/livy/pull/171#discussion_r72369098"},"pull_request":{"href":"https://api.github.com/repos/cloudera/livy/pulls/171"}}},"pull_request":{"url":"https://api.github.com/repos/cloudera/livy/pulls/171","id":78863788,"html_url":"https://github.com/cloudera/livy/pull/171","diff_url":"https://github.com/cloudera/livy/pull/171.diff","patch_url":"https://github.com/cloudera/livy/pull/171.patch","issue_url":"https://api.github.com/repos/cloudera/livy/issues/171","number":171,"state":"open","locked":false,"title":"LIVY-198 & LIVY-199","user":{"login":"paulmw","id":1100017,"avatar_url":"https://avatars.githubusercontent.com/u/1100017?v=3","gravatar_id":"","url":"https://api.github.com/users/paulmw","html_url":"https://github.com/paulmw","followers_url":"https://api.github.com/users/paulmw/followers","following_url":"https://api.github.com/users/paulmw/following{/other_user}","gists_url":"https://api.github.com/users/paulmw/gists{/gist_id}","starred_url":"https://api.github.com/users/paulmw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulmw/subscriptions","organizations_url":"https://api.github.com/users/paulmw/orgs","repos_url":"https://api.github.com/users/paulmw/repos","events_url":"https://api.github.com/users/paulmw/events{/privacy}","received_events_url":"https://api.github.com/users/paulmw/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-26T14:40:09Z","updated_at":"2016-07-27T01:47:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0fd3af7f6b2a146c07aea17dee42279dfc3522cd","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/cloudera/livy/pulls/171/commits","review_comments_url":"https://api.github.com/repos/cloudera/livy/pulls/171/comments","review_comment_url":"https://api.github.com/repos/cloudera/livy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cloudera/livy/issues/171/comments","statuses_url":"https://api.github.com/repos/cloudera/livy/statuses/96afdc6bd59bffbeca6d69fa9b63e9c090441424","head":{"label":"paulmw:master","ref":"master","sha":"96afdc6bd59bffbeca6d69fa9b63e9c090441424","user":{"login":"paulmw","id":1100017,"avatar_url":"https://avatars.githubusercontent.com/u/1100017?v=3","gravatar_id":"","url":"https://api.github.com/users/paulmw","html_url":"https://github.com/paulmw","followers_url":"https://api.github.com/users/paulmw/followers","following_url":"https://api.github.com/users/paulmw/following{/other_user}","gists_url":"https://api.github.com/users/paulmw/gists{/gist_id}","starred_url":"https://api.github.com/users/paulmw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulmw/subscriptions","organizations_url":"https://api.github.com/users/paulmw/orgs","repos_url":"https://api.github.com/users/paulmw/repos","events_url":"https://api.github.com/users/paulmw/events{/privacy}","received_events_url":"https://api.github.com/users/paulmw/received_events","type":"User","site_admin":false},"repo":{"id":64221575,"name":"livy","full_name":"paulmw/livy","owner":{"login":"paulmw","id":1100017,"avatar_url":"https://avatars.githubusercontent.com/u/1100017?v=3","gravatar_id":"","url":"https://api.github.com/users/paulmw","html_url":"https://github.com/paulmw","followers_url":"https://api.github.com/users/paulmw/followers","following_url":"https://api.github.com/users/paulmw/following{/other_user}","gists_url":"https://api.github.com/users/paulmw/gists{/gist_id}","starred_url":"https://api.github.com/users/paulmw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulmw/subscriptions","organizations_url":"https://api.github.com/users/paulmw/orgs","repos_url":"https://api.github.com/users/paulmw/repos","events_url":"https://api.github.com/users/paulmw/events{/privacy}","received_events_url":"https://api.github.com/users/paulmw/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/paulmw/livy","description":"Livy is an open source REST interface for interacting with Apache Spark from anywhere","fork":true,"url":"https://api.github.com/repos/paulmw/livy","forks_url":"https://api.github.com/repos/paulmw/livy/forks","keys_url":"https://api.github.com/repos/paulmw/livy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paulmw/livy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paulmw/livy/teams","hooks_url":"https://api.github.com/repos/paulmw/livy/hooks","issue_events_url":"https://api.github.com/repos/paulmw/livy/issues/events{/number}","events_url":"https://api.github.com/repos/paulmw/livy/events","assignees_url":"https://api.github.com/repos/paulmw/livy/assignees{/user}","branches_url":"https://api.github.com/repos/paulmw/livy/branches{/branch}","tags_url":"https://api.github.com/repos/paulmw/livy/tags","blobs_url":"https://api.github.com/repos/paulmw/livy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paulmw/livy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paulmw/livy/git/refs{/sha}","trees_url":"https://api.github.com/repos/paulmw/livy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paulmw/livy/statuses/{sha}","languages_url":"https://api.github.com/repos/paulmw/livy/languages","stargazers_url":"https://api.github.com/repos/paulmw/livy/stargazers","contributors_url":"https://api.github.com/repos/paulmw/livy/contributors","subscribers_url":"https://api.github.com/repos/paulmw/livy/subscribers","subscription_url":"https://api.github.com/repos/paulmw/livy/subscription","commits_url":"https://api.github.com/repos/paulmw/livy/commits{/sha}","git_commits_url":"https://api.github.com/repos/paulmw/livy/git/commits{/sha}","comments_url":"https://api.github.com/repos/paulmw/livy/comments{/number}","issue_comment_url":"https://api.github.com/repos/paulmw/livy/issues/comments{/number}","contents_url":"https://api.github.com/repos/paulmw/livy/contents/{+path}","compare_url":"https://api.github.com/repos/paulmw/livy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paulmw/livy/merges","archive_url":"https://api.github.com/repos/paulmw/livy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paulmw/livy/downloads","issues_url":"https://api.github.com/repos/paulmw/livy/issues{/number}","pulls_url":"https://api.github.com/repos/paulmw/livy/pulls{/number}","milestones_url":"https://api.github.com/repos/paulmw/livy/milestones{/number}","notifications_url":"https://api.github.com/repos/paulmw/livy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paulmw/livy/labels{/name}","releases_url":"https://api.github.com/repos/paulmw/livy/releases{/id}","deployments_url":"https://api.github.com/repos/paulmw/livy/deployments","created_at":"2016-07-26T13:01:25Z","updated_at":"2016-07-26T13:01:26Z","pushed_at":"2016-07-26T14:35:54Z","git_url":"git://github.com/paulmw/livy.git","ssh_url":"git@github.com:paulmw/livy.git","clone_url":"https://github.com/paulmw/livy.git","svn_url":"https://github.com/paulmw/livy","homepage":"http://livy.io/","size":1447,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cloudera:master","ref":"master","sha":"8ab212818553afda07dff584cbcba47cc619c0e3","user":{"login":"cloudera","id":87383,"avatar_url":"https://avatars.githubusercontent.com/u/87383?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudera","html_url":"https://github.com/cloudera","followers_url":"https://api.github.com/users/cloudera/followers","following_url":"https://api.github.com/users/cloudera/following{/other_user}","gists_url":"https://api.github.com/users/cloudera/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudera/subscriptions","organizations_url":"https://api.github.com/users/cloudera/orgs","repos_url":"https://api.github.com/users/cloudera/repos","events_url":"https://api.github.com/users/cloudera/events{/privacy}","received_events_url":"https://api.github.com/users/cloudera/received_events","type":"Organization","site_admin":false},"repo":{"id":46328956,"name":"livy","full_name":"cloudera/livy","owner":{"login":"cloudera","id":87383,"avatar_url":"https://avatars.githubusercontent.com/u/87383?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudera","html_url":"https://github.com/cloudera","followers_url":"https://api.github.com/users/cloudera/followers","following_url":"https://api.github.com/users/cloudera/following{/other_user}","gists_url":"https://api.github.com/users/cloudera/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudera/subscriptions","organizations_url":"https://api.github.com/users/cloudera/orgs","repos_url":"https://api.github.com/users/cloudera/repos","events_url":"https://api.github.com/users/cloudera/events{/privacy}","received_events_url":"https://api.github.com/users/cloudera/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cloudera/livy","description":"Livy is an open source REST interface for interacting with Apache Spark from anywhere","fork":false,"url":"https://api.github.com/repos/cloudera/livy","forks_url":"https://api.github.com/repos/cloudera/livy/forks","keys_url":"https://api.github.com/repos/cloudera/livy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cloudera/livy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cloudera/livy/teams","hooks_url":"https://api.github.com/repos/cloudera/livy/hooks","issue_events_url":"https://api.github.com/repos/cloudera/livy/issues/events{/number}","events_url":"https://api.github.com/repos/cloudera/livy/events","assignees_url":"https://api.github.com/repos/cloudera/livy/assignees{/user}","branches_url":"https://api.github.com/repos/cloudera/livy/branches{/branch}","tags_url":"https://api.github.com/repos/cloudera/livy/tags","blobs_url":"https://api.github.com/repos/cloudera/livy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cloudera/livy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cloudera/livy/git/refs{/sha}","trees_url":"https://api.github.com/repos/cloudera/livy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cloudera/livy/statuses/{sha}","languages_url":"https://api.github.com/repos/cloudera/livy/languages","stargazers_url":"https://api.github.com/repos/cloudera/livy/stargazers","contributors_url":"https://api.github.com/repos/cloudera/livy/contributors","subscribers_url":"https://api.github.com/repos/cloudera/livy/subscribers","subscription_url":"https://api.github.com/repos/cloudera/livy/subscription","commits_url":"https://api.github.com/repos/cloudera/livy/commits{/sha}","git_commits_url":"https://api.github.com/repos/cloudera/livy/git/commits{/sha}","comments_url":"https://api.github.com/repos/cloudera/livy/comments{/number}","issue_comment_url":"https://api.github.com/repos/cloudera/livy/issues/comments{/number}","contents_url":"https://api.github.com/repos/cloudera/livy/contents/{+path}","compare_url":"https://api.github.com/repos/cloudera/livy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cloudera/livy/merges","archive_url":"https://api.github.com/repos/cloudera/livy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cloudera/livy/downloads","issues_url":"https://api.github.com/repos/cloudera/livy/issues{/number}","pulls_url":"https://api.github.com/repos/cloudera/livy/pulls{/number}","milestones_url":"https://api.github.com/repos/cloudera/livy/milestones{/number}","notifications_url":"https://api.github.com/repos/cloudera/livy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cloudera/livy/labels{/name}","releases_url":"https://api.github.com/repos/cloudera/livy/releases{/id}","deployments_url":"https://api.github.com/repos/cloudera/livy/deployments","created_at":"2015-11-17T06:55:45Z","updated_at":"2016-07-27T01:22:45Z","pushed_at":"2016-07-26T14:40:10Z","git_url":"git://github.com/cloudera/livy.git","ssh_url":"git@github.com:cloudera/livy.git","clone_url":"https://github.com/cloudera/livy.git","svn_url":"https://github.com/cloudera/livy","homepage":"http://livy.io/","size":1999,"stargazers_count":180,"watchers_count":180,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":78,"mirror_url":null,"open_issues_count":6,"forks":78,"open_issues":6,"watchers":180,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cloudera/livy/pulls/171"},"html":{"href":"https://github.com/cloudera/livy/pull/171"},"issue":{"href":"https://api.github.com/repos/cloudera/livy/issues/171"},"comments":{"href":"https://api.github.com/repos/cloudera/livy/issues/171/comments"},"review_comments":{"href":"https://api.github.com/repos/cloudera/livy/pulls/171/comments"},"review_comment":{"href":"https://api.github.com/repos/cloudera/livy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cloudera/livy/pulls/171/commits"},"statuses":{"href":"https://api.github.com/repos/cloudera/livy/statuses/96afdc6bd59bffbeca6d69fa9b63e9c090441424"}}}}
{"actor":{"display_login":"vanzin"}}