{"action":"created","comment":{"url":"https://api.github.com/repos/Mashape/kong/pulls/comments/117107697","pull_request_review_id":38785018,"id":117107697,"diff_hunk":"@@ -21,18 +59,18 @@ end\n function IpRestrictionHandler:access(conf)\n   IpRestrictionHandler.super.access(self)\n   local block = false\n-  local remote_addr = ngx.var.remote_addr\n+  local remote_addr = ngx.var.binary_remote_addr","path":"kong/plugins/ip-restriction/handler.lua","position":54,"original_position":54,"commit_id":"ace6edfac29698724958a6b9c28a0e7d16b172f0","original_commit_id":"ace6edfac29698724958a6b9c28a0e7d16b172f0","user":{"login":"thibaultcha","id":1125431,"avatar_url":"https://avatars1.githubusercontent.com/u/1125431?v=3","gravatar_id":"","url":"https://api.github.com/users/thibaultcha","html_url":"https://github.com/thibaultcha","followers_url":"https://api.github.com/users/thibaultcha/followers","following_url":"https://api.github.com/users/thibaultcha/following{/other_user}","gists_url":"https://api.github.com/users/thibaultcha/gists{/gist_id}","starred_url":"https://api.github.com/users/thibaultcha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thibaultcha/subscriptions","organizations_url":"https://api.github.com/users/thibaultcha/orgs","repos_url":"https://api.github.com/users/thibaultcha/repos","events_url":"https://api.github.com/users/thibaultcha/events{/privacy}","received_events_url":"https://api.github.com/users/thibaultcha/received_events","type":"User","site_admin":false},"body":"It would make sense to rename this variable to `bin_remote_addr` or `binary_remote_addr` as well, eventually.","created_at":"2017-05-17T20:55:11Z","updated_at":"2017-05-17T20:58:40Z","html_url":"https://github.com/Mashape/kong/pull/2530#discussion_r117107697","pull_request_url":"https://api.github.com/repos/Mashape/kong/pulls/2530","_links":{"self":{"href":"https://api.github.com/repos/Mashape/kong/pulls/comments/117107697"},"html":{"href":"https://github.com/Mashape/kong/pull/2530#discussion_r117107697"},"pull_request":{"href":"https://api.github.com/repos/Mashape/kong/pulls/2530"}}},"pull_request":{"url":"https://api.github.com/repos/Mashape/kong/pulls/2530","id":120700511,"html_url":"https://github.com/Mashape/kong/pull/2530","diff_url":"https://github.com/Mashape/kong/pull/2530.diff","patch_url":"https://github.com/Mashape/kong/pull/2530.patch","issue_url":"https://api.github.com/repos/Mashape/kong/issues/2530","number":2530,"state":"open","locked":false,"title":"perf(ip-restriction) faster iputils checking","user":{"login":"p0pr0ck5","id":4625425,"avatar_url":"https://avatars3.githubusercontent.com/u/4625425?v=3","gravatar_id":"","url":"https://api.github.com/users/p0pr0ck5","html_url":"https://github.com/p0pr0ck5","followers_url":"https://api.github.com/users/p0pr0ck5/followers","following_url":"https://api.github.com/users/p0pr0ck5/following{/other_user}","gists_url":"https://api.github.com/users/p0pr0ck5/gists{/gist_id}","starred_url":"https://api.github.com/users/p0pr0ck5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/p0pr0ck5/subscriptions","organizations_url":"https://api.github.com/users/p0pr0ck5/orgs","repos_url":"https://api.github.com/users/p0pr0ck5/repos","events_url":"https://api.github.com/users/p0pr0ck5/events{/privacy}","received_events_url":"https://api.github.com/users/p0pr0ck5/received_events","type":"User","site_admin":false},"body":"Using the binary representation of the address (e.g. via ngx.var.binary_remote_addr) is a more efficient approach, as we no longer need to rely on a small LRU cache to store binary-parsed CIDR and IP objects. To achieve this, we rely on a read-through module-level cache of parsed CIDR objects to call iputils.binip_in_cidrs directly; parsed CIDRs objects by definition are consistent, so we needn't worry about cache invalidation here.\r\n\r\nThis is still not an optimal approach, as the cache function still builds a new table on each execution. Ideally we would cache the entirety of this function as a single table; the trick here is defining the cache key. The speediest cache key would be a pregenerated string (such as a UUID) associated with the plugin object, but this would require a migration to add the schema field, as well as hooks to handle invalidations of the module cache. Given the pending EOL of serf and the associated changes to invalidation mechanisms, it makes more sense to submit such a PR targeting 0.11 after said update has been merged.","created_at":"2017-05-15T21:37:43Z","updated_at":"2017-05-17T20:58:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a35b14801a1099716aa8c4aa8a031d8370d9a696","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Mashape/kong/pulls/2530/commits","review_comments_url":"https://api.github.com/repos/Mashape/kong/pulls/2530/comments","review_comment_url":"https://api.github.com/repos/Mashape/kong/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Mashape/kong/issues/2530/comments","statuses_url":"https://api.github.com/repos/Mashape/kong/statuses/ace6edfac29698724958a6b9c28a0e7d16b172f0","head":{"label":"Mashape:perf/ip-restriction-bin","ref":"perf/ip-restriction-bin","sha":"ace6edfac29698724958a6b9c28a0e7d16b172f0","user":{"login":"Mashape","id":962416,"avatar_url":"https://avatars3.githubusercontent.com/u/962416?v=3","gravatar_id":"","url":"https://api.github.com/users/Mashape","html_url":"https://github.com/Mashape","followers_url":"https://api.github.com/users/Mashape/followers","following_url":"https://api.github.com/users/Mashape/following{/other_user}","gists_url":"https://api.github.com/users/Mashape/gists{/gist_id}","starred_url":"https://api.github.com/users/Mashape/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mashape/subscriptions","organizations_url":"https://api.github.com/users/Mashape/orgs","repos_url":"https://api.github.com/users/Mashape/repos","events_url":"https://api.github.com/users/Mashape/events{/privacy}","received_events_url":"https://api.github.com/users/Mashape/received_events","type":"Organization","site_admin":false},"repo":{"id":26783295,"name":"kong","full_name":"Mashape/kong","owner":{"login":"Mashape","id":962416,"avatar_url":"https://avatars3.githubusercontent.com/u/962416?v=3","gravatar_id":"","url":"https://api.github.com/users/Mashape","html_url":"https://github.com/Mashape","followers_url":"https://api.github.com/users/Mashape/followers","following_url":"https://api.github.com/users/Mashape/following{/other_user}","gists_url":"https://api.github.com/users/Mashape/gists{/gist_id}","starred_url":"https://api.github.com/users/Mashape/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mashape/subscriptions","organizations_url":"https://api.github.com/users/Mashape/orgs","repos_url":"https://api.github.com/users/Mashape/repos","events_url":"https://api.github.com/users/Mashape/events{/privacy}","received_events_url":"https://api.github.com/users/Mashape/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Mashape/kong","description":":monkey: The API Gateway & Microservice APIs Management Layer","fork":false,"url":"https://api.github.com/repos/Mashape/kong","forks_url":"https://api.github.com/repos/Mashape/kong/forks","keys_url":"https://api.github.com/repos/Mashape/kong/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Mashape/kong/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Mashape/kong/teams","hooks_url":"https://api.github.com/repos/Mashape/kong/hooks","issue_events_url":"https://api.github.com/repos/Mashape/kong/issues/events{/number}","events_url":"https://api.github.com/repos/Mashape/kong/events","assignees_url":"https://api.github.com/repos/Mashape/kong/assignees{/user}","branches_url":"https://api.github.com/repos/Mashape/kong/branches{/branch}","tags_url":"https://api.github.com/repos/Mashape/kong/tags","blobs_url":"https://api.github.com/repos/Mashape/kong/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Mashape/kong/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Mashape/kong/git/refs{/sha}","trees_url":"https://api.github.com/repos/Mashape/kong/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Mashape/kong/statuses/{sha}","languages_url":"https://api.github.com/repos/Mashape/kong/languages","stargazers_url":"https://api.github.com/repos/Mashape/kong/stargazers","contributors_url":"https://api.github.com/repos/Mashape/kong/contributors","subscribers_url":"https://api.github.com/repos/Mashape/kong/subscribers","subscription_url":"https://api.github.com/repos/Mashape/kong/subscription","commits_url":"https://api.github.com/repos/Mashape/kong/commits{/sha}","git_commits_url":"https://api.github.com/repos/Mashape/kong/git/commits{/sha}","comments_url":"https://api.github.com/repos/Mashape/kong/comments{/number}","issue_comment_url":"https://api.github.com/repos/Mashape/kong/issues/comments{/number}","contents_url":"https://api.github.com/repos/Mashape/kong/contents/{+path}","compare_url":"https://api.github.com/repos/Mashape/kong/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Mashape/kong/merges","archive_url":"https://api.github.com/repos/Mashape/kong/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Mashape/kong/downloads","issues_url":"https://api.github.com/repos/Mashape/kong/issues{/number}","pulls_url":"https://api.github.com/repos/Mashape/kong/pulls{/number}","milestones_url":"https://api.github.com/repos/Mashape/kong/milestones{/number}","notifications_url":"https://api.github.com/repos/Mashape/kong/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Mashape/kong/labels{/name}","releases_url":"https://api.github.com/repos/Mashape/kong/releases{/id}","deployments_url":"https://api.github.com/repos/Mashape/kong/deployments","created_at":"2014-11-17T23:56:08Z","updated_at":"2017-05-17T18:26:44Z","pushed_at":"2017-05-17T20:26:21Z","git_url":"git://github.com/Mashape/kong.git","ssh_url":"git@github.com:Mashape/kong.git","clone_url":"https://github.com/Mashape/kong.git","svn_url":"https://github.com/Mashape/kong","homepage":"https://getkong.org/install","size":5978,"stargazers_count":10024,"watchers_count":10024,"language":"Lua","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1083,"mirror_url":null,"open_issues_count":298,"forks":1083,"open_issues":298,"watchers":10024,"default_branch":"master"}},"base":{"label":"Mashape:master","ref":"master","sha":"900ec4e3c42c6d045a1123ad7cf9614a51281dd7","user":{"login":"Mashape","id":962416,"avatar_url":"https://avatars3.githubusercontent.com/u/962416?v=3","gravatar_id":"","url":"https://api.github.com/users/Mashape","html_url":"https://github.com/Mashape","followers_url":"https://api.github.com/users/Mashape/followers","following_url":"https://api.github.com/users/Mashape/following{/other_user}","gists_url":"https://api.github.com/users/Mashape/gists{/gist_id}","starred_url":"https://api.github.com/users/Mashape/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mashape/subscriptions","organizations_url":"https://api.github.com/users/Mashape/orgs","repos_url":"https://api.github.com/users/Mashape/repos","events_url":"https://api.github.com/users/Mashape/events{/privacy}","received_events_url":"https://api.github.com/users/Mashape/received_events","type":"Organization","site_admin":false},"repo":{"id":26783295,"name":"kong","full_name":"Mashape/kong","owner":{"login":"Mashape","id":962416,"avatar_url":"https://avatars3.githubusercontent.com/u/962416?v=3","gravatar_id":"","url":"https://api.github.com/users/Mashape","html_url":"https://github.com/Mashape","followers_url":"https://api.github.com/users/Mashape/followers","following_url":"https://api.github.com/users/Mashape/following{/other_user}","gists_url":"https://api.github.com/users/Mashape/gists{/gist_id}","starred_url":"https://api.github.com/users/Mashape/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mashape/subscriptions","organizations_url":"https://api.github.com/users/Mashape/orgs","repos_url":"https://api.github.com/users/Mashape/repos","events_url":"https://api.github.com/users/Mashape/events{/privacy}","received_events_url":"https://api.github.com/users/Mashape/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Mashape/kong","description":":monkey: The API Gateway & Microservice APIs Management Layer","fork":false,"url":"https://api.github.com/repos/Mashape/kong","forks_url":"https://api.github.com/repos/Mashape/kong/forks","keys_url":"https://api.github.com/repos/Mashape/kong/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Mashape/kong/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Mashape/kong/teams","hooks_url":"https://api.github.com/repos/Mashape/kong/hooks","issue_events_url":"https://api.github.com/repos/Mashape/kong/issues/events{/number}","events_url":"https://api.github.com/repos/Mashape/kong/events","assignees_url":"https://api.github.com/repos/Mashape/kong/assignees{/user}","branches_url":"https://api.github.com/repos/Mashape/kong/branches{/branch}","tags_url":"https://api.github.com/repos/Mashape/kong/tags","blobs_url":"https://api.github.com/repos/Mashape/kong/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Mashape/kong/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Mashape/kong/git/refs{/sha}","trees_url":"https://api.github.com/repos/Mashape/kong/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Mashape/kong/statuses/{sha}","languages_url":"https://api.github.com/repos/Mashape/kong/languages","stargazers_url":"https://api.github.com/repos/Mashape/kong/stargazers","contributors_url":"https://api.github.com/repos/Mashape/kong/contributors","subscribers_url":"https://api.github.com/repos/Mashape/kong/subscribers","subscription_url":"https://api.github.com/repos/Mashape/kong/subscription","commits_url":"https://api.github.com/repos/Mashape/kong/commits{/sha}","git_commits_url":"https://api.github.com/repos/Mashape/kong/git/commits{/sha}","comments_url":"https://api.github.com/repos/Mashape/kong/comments{/number}","issue_comment_url":"https://api.github.com/repos/Mashape/kong/issues/comments{/number}","contents_url":"https://api.github.com/repos/Mashape/kong/contents/{+path}","compare_url":"https://api.github.com/repos/Mashape/kong/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Mashape/kong/merges","archive_url":"https://api.github.com/repos/Mashape/kong/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Mashape/kong/downloads","issues_url":"https://api.github.com/repos/Mashape/kong/issues{/number}","pulls_url":"https://api.github.com/repos/Mashape/kong/pulls{/number}","milestones_url":"https://api.github.com/repos/Mashape/kong/milestones{/number}","notifications_url":"https://api.github.com/repos/Mashape/kong/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Mashape/kong/labels{/name}","releases_url":"https://api.github.com/repos/Mashape/kong/releases{/id}","deployments_url":"https://api.github.com/repos/Mashape/kong/deployments","created_at":"2014-11-17T23:56:08Z","updated_at":"2017-05-17T18:26:44Z","pushed_at":"2017-05-17T20:26:21Z","git_url":"git://github.com/Mashape/kong.git","ssh_url":"git@github.com:Mashape/kong.git","clone_url":"https://github.com/Mashape/kong.git","svn_url":"https://github.com/Mashape/kong","homepage":"https://getkong.org/install","size":5978,"stargazers_count":10024,"watchers_count":10024,"language":"Lua","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1083,"mirror_url":null,"open_issues_count":298,"forks":1083,"open_issues":298,"watchers":10024,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Mashape/kong/pulls/2530"},"html":{"href":"https://github.com/Mashape/kong/pull/2530"},"issue":{"href":"https://api.github.com/repos/Mashape/kong/issues/2530"},"comments":{"href":"https://api.github.com/repos/Mashape/kong/issues/2530/comments"},"review_comments":{"href":"https://api.github.com/repos/Mashape/kong/pulls/2530/comments"},"review_comment":{"href":"https://api.github.com/repos/Mashape/kong/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Mashape/kong/pulls/2530/commits"},"statuses":{"href":"https://api.github.com/repos/Mashape/kong/statuses/ace6edfac29698724958a6b9c28a0e7d16b172f0"}}}}
{"actor":{"display_login":"thibaultcha"}}