{"action":"created","comment":{"url":"https://api.github.com/repos/3scale/apicast/pulls/comments/221273962","pull_request_review_id":159886667,"id":221273962,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMTI3Mzk2Mg==","diff_hunk":"@@ -0,0 +1,75 @@\n+local iputils = require(\"resty.iputils\")\n+\n+local policy = require('apicast.policy')\n+local _M = policy.new('IP check policy')\n+\n+local new = _M.new\n+\n+local function parse_cidrs(cidrs)\n+  return iputils.parse_cidrs(cidrs or {})\n+end\n+\n+local function request_ip_addr()\n+  return ngx.var.remote_addr\n+end\n+\n+local function req_ip_in_range(cidrs)\n+  return iputils.ip_in_cidrs(request_ip_addr(), cidrs)\n+end\n+\n+local function deny_request()\n+  ngx.status = ngx.HTTP_FORBIDDEN\n+  ngx.say('IP address not allowed')","path":"gateway/src/apicast/policy/ip_check/ip_check.lua","position":null,"original_position":22,"commit_id":"f52c70ca92a0c5db2e70b738a4c2c5d0fee57060","original_commit_id":"6edf4a088527e2528e30113b75fcf056e4ed1474","user":{"login":"davidor","id":907223,"node_id":"MDQ6VXNlcjkwNzIyMw==","avatar_url":"https://avatars2.githubusercontent.com/u/907223?v=4","gravatar_id":"","url":"https://api.github.com/users/davidor","html_url":"https://github.com/davidor","followers_url":"https://api.github.com/users/davidor/followers","following_url":"https://api.github.com/users/davidor/following{/other_user}","gists_url":"https://api.github.com/users/davidor/gists{/gist_id}","starred_url":"https://api.github.com/users/davidor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidor/subscriptions","organizations_url":"https://api.github.com/users/davidor/orgs","repos_url":"https://api.github.com/users/davidor/repos","events_url":"https://api.github.com/users/davidor/events{/privacy}","received_events_url":"https://api.github.com/users/davidor/received_events","type":"User","site_admin":false},"body":"For now, I've made the message configurable.\r\nI think that supporting different formats affects several policies and should be done in a separate PR.","created_at":"2018-09-28T14:32:59Z","updated_at":"2018-09-28T14:33:00Z","html_url":"https://github.com/3scale/apicast/pull/907#discussion_r221273962","pull_request_url":"https://api.github.com/repos/3scale/apicast/pulls/907","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/3scale/apicast/pulls/comments/221273962"},"html":{"href":"https://github.com/3scale/apicast/pull/907#discussion_r221273962"},"pull_request":{"href":"https://api.github.com/repos/3scale/apicast/pulls/907"}},"in_reply_to_id":220091695},"pull_request":{"url":"https://api.github.com/repos/3scale/apicast/pulls/907","id":217274585,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3Mjc0NTg1","html_url":"https://github.com/3scale/apicast/pull/907","diff_url":"https://github.com/3scale/apicast/pull/907.diff","patch_url":"https://github.com/3scale/apicast/pull/907.patch","issue_url":"https://api.github.com/repos/3scale/apicast/issues/907","number":907,"state":"open","locked":false,"title":"IP check policy","user":{"login":"davidor","id":907223,"node_id":"MDQ6VXNlcjkwNzIyMw==","avatar_url":"https://avatars2.githubusercontent.com/u/907223?v=4","gravatar_id":"","url":"https://api.github.com/users/davidor","html_url":"https://github.com/davidor","followers_url":"https://api.github.com/users/davidor/followers","following_url":"https://api.github.com/users/davidor/following{/other_user}","gists_url":"https://api.github.com/users/davidor/gists{/gist_id}","starred_url":"https://api.github.com/users/davidor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidor/subscriptions","organizations_url":"https://api.github.com/users/davidor/orgs","repos_url":"https://api.github.com/users/davidor/repos","events_url":"https://api.github.com/users/davidor/events{/privacy}","received_events_url":"https://api.github.com/users/davidor/received_events","type":"User","site_admin":false},"body":"Closes #906 ","created_at":"2018-09-21T12:54:32Z","updated_at":"2018-09-28T14:33:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9b6530b93309c20506c618b54dbb4872488d50dd","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/3scale/apicast/pulls/907/commits","review_comments_url":"https://api.github.com/repos/3scale/apicast/pulls/907/comments","review_comment_url":"https://api.github.com/repos/3scale/apicast/pulls/comments{/number}","comments_url":"https://api.github.com/repos/3scale/apicast/issues/907/comments","statuses_url":"https://api.github.com/repos/3scale/apicast/statuses/f52c70ca92a0c5db2e70b738a4c2c5d0fee57060","head":{"label":"3scale:ip-check","ref":"ip-check","sha":"f52c70ca92a0c5db2e70b738a4c2c5d0fee57060","user":{"login":"3scale","id":21415,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxNDE1","avatar_url":"https://avatars0.githubusercontent.com/u/21415?v=4","gravatar_id":"","url":"https://api.github.com/users/3scale","html_url":"https://github.com/3scale","followers_url":"https://api.github.com/users/3scale/followers","following_url":"https://api.github.com/users/3scale/following{/other_user}","gists_url":"https://api.github.com/users/3scale/gists{/gist_id}","starred_url":"https://api.github.com/users/3scale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3scale/subscriptions","organizations_url":"https://api.github.com/users/3scale/orgs","repos_url":"https://api.github.com/users/3scale/repos","events_url":"https://api.github.com/users/3scale/events{/privacy}","received_events_url":"https://api.github.com/users/3scale/received_events","type":"Organization","site_admin":false},"repo":{"id":53965666,"node_id":"MDEwOlJlcG9zaXRvcnk1Mzk2NTY2Ng==","name":"apicast","full_name":"3scale/apicast","private":false,"owner":{"login":"3scale","id":21415,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxNDE1","avatar_url":"https://avatars0.githubusercontent.com/u/21415?v=4","gravatar_id":"","url":"https://api.github.com/users/3scale","html_url":"https://github.com/3scale","followers_url":"https://api.github.com/users/3scale/followers","following_url":"https://api.github.com/users/3scale/following{/other_user}","gists_url":"https://api.github.com/users/3scale/gists{/gist_id}","starred_url":"https://api.github.com/users/3scale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3scale/subscriptions","organizations_url":"https://api.github.com/users/3scale/orgs","repos_url":"https://api.github.com/users/3scale/repos","events_url":"https://api.github.com/users/3scale/events{/privacy}","received_events_url":"https://api.github.com/users/3scale/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/3scale/apicast","description":"3scale API Gateway","fork":false,"url":"https://api.github.com/repos/3scale/apicast","forks_url":"https://api.github.com/repos/3scale/apicast/forks","keys_url":"https://api.github.com/repos/3scale/apicast/keys{/key_id}","collaborators_url":"https://api.github.com/repos/3scale/apicast/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/3scale/apicast/teams","hooks_url":"https://api.github.com/repos/3scale/apicast/hooks","issue_events_url":"https://api.github.com/repos/3scale/apicast/issues/events{/number}","events_url":"https://api.github.com/repos/3scale/apicast/events","assignees_url":"https://api.github.com/repos/3scale/apicast/assignees{/user}","branches_url":"https://api.github.com/repos/3scale/apicast/branches{/branch}","tags_url":"https://api.github.com/repos/3scale/apicast/tags","blobs_url":"https://api.github.com/repos/3scale/apicast/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/3scale/apicast/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/3scale/apicast/git/refs{/sha}","trees_url":"https://api.github.com/repos/3scale/apicast/git/trees{/sha}","statuses_url":"https://api.github.com/repos/3scale/apicast/statuses/{sha}","languages_url":"https://api.github.com/repos/3scale/apicast/languages","stargazers_url":"https://api.github.com/repos/3scale/apicast/stargazers","contributors_url":"https://api.github.com/repos/3scale/apicast/contributors","subscribers_url":"https://api.github.com/repos/3scale/apicast/subscribers","subscription_url":"https://api.github.com/repos/3scale/apicast/subscription","commits_url":"https://api.github.com/repos/3scale/apicast/commits{/sha}","git_commits_url":"https://api.github.com/repos/3scale/apicast/git/commits{/sha}","comments_url":"https://api.github.com/repos/3scale/apicast/comments{/number}","issue_comment_url":"https://api.github.com/repos/3scale/apicast/issues/comments{/number}","contents_url":"https://api.github.com/repos/3scale/apicast/contents/{+path}","compare_url":"https://api.github.com/repos/3scale/apicast/compare/{base}...{head}","merges_url":"https://api.github.com/repos/3scale/apicast/merges","archive_url":"https://api.github.com/repos/3scale/apicast/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/3scale/apicast/downloads","issues_url":"https://api.github.com/repos/3scale/apicast/issues{/number}","pulls_url":"https://api.github.com/repos/3scale/apicast/pulls{/number}","milestones_url":"https://api.github.com/repos/3scale/apicast/milestones{/number}","notifications_url":"https://api.github.com/repos/3scale/apicast/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/3scale/apicast/labels{/name}","releases_url":"https://api.github.com/repos/3scale/apicast/releases{/id}","deployments_url":"https://api.github.com/repos/3scale/apicast/deployments","created_at":"2016-03-15T17:41:51Z","updated_at":"2018-09-27T11:32:49Z","pushed_at":"2018-09-28T14:26:41Z","git_url":"git://github.com/3scale/apicast.git","ssh_url":"git@github.com:3scale/apicast.git","clone_url":"https://github.com/3scale/apicast.git","svn_url":"https://github.com/3scale/apicast","homepage":"","size":3734,"stargazers_count":101,"watchers_count":101,"language":"Lua","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":62,"mirror_url":null,"archived":false,"open_issues_count":59,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":62,"open_issues":59,"watchers":101,"default_branch":"master"}},"base":{"label":"3scale:master","ref":"master","sha":"4442dc92ec51b95607fe0367710adb6edfedb7c8","user":{"login":"3scale","id":21415,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxNDE1","avatar_url":"https://avatars0.githubusercontent.com/u/21415?v=4","gravatar_id":"","url":"https://api.github.com/users/3scale","html_url":"https://github.com/3scale","followers_url":"https://api.github.com/users/3scale/followers","following_url":"https://api.github.com/users/3scale/following{/other_user}","gists_url":"https://api.github.com/users/3scale/gists{/gist_id}","starred_url":"https://api.github.com/users/3scale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3scale/subscriptions","organizations_url":"https://api.github.com/users/3scale/orgs","repos_url":"https://api.github.com/users/3scale/repos","events_url":"https://api.github.com/users/3scale/events{/privacy}","received_events_url":"https://api.github.com/users/3scale/received_events","type":"Organization","site_admin":false},"repo":{"id":53965666,"node_id":"MDEwOlJlcG9zaXRvcnk1Mzk2NTY2Ng==","name":"apicast","full_name":"3scale/apicast","private":false,"owner":{"login":"3scale","id":21415,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxNDE1","avatar_url":"https://avatars0.githubusercontent.com/u/21415?v=4","gravatar_id":"","url":"https://api.github.com/users/3scale","html_url":"https://github.com/3scale","followers_url":"https://api.github.com/users/3scale/followers","following_url":"https://api.github.com/users/3scale/following{/other_user}","gists_url":"https://api.github.com/users/3scale/gists{/gist_id}","starred_url":"https://api.github.com/users/3scale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3scale/subscriptions","organizations_url":"https://api.github.com/users/3scale/orgs","repos_url":"https://api.github.com/users/3scale/repos","events_url":"https://api.github.com/users/3scale/events{/privacy}","received_events_url":"https://api.github.com/users/3scale/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/3scale/apicast","description":"3scale API Gateway","fork":false,"url":"https://api.github.com/repos/3scale/apicast","forks_url":"https://api.github.com/repos/3scale/apicast/forks","keys_url":"https://api.github.com/repos/3scale/apicast/keys{/key_id}","collaborators_url":"https://api.github.com/repos/3scale/apicast/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/3scale/apicast/teams","hooks_url":"https://api.github.com/repos/3scale/apicast/hooks","issue_events_url":"https://api.github.com/repos/3scale/apicast/issues/events{/number}","events_url":"https://api.github.com/repos/3scale/apicast/events","assignees_url":"https://api.github.com/repos/3scale/apicast/assignees{/user}","branches_url":"https://api.github.com/repos/3scale/apicast/branches{/branch}","tags_url":"https://api.github.com/repos/3scale/apicast/tags","blobs_url":"https://api.github.com/repos/3scale/apicast/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/3scale/apicast/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/3scale/apicast/git/refs{/sha}","trees_url":"https://api.github.com/repos/3scale/apicast/git/trees{/sha}","statuses_url":"https://api.github.com/repos/3scale/apicast/statuses/{sha}","languages_url":"https://api.github.com/repos/3scale/apicast/languages","stargazers_url":"https://api.github.com/repos/3scale/apicast/stargazers","contributors_url":"https://api.github.com/repos/3scale/apicast/contributors","subscribers_url":"https://api.github.com/repos/3scale/apicast/subscribers","subscription_url":"https://api.github.com/repos/3scale/apicast/subscription","commits_url":"https://api.github.com/repos/3scale/apicast/commits{/sha}","git_commits_url":"https://api.github.com/repos/3scale/apicast/git/commits{/sha}","comments_url":"https://api.github.com/repos/3scale/apicast/comments{/number}","issue_comment_url":"https://api.github.com/repos/3scale/apicast/issues/comments{/number}","contents_url":"https://api.github.com/repos/3scale/apicast/contents/{+path}","compare_url":"https://api.github.com/repos/3scale/apicast/compare/{base}...{head}","merges_url":"https://api.github.com/repos/3scale/apicast/merges","archive_url":"https://api.github.com/repos/3scale/apicast/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/3scale/apicast/downloads","issues_url":"https://api.github.com/repos/3scale/apicast/issues{/number}","pulls_url":"https://api.github.com/repos/3scale/apicast/pulls{/number}","milestones_url":"https://api.github.com/repos/3scale/apicast/milestones{/number}","notifications_url":"https://api.github.com/repos/3scale/apicast/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/3scale/apicast/labels{/name}","releases_url":"https://api.github.com/repos/3scale/apicast/releases{/id}","deployments_url":"https://api.github.com/repos/3scale/apicast/deployments","created_at":"2016-03-15T17:41:51Z","updated_at":"2018-09-27T11:32:49Z","pushed_at":"2018-09-28T14:26:41Z","git_url":"git://github.com/3scale/apicast.git","ssh_url":"git@github.com:3scale/apicast.git","clone_url":"https://github.com/3scale/apicast.git","svn_url":"https://github.com/3scale/apicast","homepage":"","size":3734,"stargazers_count":101,"watchers_count":101,"language":"Lua","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":62,"mirror_url":null,"archived":false,"open_issues_count":59,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":62,"open_issues":59,"watchers":101,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/3scale/apicast/pulls/907"},"html":{"href":"https://github.com/3scale/apicast/pull/907"},"issue":{"href":"https://api.github.com/repos/3scale/apicast/issues/907"},"comments":{"href":"https://api.github.com/repos/3scale/apicast/issues/907/comments"},"review_comments":{"href":"https://api.github.com/repos/3scale/apicast/pulls/907/comments"},"review_comment":{"href":"https://api.github.com/repos/3scale/apicast/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/3scale/apicast/pulls/907/commits"},"statuses":{"href":"https://api.github.com/repos/3scale/apicast/statuses/f52c70ca92a0c5db2e70b738a4c2c5d0fee57060"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"davidor"}}