{"action":"created","comment":{"url":"https://api.github.com/repos/CruGlobal/global_registry/pulls/comments/24164643","id":24164643,"diff_hunk":"@@ -0,0 +1,13 @@\n+require 'resolv'\n+\n+class TrustedIpsValidator < ActiveModel::Validator\n+  def validate(record)\n+    if record.trusted_ips.blank?\n+      record.errors[:base] << 'trusted_ips list may not be empty.'\n+      return","path":"app/validators/trusted_ips_validator.rb","position":7,"original_position":7,"commit_id":"0a07b50f948f79781d222cbae250e9e8032f7a2e","original_commit_id":"0a07b50f948f79781d222cbae250e9e8032f7a2e","user":{"login":"knutsenm","id":8645901,"avatar_url":"https://avatars.githubusercontent.com/u/8645901?v=3","gravatar_id":"","url":"https://api.github.com/users/knutsenm","html_url":"https://github.com/knutsenm","followers_url":"https://api.github.com/users/knutsenm/followers","following_url":"https://api.github.com/users/knutsenm/following{/other_user}","gists_url":"https://api.github.com/users/knutsenm/gists{/gist_id}","starred_url":"https://api.github.com/users/knutsenm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knutsenm/subscriptions","organizations_url":"https://api.github.com/users/knutsenm/orgs","repos_url":"https://api.github.com/users/knutsenm/repos","events_url":"https://api.github.com/users/knutsenm/events{/privacy}","received_events_url":"https://api.github.com/users/knutsenm/received_events","type":"User","site_admin":false},"body":"That does not cover the case when trusted_ips is nil, and .each would yield an error. I couldn't decide if that was truly impossible, or just possible-in-a-way-I-can't-think-of-right-now.","created_at":"2015-02-05T14:09:30Z","updated_at":"2015-02-05T14:09:30Z","html_url":"https://github.com/CruGlobal/global_registry/pull/57#discussion_r24164643","pull_request_url":"https://api.github.com/repos/CruGlobal/global_registry/pulls/57","_links":{"self":{"href":"https://api.github.com/repos/CruGlobal/global_registry/pulls/comments/24164643"},"html":{"href":"https://github.com/CruGlobal/global_registry/pull/57#discussion_r24164643"},"pull_request":{"href":"https://api.github.com/repos/CruGlobal/global_registry/pulls/57"}}},"pull_request":{"url":"https://api.github.com/repos/CruGlobal/global_registry/pulls/57","id":28669116,"html_url":"https://github.com/CruGlobal/global_registry/pull/57","diff_url":"https://github.com/CruGlobal/global_registry/pull/57.diff","patch_url":"https://github.com/CruGlobal/global_registry/pull/57.patch","issue_url":"https://api.github.com/repos/CruGlobal/global_registry/issues/57","number":57,"state":"open","locked":false,"title":"GR-37, whitelist trusted IPs","user":{"login":"knutsenm","id":8645901,"avatar_url":"https://avatars.githubusercontent.com/u/8645901?v=3","gravatar_id":"","url":"https://api.github.com/users/knutsenm","html_url":"https://github.com/knutsenm","followers_url":"https://api.github.com/users/knutsenm/followers","following_url":"https://api.github.com/users/knutsenm/following{/other_user}","gists_url":"https://api.github.com/users/knutsenm/gists{/gist_id}","starred_url":"https://api.github.com/users/knutsenm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knutsenm/subscriptions","organizations_url":"https://api.github.com/users/knutsenm/orgs","repos_url":"https://api.github.com/users/knutsenm/repos","events_url":"https://api.github.com/users/knutsenm/events{/privacy}","received_events_url":"https://api.github.com/users/knutsenm/received_events","type":"User","site_admin":false},"body":"Take Two: same great taste, fewer models.\r\n\r\nWith a properly configured list of gr_trusted_proxies per environment, this is ready to be deployed in a mode that allows requests from all IP addresses (gr_allow_all_ips) but logs what would be accepted or rejected. That same mode is used for most rspec tests.\r\n\r\nThere is one outstanding bug (note the :broken test) that may or may not be new.","created_at":"2015-02-04T19:50:54Z","updated_at":"2015-02-05T14:09:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7b53bf9ca7ca1ac811aa55f85542d28b563bf39a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CruGlobal/global_registry/pulls/57/commits","review_comments_url":"https://api.github.com/repos/CruGlobal/global_registry/pulls/57/comments","review_comment_url":"https://api.github.com/repos/CruGlobal/global_registry/pulls/comments/{number}","comments_url":"https://api.github.com/repos/CruGlobal/global_registry/issues/57/comments","statuses_url":"https://api.github.com/repos/CruGlobal/global_registry/statuses/0a07b50f948f79781d222cbae250e9e8032f7a2e","head":{"label":"CruGlobal:GR-37_whitelist_trusted_ips","ref":"GR-37_whitelist_trusted_ips","sha":"0a07b50f948f79781d222cbae250e9e8032f7a2e","user":{"login":"CruGlobal","id":1785912,"avatar_url":"https://avatars.githubusercontent.com/u/1785912?v=3","gravatar_id":"","url":"https://api.github.com/users/CruGlobal","html_url":"https://github.com/CruGlobal","followers_url":"https://api.github.com/users/CruGlobal/followers","following_url":"https://api.github.com/users/CruGlobal/following{/other_user}","gists_url":"https://api.github.com/users/CruGlobal/gists{/gist_id}","starred_url":"https://api.github.com/users/CruGlobal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CruGlobal/subscriptions","organizations_url":"https://api.github.com/users/CruGlobal/orgs","repos_url":"https://api.github.com/users/CruGlobal/repos","events_url":"https://api.github.com/users/CruGlobal/events{/privacy}","received_events_url":"https://api.github.com/users/CruGlobal/received_events","type":"Organization","site_admin":false},"repo":{"id":8959584,"name":"global_registry","full_name":"CruGlobal/global_registry","owner":{"login":"CruGlobal","id":1785912,"avatar_url":"https://avatars.githubusercontent.com/u/1785912?v=3","gravatar_id":"","url":"https://api.github.com/users/CruGlobal","html_url":"https://github.com/CruGlobal","followers_url":"https://api.github.com/users/CruGlobal/followers","following_url":"https://api.github.com/users/CruGlobal/following{/other_user}","gists_url":"https://api.github.com/users/CruGlobal/gists{/gist_id}","starred_url":"https://api.github.com/users/CruGlobal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CruGlobal/subscriptions","organizations_url":"https://api.github.com/users/CruGlobal/orgs","repos_url":"https://api.github.com/users/CruGlobal/repos","events_url":"https://api.github.com/users/CruGlobal/events{/privacy}","received_events_url":"https://api.github.com/users/CruGlobal/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CruGlobal/global_registry","description":"","fork":false,"url":"https://api.github.com/repos/CruGlobal/global_registry","forks_url":"https://api.github.com/repos/CruGlobal/global_registry/forks","keys_url":"https://api.github.com/repos/CruGlobal/global_registry/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CruGlobal/global_registry/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CruGlobal/global_registry/teams","hooks_url":"https://api.github.com/repos/CruGlobal/global_registry/hooks","issue_events_url":"https://api.github.com/repos/CruGlobal/global_registry/issues/events{/number}","events_url":"https://api.github.com/repos/CruGlobal/global_registry/events","assignees_url":"https://api.github.com/repos/CruGlobal/global_registry/assignees{/user}","branches_url":"https://api.github.com/repos/CruGlobal/global_registry/branches{/branch}","tags_url":"https://api.github.com/repos/CruGlobal/global_registry/tags","blobs_url":"https://api.github.com/repos/CruGlobal/global_registry/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CruGlobal/global_registry/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CruGlobal/global_registry/git/refs{/sha}","trees_url":"https://api.github.com/repos/CruGlobal/global_registry/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CruGlobal/global_registry/statuses/{sha}","languages_url":"https://api.github.com/repos/CruGlobal/global_registry/languages","stargazers_url":"https://api.github.com/repos/CruGlobal/global_registry/stargazers","contributors_url":"https://api.github.com/repos/CruGlobal/global_registry/contributors","subscribers_url":"https://api.github.com/repos/CruGlobal/global_registry/subscribers","subscription_url":"https://api.github.com/repos/CruGlobal/global_registry/subscription","commits_url":"https://api.github.com/repos/CruGlobal/global_registry/commits{/sha}","git_commits_url":"https://api.github.com/repos/CruGlobal/global_registry/git/commits{/sha}","comments_url":"https://api.github.com/repos/CruGlobal/global_registry/comments{/number}","issue_comment_url":"https://api.github.com/repos/CruGlobal/global_registry/issues/comments/{number}","contents_url":"https://api.github.com/repos/CruGlobal/global_registry/contents/{+path}","compare_url":"https://api.github.com/repos/CruGlobal/global_registry/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CruGlobal/global_registry/merges","archive_url":"https://api.github.com/repos/CruGlobal/global_registry/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CruGlobal/global_registry/downloads","issues_url":"https://api.github.com/repos/CruGlobal/global_registry/issues{/number}","pulls_url":"https://api.github.com/repos/CruGlobal/global_registry/pulls{/number}","milestones_url":"https://api.github.com/repos/CruGlobal/global_registry/milestones{/number}","notifications_url":"https://api.github.com/repos/CruGlobal/global_registry/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CruGlobal/global_registry/labels{/name}","releases_url":"https://api.github.com/repos/CruGlobal/global_registry/releases{/id}","created_at":"2013-03-22T19:46:18Z","updated_at":"2015-01-31T22:25:24Z","pushed_at":"2015-02-04T19:46:00Z","git_url":"git://github.com/CruGlobal/global_registry.git","ssh_url":"git@github.com:CruGlobal/global_registry.git","clone_url":"https://github.com/CruGlobal/global_registry.git","svn_url":"https://github.com/CruGlobal/global_registry","homepage":null,"size":62321,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":2,"default_branch":"master"}},"base":{"label":"CruGlobal:master","ref":"master","sha":"b770857e312a177befcc206be93b8251b8f22c47","user":{"login":"CruGlobal","id":1785912,"avatar_url":"https://avatars.githubusercontent.com/u/1785912?v=3","gravatar_id":"","url":"https://api.github.com/users/CruGlobal","html_url":"https://github.com/CruGlobal","followers_url":"https://api.github.com/users/CruGlobal/followers","following_url":"https://api.github.com/users/CruGlobal/following{/other_user}","gists_url":"https://api.github.com/users/CruGlobal/gists{/gist_id}","starred_url":"https://api.github.com/users/CruGlobal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CruGlobal/subscriptions","organizations_url":"https://api.github.com/users/CruGlobal/orgs","repos_url":"https://api.github.com/users/CruGlobal/repos","events_url":"https://api.github.com/users/CruGlobal/events{/privacy}","received_events_url":"https://api.github.com/users/CruGlobal/received_events","type":"Organization","site_admin":false},"repo":{"id":8959584,"name":"global_registry","full_name":"CruGlobal/global_registry","owner":{"login":"CruGlobal","id":1785912,"avatar_url":"https://avatars.githubusercontent.com/u/1785912?v=3","gravatar_id":"","url":"https://api.github.com/users/CruGlobal","html_url":"https://github.com/CruGlobal","followers_url":"https://api.github.com/users/CruGlobal/followers","following_url":"https://api.github.com/users/CruGlobal/following{/other_user}","gists_url":"https://api.github.com/users/CruGlobal/gists{/gist_id}","starred_url":"https://api.github.com/users/CruGlobal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CruGlobal/subscriptions","organizations_url":"https://api.github.com/users/CruGlobal/orgs","repos_url":"https://api.github.com/users/CruGlobal/repos","events_url":"https://api.github.com/users/CruGlobal/events{/privacy}","received_events_url":"https://api.github.com/users/CruGlobal/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CruGlobal/global_registry","description":"","fork":false,"url":"https://api.github.com/repos/CruGlobal/global_registry","forks_url":"https://api.github.com/repos/CruGlobal/global_registry/forks","keys_url":"https://api.github.com/repos/CruGlobal/global_registry/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CruGlobal/global_registry/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CruGlobal/global_registry/teams","hooks_url":"https://api.github.com/repos/CruGlobal/global_registry/hooks","issue_events_url":"https://api.github.com/repos/CruGlobal/global_registry/issues/events{/number}","events_url":"https://api.github.com/repos/CruGlobal/global_registry/events","assignees_url":"https://api.github.com/repos/CruGlobal/global_registry/assignees{/user}","branches_url":"https://api.github.com/repos/CruGlobal/global_registry/branches{/branch}","tags_url":"https://api.github.com/repos/CruGlobal/global_registry/tags","blobs_url":"https://api.github.com/repos/CruGlobal/global_registry/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CruGlobal/global_registry/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CruGlobal/global_registry/git/refs{/sha}","trees_url":"https://api.github.com/repos/CruGlobal/global_registry/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CruGlobal/global_registry/statuses/{sha}","languages_url":"https://api.github.com/repos/CruGlobal/global_registry/languages","stargazers_url":"https://api.github.com/repos/CruGlobal/global_registry/stargazers","contributors_url":"https://api.github.com/repos/CruGlobal/global_registry/contributors","subscribers_url":"https://api.github.com/repos/CruGlobal/global_registry/subscribers","subscription_url":"https://api.github.com/repos/CruGlobal/global_registry/subscription","commits_url":"https://api.github.com/repos/CruGlobal/global_registry/commits{/sha}","git_commits_url":"https://api.github.com/repos/CruGlobal/global_registry/git/commits{/sha}","comments_url":"https://api.github.com/repos/CruGlobal/global_registry/comments{/number}","issue_comment_url":"https://api.github.com/repos/CruGlobal/global_registry/issues/comments/{number}","contents_url":"https://api.github.com/repos/CruGlobal/global_registry/contents/{+path}","compare_url":"https://api.github.com/repos/CruGlobal/global_registry/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CruGlobal/global_registry/merges","archive_url":"https://api.github.com/repos/CruGlobal/global_registry/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CruGlobal/global_registry/downloads","issues_url":"https://api.github.com/repos/CruGlobal/global_registry/issues{/number}","pulls_url":"https://api.github.com/repos/CruGlobal/global_registry/pulls{/number}","milestones_url":"https://api.github.com/repos/CruGlobal/global_registry/milestones{/number}","notifications_url":"https://api.github.com/repos/CruGlobal/global_registry/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CruGlobal/global_registry/labels{/name}","releases_url":"https://api.github.com/repos/CruGlobal/global_registry/releases{/id}","created_at":"2013-03-22T19:46:18Z","updated_at":"2015-01-31T22:25:24Z","pushed_at":"2015-02-04T19:46:00Z","git_url":"git://github.com/CruGlobal/global_registry.git","ssh_url":"git@github.com:CruGlobal/global_registry.git","clone_url":"https://github.com/CruGlobal/global_registry.git","svn_url":"https://github.com/CruGlobal/global_registry","homepage":null,"size":62321,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CruGlobal/global_registry/pulls/57"},"html":{"href":"https://github.com/CruGlobal/global_registry/pull/57"},"issue":{"href":"https://api.github.com/repos/CruGlobal/global_registry/issues/57"},"comments":{"href":"https://api.github.com/repos/CruGlobal/global_registry/issues/57/comments"},"review_comments":{"href":"https://api.github.com/repos/CruGlobal/global_registry/pulls/57/comments"},"review_comment":{"href":"https://api.github.com/repos/CruGlobal/global_registry/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/CruGlobal/global_registry/pulls/57/commits"},"statuses":{"href":"https://api.github.com/repos/CruGlobal/global_registry/statuses/0a07b50f948f79781d222cbae250e9e8032f7a2e"}}}}