{"action":"created","comment":{"url":"https://api.github.com/repos/keratin/authn/pulls/comments/93539536","pull_request_review_id":14069707,"id":93539536,"diff_hunk":"@@ -1,35 +1,17 @@\n-require 'json_envelope'\n-\n class ApplicationController < ActionController::API\n-  # when HTTP_REFERER exists, it's a great way to prevent CSRF attacks.\n-  #\n-  # an experiment performed in http://seclab.stanford.edu/websec/csrf/csrf.pdf found the\n-  # header existed for 99.9% of users over HTTPS, even cross-origin. the header appears\n-  # to be primarily suppressed at the network level, not the user agent.\n-  #\n-  # if this is ever determined insufficient, the backup plan is a custom header set by\n-  # compatible javascript. stay stateless!\n-  private def require_trusted_referrer\n-    return if Rails.application.config.application_domains.include?(requesting_audience)\n-    render status: :forbidden, json: JSONEnvelope.errors('referer' => 'is not a trusted host')\n-  end\n+  include AccessControl\n \n-  private def require_api_credentials\n-    auth_strategy = ActionController::HttpAuthentication::Basic\n+  # Unauthorized access means credentials are required but absent.\n+  class AccessUnauthorized < StandardError; end","path":"app/controllers/application_controller.rb","position":21,"original_position":21,"commit_id":"5959570254fa518821f99454f2f954ad20c22b25","original_commit_id":"5959570254fa518821f99454f2f954ad20c22b25","user":{"login":"cainlevy","id":4449,"avatar_url":"https://avatars.githubusercontent.com/u/4449?v=3","gravatar_id":"","url":"https://api.github.com/users/cainlevy","html_url":"https://github.com/cainlevy","followers_url":"https://api.github.com/users/cainlevy/followers","following_url":"https://api.github.com/users/cainlevy/following{/other_user}","gists_url":"https://api.github.com/users/cainlevy/gists{/gist_id}","starred_url":"https://api.github.com/users/cainlevy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cainlevy/subscriptions","organizations_url":"https://api.github.com/users/cainlevy/orgs","repos_url":"https://api.github.com/users/cainlevy/repos","events_url":"https://api.github.com/users/cainlevy/events{/privacy}","received_events_url":"https://api.github.com/users/cainlevy/received_events","type":"User","site_admin":false},"body":"Yeah, I'm gonna go with `AccessUnauthenticated`. Good spot. 🔍 ","created_at":"2016-12-21T23:17:52Z","updated_at":"2016-12-21T23:17:53Z","html_url":"https://github.com/keratin/authn/pull/29#discussion_r93539536","pull_request_url":"https://api.github.com/repos/keratin/authn/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/keratin/authn/pulls/comments/93539536"},"html":{"href":"https://github.com/keratin/authn/pull/29#discussion_r93539536"},"pull_request":{"href":"https://api.github.com/repos/keratin/authn/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/keratin/authn/pulls/29","id":99018706,"html_url":"https://github.com/keratin/authn/pull/29","diff_url":"https://github.com/keratin/authn/pull/29.diff","patch_url":"https://github.com/keratin/authn/pull/29.patch","issue_url":"https://api.github.com/repos/keratin/authn/issues/29","number":29,"state":"closed","locked":false,"title":"more obvious access control","user":{"login":"cainlevy","id":4449,"avatar_url":"https://avatars.githubusercontent.com/u/4449?v=3","gravatar_id":"","url":"https://api.github.com/users/cainlevy","html_url":"https://github.com/cainlevy","followers_url":"https://api.github.com/users/cainlevy/followers","following_url":"https://api.github.com/users/cainlevy/following{/other_user}","gists_url":"https://api.github.com/users/cainlevy/gists{/gist_id}","starred_url":"https://api.github.com/users/cainlevy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cainlevy/subscriptions","organizations_url":"https://api.github.com/users/cainlevy/orgs","repos_url":"https://api.github.com/users/cainlevy/repos","events_url":"https://api.github.com/users/cainlevy/events{/privacy}","received_events_url":"https://api.github.com/users/cainlevy/received_events","type":"User","site_admin":false},"body":"This aims to improve the obviousness of access control strategies. I expect more strategies to come, so the pattern here is intentionally flexible.","created_at":"2016-12-21T22:46:59Z","updated_at":"2016-12-21T23:17:53Z","closed_at":"2016-12-21T22:58:00Z","merged_at":"2016-12-21T22:58:00Z","merge_commit_sha":"5fc253322d724555d7d4df5fb01b0bca0fb6826f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/keratin/authn/pulls/29/commits","review_comments_url":"https://api.github.com/repos/keratin/authn/pulls/29/comments","review_comment_url":"https://api.github.com/repos/keratin/authn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/keratin/authn/issues/29/comments","statuses_url":"https://api.github.com/repos/keratin/authn/statuses/5959570254fa518821f99454f2f954ad20c22b25","head":{"label":"keratin:access_control","ref":"access_control","sha":"5959570254fa518821f99454f2f954ad20c22b25","user":{"login":"keratin","id":23507480,"avatar_url":"https://avatars.githubusercontent.com/u/23507480?v=3","gravatar_id":"","url":"https://api.github.com/users/keratin","html_url":"https://github.com/keratin","followers_url":"https://api.github.com/users/keratin/followers","following_url":"https://api.github.com/users/keratin/following{/other_user}","gists_url":"https://api.github.com/users/keratin/gists{/gist_id}","starred_url":"https://api.github.com/users/keratin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keratin/subscriptions","organizations_url":"https://api.github.com/users/keratin/orgs","repos_url":"https://api.github.com/users/keratin/repos","events_url":"https://api.github.com/users/keratin/events{/privacy}","received_events_url":"https://api.github.com/users/keratin/received_events","type":"Organization","site_admin":false},"repo":{"id":74073177,"name":"authn","full_name":"keratin/authn","owner":{"login":"keratin","id":23507480,"avatar_url":"https://avatars.githubusercontent.com/u/23507480?v=3","gravatar_id":"","url":"https://api.github.com/users/keratin","html_url":"https://github.com/keratin","followers_url":"https://api.github.com/users/keratin/followers","following_url":"https://api.github.com/users/keratin/following{/other_user}","gists_url":"https://api.github.com/users/keratin/gists{/gist_id}","starred_url":"https://api.github.com/users/keratin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keratin/subscriptions","organizations_url":"https://api.github.com/users/keratin/orgs","repos_url":"https://api.github.com/users/keratin/repos","events_url":"https://api.github.com/users/keratin/events{/privacy}","received_events_url":"https://api.github.com/users/keratin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/keratin/authn","description":"Authentication service that keeps you in control without forcing you to be an expert in web security.","fork":false,"url":"https://api.github.com/repos/keratin/authn","forks_url":"https://api.github.com/repos/keratin/authn/forks","keys_url":"https://api.github.com/repos/keratin/authn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keratin/authn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keratin/authn/teams","hooks_url":"https://api.github.com/repos/keratin/authn/hooks","issue_events_url":"https://api.github.com/repos/keratin/authn/issues/events{/number}","events_url":"https://api.github.com/repos/keratin/authn/events","assignees_url":"https://api.github.com/repos/keratin/authn/assignees{/user}","branches_url":"https://api.github.com/repos/keratin/authn/branches{/branch}","tags_url":"https://api.github.com/repos/keratin/authn/tags","blobs_url":"https://api.github.com/repos/keratin/authn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keratin/authn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keratin/authn/git/refs{/sha}","trees_url":"https://api.github.com/repos/keratin/authn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keratin/authn/statuses/{sha}","languages_url":"https://api.github.com/repos/keratin/authn/languages","stargazers_url":"https://api.github.com/repos/keratin/authn/stargazers","contributors_url":"https://api.github.com/repos/keratin/authn/contributors","subscribers_url":"https://api.github.com/repos/keratin/authn/subscribers","subscription_url":"https://api.github.com/repos/keratin/authn/subscription","commits_url":"https://api.github.com/repos/keratin/authn/commits{/sha}","git_commits_url":"https://api.github.com/repos/keratin/authn/git/commits{/sha}","comments_url":"https://api.github.com/repos/keratin/authn/comments{/number}","issue_comment_url":"https://api.github.com/repos/keratin/authn/issues/comments{/number}","contents_url":"https://api.github.com/repos/keratin/authn/contents/{+path}","compare_url":"https://api.github.com/repos/keratin/authn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keratin/authn/merges","archive_url":"https://api.github.com/repos/keratin/authn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keratin/authn/downloads","issues_url":"https://api.github.com/repos/keratin/authn/issues{/number}","pulls_url":"https://api.github.com/repos/keratin/authn/pulls{/number}","milestones_url":"https://api.github.com/repos/keratin/authn/milestones{/number}","notifications_url":"https://api.github.com/repos/keratin/authn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keratin/authn/labels{/name}","releases_url":"https://api.github.com/repos/keratin/authn/releases{/id}","deployments_url":"https://api.github.com/repos/keratin/authn/deployments","created_at":"2016-11-17T22:30:55Z","updated_at":"2016-12-09T02:17:59Z","pushed_at":"2016-12-21T22:58:04Z","git_url":"git://github.com/keratin/authn.git","ssh_url":"git@github.com:keratin/authn.git","clone_url":"https://github.com/keratin/authn.git","svn_url":"https://github.com/keratin/authn","homepage":"https://keratin.tech","size":133,"stargazers_count":4,"watchers_count":4,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":19,"forks":0,"open_issues":19,"watchers":4,"default_branch":"master"}},"base":{"label":"keratin:master","ref":"master","sha":"78fdfa141082e95125906a9df3d510d2e3741747","user":{"login":"keratin","id":23507480,"avatar_url":"https://avatars.githubusercontent.com/u/23507480?v=3","gravatar_id":"","url":"https://api.github.com/users/keratin","html_url":"https://github.com/keratin","followers_url":"https://api.github.com/users/keratin/followers","following_url":"https://api.github.com/users/keratin/following{/other_user}","gists_url":"https://api.github.com/users/keratin/gists{/gist_id}","starred_url":"https://api.github.com/users/keratin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keratin/subscriptions","organizations_url":"https://api.github.com/users/keratin/orgs","repos_url":"https://api.github.com/users/keratin/repos","events_url":"https://api.github.com/users/keratin/events{/privacy}","received_events_url":"https://api.github.com/users/keratin/received_events","type":"Organization","site_admin":false},"repo":{"id":74073177,"name":"authn","full_name":"keratin/authn","owner":{"login":"keratin","id":23507480,"avatar_url":"https://avatars.githubusercontent.com/u/23507480?v=3","gravatar_id":"","url":"https://api.github.com/users/keratin","html_url":"https://github.com/keratin","followers_url":"https://api.github.com/users/keratin/followers","following_url":"https://api.github.com/users/keratin/following{/other_user}","gists_url":"https://api.github.com/users/keratin/gists{/gist_id}","starred_url":"https://api.github.com/users/keratin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keratin/subscriptions","organizations_url":"https://api.github.com/users/keratin/orgs","repos_url":"https://api.github.com/users/keratin/repos","events_url":"https://api.github.com/users/keratin/events{/privacy}","received_events_url":"https://api.github.com/users/keratin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/keratin/authn","description":"Authentication service that keeps you in control without forcing you to be an expert in web security.","fork":false,"url":"https://api.github.com/repos/keratin/authn","forks_url":"https://api.github.com/repos/keratin/authn/forks","keys_url":"https://api.github.com/repos/keratin/authn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keratin/authn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keratin/authn/teams","hooks_url":"https://api.github.com/repos/keratin/authn/hooks","issue_events_url":"https://api.github.com/repos/keratin/authn/issues/events{/number}","events_url":"https://api.github.com/repos/keratin/authn/events","assignees_url":"https://api.github.com/repos/keratin/authn/assignees{/user}","branches_url":"https://api.github.com/repos/keratin/authn/branches{/branch}","tags_url":"https://api.github.com/repos/keratin/authn/tags","blobs_url":"https://api.github.com/repos/keratin/authn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keratin/authn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keratin/authn/git/refs{/sha}","trees_url":"https://api.github.com/repos/keratin/authn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keratin/authn/statuses/{sha}","languages_url":"https://api.github.com/repos/keratin/authn/languages","stargazers_url":"https://api.github.com/repos/keratin/authn/stargazers","contributors_url":"https://api.github.com/repos/keratin/authn/contributors","subscribers_url":"https://api.github.com/repos/keratin/authn/subscribers","subscription_url":"https://api.github.com/repos/keratin/authn/subscription","commits_url":"https://api.github.com/repos/keratin/authn/commits{/sha}","git_commits_url":"https://api.github.com/repos/keratin/authn/git/commits{/sha}","comments_url":"https://api.github.com/repos/keratin/authn/comments{/number}","issue_comment_url":"https://api.github.com/repos/keratin/authn/issues/comments{/number}","contents_url":"https://api.github.com/repos/keratin/authn/contents/{+path}","compare_url":"https://api.github.com/repos/keratin/authn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keratin/authn/merges","archive_url":"https://api.github.com/repos/keratin/authn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keratin/authn/downloads","issues_url":"https://api.github.com/repos/keratin/authn/issues{/number}","pulls_url":"https://api.github.com/repos/keratin/authn/pulls{/number}","milestones_url":"https://api.github.com/repos/keratin/authn/milestones{/number}","notifications_url":"https://api.github.com/repos/keratin/authn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keratin/authn/labels{/name}","releases_url":"https://api.github.com/repos/keratin/authn/releases{/id}","deployments_url":"https://api.github.com/repos/keratin/authn/deployments","created_at":"2016-11-17T22:30:55Z","updated_at":"2016-12-09T02:17:59Z","pushed_at":"2016-12-21T22:58:04Z","git_url":"git://github.com/keratin/authn.git","ssh_url":"git@github.com:keratin/authn.git","clone_url":"https://github.com/keratin/authn.git","svn_url":"https://github.com/keratin/authn","homepage":"https://keratin.tech","size":133,"stargazers_count":4,"watchers_count":4,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":19,"forks":0,"open_issues":19,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/keratin/authn/pulls/29"},"html":{"href":"https://github.com/keratin/authn/pull/29"},"issue":{"href":"https://api.github.com/repos/keratin/authn/issues/29"},"comments":{"href":"https://api.github.com/repos/keratin/authn/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/keratin/authn/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/keratin/authn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/keratin/authn/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/keratin/authn/statuses/5959570254fa518821f99454f2f954ad20c22b25"}}}}
{"actor":{"display_login":"cainlevy"}}