{"action":"created","comment":{"url":"https://api.github.com/repos/grafana/grafana/pulls/comments/234539187","pull_request_review_id":176192225,"id":234539187,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNDUzOTE4Nw==","diff_hunk":"@@ -0,0 +1,19 @@\n+package util\n+\n+import (\n+\t\"crypto/subtle\"\n+\tmacaron \"gopkg.in/macaron.v1\"\n+)\n+\n+// BasicAuthenticated parses the provided HTTP request for basic authentication credentials\n+// and returns true if the provided credentials match the expected username and password.\n+// Returns false if the request is unauthenticated.\n+// Uses constant-time comparison in order to mitigate timing attacks.\n+func BasicAuthenticatedRequest(req macaron.Request, expectedUser, expectedPass string) bool {","path":"pkg/util/auth.go","position":12,"original_position":12,"commit_id":"dcc48860b8ebcd867cde6f4f0afd06d2969c6188","original_commit_id":"dcc48860b8ebcd867cde6f4f0afd06d2969c6188","user":{"login":"bergquist","id":618863,"node_id":"MDQ6VXNlcjYxODg2Mw==","avatar_url":"https://avatars0.githubusercontent.com/u/618863?v=4","gravatar_id":"","url":"https://api.github.com/users/bergquist","html_url":"https://github.com/bergquist","followers_url":"https://api.github.com/users/bergquist/followers","following_url":"https://api.github.com/users/bergquist/following{/other_user}","gists_url":"https://api.github.com/users/bergquist/gists{/gist_id}","starred_url":"https://api.github.com/users/bergquist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bergquist/subscriptions","organizations_url":"https://api.github.com/users/bergquist/orgs","repos_url":"https://api.github.com/users/bergquist/repos","events_url":"https://api.github.com/users/bergquist/events{/privacy}","received_events_url":"https://api.github.com/users/bergquist/received_events","type":"User","site_admin":false},"body":"I don't think this function belongs in the util package. Since its only have one caller. Lets put it in the api packages instead. It would also like some tests for this. \r\n\r\n","created_at":"2018-11-19T09:11:25Z","updated_at":"2018-11-19T09:11:56Z","html_url":"https://github.com/grafana/grafana/pull/14077#discussion_r234539187","pull_request_url":"https://api.github.com/repos/grafana/grafana/pulls/14077","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/grafana/grafana/pulls/comments/234539187"},"html":{"href":"https://github.com/grafana/grafana/pull/14077#discussion_r234539187"},"pull_request":{"href":"https://api.github.com/repos/grafana/grafana/pulls/14077"}}},"pull_request":{"url":"https://api.github.com/repos/grafana/grafana/pulls/14077","id":230975740,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMwOTc1NzQw","html_url":"https://github.com/grafana/grafana/pull/14077","diff_url":"https://github.com/grafana/grafana/pull/14077.diff","patch_url":"https://github.com/grafana/grafana/pull/14077.patch","issue_url":"https://api.github.com/repos/grafana/grafana/issues/14077","number":14077,"state":"open","locked":false,"title":"Add basic authentication support to metrics endpoint","user":{"login":"bobmshannon","id":5983714,"node_id":"MDQ6VXNlcjU5ODM3MTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/5983714?v=4","gravatar_id":"","url":"https://api.github.com/users/bobmshannon","html_url":"https://github.com/bobmshannon","followers_url":"https://api.github.com/users/bobmshannon/followers","following_url":"https://api.github.com/users/bobmshannon/following{/other_user}","gists_url":"https://api.github.com/users/bobmshannon/gists{/gist_id}","starred_url":"https://api.github.com/users/bobmshannon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobmshannon/subscriptions","organizations_url":"https://api.github.com/users/bobmshannon/orgs","repos_url":"https://api.github.com/users/bobmshannon/repos","events_url":"https://api.github.com/users/bobmshannon/events{/privacy}","received_events_url":"https://api.github.com/users/bobmshannon/received_events","type":"User","site_admin":false},"body":"Closes #13577.\r\n\r\n- Adds `metrics.basic_auth_username` and `metrics.basic_auth_password` configuration options that enable and configure basic authentication on the Grafana metrics endpoint.\r\n\r\n","created_at":"2018-11-14T20:45:55Z","updated_at":"2018-11-19T09:11:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"718a7e2a48a702b6f2a5dff2628a6f8465aa4122","assignee":{"login":"bergquist","id":618863,"node_id":"MDQ6VXNlcjYxODg2Mw==","avatar_url":"https://avatars0.githubusercontent.com/u/618863?v=4","gravatar_id":"","url":"https://api.github.com/users/bergquist","html_url":"https://github.com/bergquist","followers_url":"https://api.github.com/users/bergquist/followers","following_url":"https://api.github.com/users/bergquist/following{/other_user}","gists_url":"https://api.github.com/users/bergquist/gists{/gist_id}","starred_url":"https://api.github.com/users/bergquist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bergquist/subscriptions","organizations_url":"https://api.github.com/users/bergquist/orgs","repos_url":"https://api.github.com/users/bergquist/repos","events_url":"https://api.github.com/users/bergquist/events{/privacy}","received_events_url":"https://api.github.com/users/bergquist/received_events","type":"User","site_admin":false},"assignees":[{"login":"bergquist","id":618863,"node_id":"MDQ6VXNlcjYxODg2Mw==","avatar_url":"https://avatars0.githubusercontent.com/u/618863?v=4","gravatar_id":"","url":"https://api.github.com/users/bergquist","html_url":"https://github.com/bergquist","followers_url":"https://api.github.com/users/bergquist/followers","following_url":"https://api.github.com/users/bergquist/following{/other_user}","gists_url":"https://api.github.com/users/bergquist/gists{/gist_id}","starred_url":"https://api.github.com/users/bergquist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bergquist/subscriptions","organizations_url":"https://api.github.com/users/bergquist/orgs","repos_url":"https://api.github.com/users/bergquist/repos","events_url":"https://api.github.com/users/bergquist/events{/privacy}","received_events_url":"https://api.github.com/users/bergquist/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/grafana/grafana/pulls/14077/commits","review_comments_url":"https://api.github.com/repos/grafana/grafana/pulls/14077/comments","review_comment_url":"https://api.github.com/repos/grafana/grafana/pulls/comments{/number}","comments_url":"https://api.github.com/repos/grafana/grafana/issues/14077/comments","statuses_url":"https://api.github.com/repos/grafana/grafana/statuses/dcc48860b8ebcd867cde6f4f0afd06d2969c6188","head":{"label":"bobmshannon:bs/metrics_endpoint_auth","ref":"bs/metrics_endpoint_auth","sha":"dcc48860b8ebcd867cde6f4f0afd06d2969c6188","user":{"login":"bobmshannon","id":5983714,"node_id":"MDQ6VXNlcjU5ODM3MTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/5983714?v=4","gravatar_id":"","url":"https://api.github.com/users/bobmshannon","html_url":"https://github.com/bobmshannon","followers_url":"https://api.github.com/users/bobmshannon/followers","following_url":"https://api.github.com/users/bobmshannon/following{/other_user}","gists_url":"https://api.github.com/users/bobmshannon/gists{/gist_id}","starred_url":"https://api.github.com/users/bobmshannon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobmshannon/subscriptions","organizations_url":"https://api.github.com/users/bobmshannon/orgs","repos_url":"https://api.github.com/users/bobmshannon/repos","events_url":"https://api.github.com/users/bobmshannon/events{/privacy}","received_events_url":"https://api.github.com/users/bobmshannon/received_events","type":"User","site_admin":false},"repo":{"id":144749055,"node_id":"MDEwOlJlcG9zaXRvcnkxNDQ3NDkwNTU=","name":"grafana","full_name":"bobmshannon/grafana","private":false,"owner":{"login":"bobmshannon","id":5983714,"node_id":"MDQ6VXNlcjU5ODM3MTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/5983714?v=4","gravatar_id":"","url":"https://api.github.com/users/bobmshannon","html_url":"https://github.com/bobmshannon","followers_url":"https://api.github.com/users/bobmshannon/followers","following_url":"https://api.github.com/users/bobmshannon/following{/other_user}","gists_url":"https://api.github.com/users/bobmshannon/gists{/gist_id}","starred_url":"https://api.github.com/users/bobmshannon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobmshannon/subscriptions","organizations_url":"https://api.github.com/users/bobmshannon/orgs","repos_url":"https://api.github.com/users/bobmshannon/repos","events_url":"https://api.github.com/users/bobmshannon/events{/privacy}","received_events_url":"https://api.github.com/users/bobmshannon/received_events","type":"User","site_admin":false},"html_url":"https://github.com/bobmshannon/grafana","description":"The tool for beautiful monitoring and metric analytics & dashboards for Graphite, InfluxDB & Prometheus & More","fork":true,"url":"https://api.github.com/repos/bobmshannon/grafana","forks_url":"https://api.github.com/repos/bobmshannon/grafana/forks","keys_url":"https://api.github.com/repos/bobmshannon/grafana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bobmshannon/grafana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bobmshannon/grafana/teams","hooks_url":"https://api.github.com/repos/bobmshannon/grafana/hooks","issue_events_url":"https://api.github.com/repos/bobmshannon/grafana/issues/events{/number}","events_url":"https://api.github.com/repos/bobmshannon/grafana/events","assignees_url":"https://api.github.com/repos/bobmshannon/grafana/assignees{/user}","branches_url":"https://api.github.com/repos/bobmshannon/grafana/branches{/branch}","tags_url":"https://api.github.com/repos/bobmshannon/grafana/tags","blobs_url":"https://api.github.com/repos/bobmshannon/grafana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bobmshannon/grafana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bobmshannon/grafana/git/refs{/sha}","trees_url":"https://api.github.com/repos/bobmshannon/grafana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bobmshannon/grafana/statuses/{sha}","languages_url":"https://api.github.com/repos/bobmshannon/grafana/languages","stargazers_url":"https://api.github.com/repos/bobmshannon/grafana/stargazers","contributors_url":"https://api.github.com/repos/bobmshannon/grafana/contributors","subscribers_url":"https://api.github.com/repos/bobmshannon/grafana/subscribers","subscription_url":"https://api.github.com/repos/bobmshannon/grafana/subscription","commits_url":"https://api.github.com/repos/bobmshannon/grafana/commits{/sha}","git_commits_url":"https://api.github.com/repos/bobmshannon/grafana/git/commits{/sha}","comments_url":"https://api.github.com/repos/bobmshannon/grafana/comments{/number}","issue_comment_url":"https://api.github.com/repos/bobmshannon/grafana/issues/comments{/number}","contents_url":"https://api.github.com/repos/bobmshannon/grafana/contents/{+path}","compare_url":"https://api.github.com/repos/bobmshannon/grafana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bobmshannon/grafana/merges","archive_url":"https://api.github.com/repos/bobmshannon/grafana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bobmshannon/grafana/downloads","issues_url":"https://api.github.com/repos/bobmshannon/grafana/issues{/number}","pulls_url":"https://api.github.com/repos/bobmshannon/grafana/pulls{/number}","milestones_url":"https://api.github.com/repos/bobmshannon/grafana/milestones{/number}","notifications_url":"https://api.github.com/repos/bobmshannon/grafana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bobmshannon/grafana/labels{/name}","releases_url":"https://api.github.com/repos/bobmshannon/grafana/releases{/id}","deployments_url":"https://api.github.com/repos/bobmshannon/grafana/deployments","created_at":"2018-08-14T17:00:42Z","updated_at":"2018-08-14T17:00:49Z","pushed_at":"2018-11-14T22:38:09Z","git_url":"git://github.com/bobmshannon/grafana.git","ssh_url":"git@github.com:bobmshannon/grafana.git","clone_url":"https://github.com/bobmshannon/grafana.git","svn_url":"https://github.com/bobmshannon/grafana","homepage":"https://grafana.com","size":189078,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"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":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"grafana:master","ref":"master","sha":"b47a4954c9b0208869298c75e97c212430565f1e","user":{"login":"grafana","id":7195757,"node_id":"MDEyOk9yZ2FuaXphdGlvbjcxOTU3NTc=","avatar_url":"https://avatars0.githubusercontent.com/u/7195757?v=4","gravatar_id":"","url":"https://api.github.com/users/grafana","html_url":"https://github.com/grafana","followers_url":"https://api.github.com/users/grafana/followers","following_url":"https://api.github.com/users/grafana/following{/other_user}","gists_url":"https://api.github.com/users/grafana/gists{/gist_id}","starred_url":"https://api.github.com/users/grafana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grafana/subscriptions","organizations_url":"https://api.github.com/users/grafana/orgs","repos_url":"https://api.github.com/users/grafana/repos","events_url":"https://api.github.com/users/grafana/events{/privacy}","received_events_url":"https://api.github.com/users/grafana/received_events","type":"Organization","site_admin":false},"repo":{"id":15111821,"node_id":"MDEwOlJlcG9zaXRvcnkxNTExMTgyMQ==","name":"grafana","full_name":"grafana/grafana","private":false,"owner":{"login":"grafana","id":7195757,"node_id":"MDEyOk9yZ2FuaXphdGlvbjcxOTU3NTc=","avatar_url":"https://avatars0.githubusercontent.com/u/7195757?v=4","gravatar_id":"","url":"https://api.github.com/users/grafana","html_url":"https://github.com/grafana","followers_url":"https://api.github.com/users/grafana/followers","following_url":"https://api.github.com/users/grafana/following{/other_user}","gists_url":"https://api.github.com/users/grafana/gists{/gist_id}","starred_url":"https://api.github.com/users/grafana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grafana/subscriptions","organizations_url":"https://api.github.com/users/grafana/orgs","repos_url":"https://api.github.com/users/grafana/repos","events_url":"https://api.github.com/users/grafana/events{/privacy}","received_events_url":"https://api.github.com/users/grafana/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/grafana/grafana","description":"The tool for beautiful monitoring and metric analytics & dashboards for Graphite, InfluxDB & Prometheus & More","fork":false,"url":"https://api.github.com/repos/grafana/grafana","forks_url":"https://api.github.com/repos/grafana/grafana/forks","keys_url":"https://api.github.com/repos/grafana/grafana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/grafana/grafana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/grafana/grafana/teams","hooks_url":"https://api.github.com/repos/grafana/grafana/hooks","issue_events_url":"https://api.github.com/repos/grafana/grafana/issues/events{/number}","events_url":"https://api.github.com/repos/grafana/grafana/events","assignees_url":"https://api.github.com/repos/grafana/grafana/assignees{/user}","branches_url":"https://api.github.com/repos/grafana/grafana/branches{/branch}","tags_url":"https://api.github.com/repos/grafana/grafana/tags","blobs_url":"https://api.github.com/repos/grafana/grafana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/grafana/grafana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/grafana/grafana/git/refs{/sha}","trees_url":"https://api.github.com/repos/grafana/grafana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/grafana/grafana/statuses/{sha}","languages_url":"https://api.github.com/repos/grafana/grafana/languages","stargazers_url":"https://api.github.com/repos/grafana/grafana/stargazers","contributors_url":"https://api.github.com/repos/grafana/grafana/contributors","subscribers_url":"https://api.github.com/repos/grafana/grafana/subscribers","subscription_url":"https://api.github.com/repos/grafana/grafana/subscription","commits_url":"https://api.github.com/repos/grafana/grafana/commits{/sha}","git_commits_url":"https://api.github.com/repos/grafana/grafana/git/commits{/sha}","comments_url":"https://api.github.com/repos/grafana/grafana/comments{/number}","issue_comment_url":"https://api.github.com/repos/grafana/grafana/issues/comments{/number}","contents_url":"https://api.github.com/repos/grafana/grafana/contents/{+path}","compare_url":"https://api.github.com/repos/grafana/grafana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/grafana/grafana/merges","archive_url":"https://api.github.com/repos/grafana/grafana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/grafana/grafana/downloads","issues_url":"https://api.github.com/repos/grafana/grafana/issues{/number}","pulls_url":"https://api.github.com/repos/grafana/grafana/pulls{/number}","milestones_url":"https://api.github.com/repos/grafana/grafana/milestones{/number}","notifications_url":"https://api.github.com/repos/grafana/grafana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/grafana/grafana/labels{/name}","releases_url":"https://api.github.com/repos/grafana/grafana/releases{/id}","deployments_url":"https://api.github.com/repos/grafana/grafana/deployments","created_at":"2013-12-11T15:59:56Z","updated_at":"2018-11-19T08:44:24Z","pushed_at":"2018-11-19T08:32:28Z","git_url":"git://github.com/grafana/grafana.git","ssh_url":"git@github.com:grafana/grafana.git","clone_url":"https://github.com/grafana/grafana.git","svn_url":"https://github.com/grafana/grafana","homepage":"https://grafana.com","size":190158,"stargazers_count":24927,"watchers_count":24927,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4552,"mirror_url":null,"archived":false,"open_issues_count":1547,"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":4552,"open_issues":1547,"watchers":24927,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/grafana/grafana/pulls/14077"},"html":{"href":"https://github.com/grafana/grafana/pull/14077"},"issue":{"href":"https://api.github.com/repos/grafana/grafana/issues/14077"},"comments":{"href":"https://api.github.com/repos/grafana/grafana/issues/14077/comments"},"review_comments":{"href":"https://api.github.com/repos/grafana/grafana/pulls/14077/comments"},"review_comment":{"href":"https://api.github.com/repos/grafana/grafana/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/grafana/grafana/pulls/14077/commits"},"statuses":{"href":"https://api.github.com/repos/grafana/grafana/statuses/dcc48860b8ebcd867cde6f4f0afd06d2969c6188"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"bergquist"}}