{"action":"created","comment":{"url":"https://api.github.com/repos/MysteriumNetwork/api/pulls/comments/158776124","pull_request_review_id":85630163,"id":158776124,"diff_hunk":"@@ -0,0 +1,45 @@\n+import requests\n+from eth_keys import keys\n+import json\n+import base64\n+\n+\n+def print_payload_signature():\n+    pk = keys.PrivateKey(b'\\x01' * 32)\n+\n+    payload = {\n+        \"service_proposal\": {\n+            \"id\": 1,\n+            \"format\": \"service-proposal/v1\",\n+            \"provider_id\": \"node1\",\n+        }\n+    }\n+\n+    signature = pk.sign_msg(json.dumps(payload))\n+    print json.dumps(payload)\n+    print pk.public_key.to_checksum_address().lower()\n+    print base64.b64encode(signature.to_bytes())\n+\n+\n+def test_signed_payload():\n+    payload = {\n+        \"service_proposal\": {\n+            \"id\": 1,\n+            \"format\": \"service-proposal/v1\",\n+            \"provider_id\": \"node1\",\n+        }\n+    }\n+\n+    headers = {\n+        \"identity\": \"0x1a642f0e3c3af545e7acbd38b07251b3990914f1\",\n+        'signature': \"Da1mAwK5abmXQCNsCE+YjsZbR9jTyEKqdrjxxMKwNzwr2NFnM35UiVQJWcg8rgL+X2PR60LoIUMlGU9OPaSoZwE=\"\n+    }\n+\n+    re = requests.post(\n+        'http://127.0.0.1:5000/v1/signed_payload',\n+        data=json.dumps(payload),\n+        headers=headers\n+    )\n+    print re.content","path":"tests/test_signed_payload.py","position":43,"original_position":43,"commit_id":"99a958e581de93160e0daeae8db0b455daaeda84","original_commit_id":"99a958e581de93160e0daeae8db0b455daaeda84","user":{"login":"donce","id":1409983,"avatar_url":"https://avatars0.githubusercontent.com/u/1409983?v=4","gravatar_id":"","url":"https://api.github.com/users/donce","html_url":"https://github.com/donce","followers_url":"https://api.github.com/users/donce/followers","following_url":"https://api.github.com/users/donce/following{/other_user}","gists_url":"https://api.github.com/users/donce/gists{/gist_id}","starred_url":"https://api.github.com/users/donce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donce/subscriptions","organizations_url":"https://api.github.com/users/donce/orgs","repos_url":"https://api.github.com/users/donce/repos","events_url":"https://api.github.com/users/donce/events{/privacy}","received_events_url":"https://api.github.com/users/donce/received_events","type":"User","site_admin":false},"body":"Can we assert for status=200 in this test?\r\nAlso, perhaps asserting validation failure (status=401) is valuable as well?","created_at":"2017-12-27T08:02:09Z","updated_at":"2017-12-27T08:02:09Z","html_url":"https://github.com/MysteriumNetwork/api/pull/2#discussion_r158776124","pull_request_url":"https://api.github.com/repos/MysteriumNetwork/api/pulls/2","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/MysteriumNetwork/api/pulls/comments/158776124"},"html":{"href":"https://github.com/MysteriumNetwork/api/pull/2#discussion_r158776124"},"pull_request":{"href":"https://api.github.com/repos/MysteriumNetwork/api/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/MysteriumNetwork/api/pulls/2","id":158406530,"html_url":"https://github.com/MysteriumNetwork/api/pull/2","diff_url":"https://github.com/MysteriumNetwork/api/pull/2.diff","patch_url":"https://github.com/MysteriumNetwork/api/pull/2.patch","issue_url":"https://api.github.com/repos/MysteriumNetwork/api/issues/2","number":2,"state":"open","locked":false,"title":"MYST-106 verify identity with API endpoint example","user":{"login":"interro","id":1106290,"avatar_url":"https://avatars3.githubusercontent.com/u/1106290?v=4","gravatar_id":"","url":"https://api.github.com/users/interro","html_url":"https://github.com/interro","followers_url":"https://api.github.com/users/interro/followers","following_url":"https://api.github.com/users/interro/following{/other_user}","gists_url":"https://api.github.com/users/interro/gists{/gist_id}","starred_url":"https://api.github.com/users/interro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/interro/subscriptions","organizations_url":"https://api.github.com/users/interro/orgs","repos_url":"https://api.github.com/users/interro/repos","events_url":"https://api.github.com/users/interro/events{/privacy}","received_events_url":"https://api.github.com/users/interro/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-12-14T16:42:32Z","updated_at":"2017-12-27T08:02:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"617968bd37ba81dac73c4b41ea7cd9bfcedda493","assignee":null,"assignees":[],"requested_reviewers":[{"login":"ignasbernotas","id":402965,"avatar_url":"https://avatars2.githubusercontent.com/u/402965?v=4","gravatar_id":"","url":"https://api.github.com/users/ignasbernotas","html_url":"https://github.com/ignasbernotas","followers_url":"https://api.github.com/users/ignasbernotas/followers","following_url":"https://api.github.com/users/ignasbernotas/following{/other_user}","gists_url":"https://api.github.com/users/ignasbernotas/gists{/gist_id}","starred_url":"https://api.github.com/users/ignasbernotas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ignasbernotas/subscriptions","organizations_url":"https://api.github.com/users/ignasbernotas/orgs","repos_url":"https://api.github.com/users/ignasbernotas/repos","events_url":"https://api.github.com/users/ignasbernotas/events{/privacy}","received_events_url":"https://api.github.com/users/ignasbernotas/received_events","type":"User","site_admin":false},{"login":"tadovas","id":1046590,"avatar_url":"https://avatars3.githubusercontent.com/u/1046590?v=4","gravatar_id":"","url":"https://api.github.com/users/tadovas","html_url":"https://github.com/tadovas","followers_url":"https://api.github.com/users/tadovas/followers","following_url":"https://api.github.com/users/tadovas/following{/other_user}","gists_url":"https://api.github.com/users/tadovas/gists{/gist_id}","starred_url":"https://api.github.com/users/tadovas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tadovas/subscriptions","organizations_url":"https://api.github.com/users/tadovas/orgs","repos_url":"https://api.github.com/users/tadovas/repos","events_url":"https://api.github.com/users/tadovas/events{/privacy}","received_events_url":"https://api.github.com/users/tadovas/received_events","type":"User","site_admin":false},{"login":"zolia","id":13434315,"avatar_url":"https://avatars3.githubusercontent.com/u/13434315?v=4","gravatar_id":"","url":"https://api.github.com/users/zolia","html_url":"https://github.com/zolia","followers_url":"https://api.github.com/users/zolia/followers","following_url":"https://api.github.com/users/zolia/following{/other_user}","gists_url":"https://api.github.com/users/zolia/gists{/gist_id}","starred_url":"https://api.github.com/users/zolia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zolia/subscriptions","organizations_url":"https://api.github.com/users/zolia/orgs","repos_url":"https://api.github.com/users/zolia/repos","events_url":"https://api.github.com/users/zolia/events{/privacy}","received_events_url":"https://api.github.com/users/zolia/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/MysteriumNetwork/api/pulls/2/commits","review_comments_url":"https://api.github.com/repos/MysteriumNetwork/api/pulls/2/comments","review_comment_url":"https://api.github.com/repos/MysteriumNetwork/api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MysteriumNetwork/api/issues/2/comments","statuses_url":"https://api.github.com/repos/MysteriumNetwork/api/statuses/99a958e581de93160e0daeae8db0b455daaeda84","head":{"label":"MysteriumNetwork:feature/MYST-106-verify-identity","ref":"feature/MYST-106-verify-identity","sha":"99a958e581de93160e0daeae8db0b455daaeda84","user":{"login":"MysteriumNetwork","id":23056638,"avatar_url":"https://avatars3.githubusercontent.com/u/23056638?v=4","gravatar_id":"","url":"https://api.github.com/users/MysteriumNetwork","html_url":"https://github.com/MysteriumNetwork","followers_url":"https://api.github.com/users/MysteriumNetwork/followers","following_url":"https://api.github.com/users/MysteriumNetwork/following{/other_user}","gists_url":"https://api.github.com/users/MysteriumNetwork/gists{/gist_id}","starred_url":"https://api.github.com/users/MysteriumNetwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MysteriumNetwork/subscriptions","organizations_url":"https://api.github.com/users/MysteriumNetwork/orgs","repos_url":"https://api.github.com/users/MysteriumNetwork/repos","events_url":"https://api.github.com/users/MysteriumNetwork/events{/privacy}","received_events_url":"https://api.github.com/users/MysteriumNetwork/received_events","type":"Organization","site_admin":false},"repo":{"id":80073454,"name":"api","full_name":"MysteriumNetwork/api","owner":{"login":"MysteriumNetwork","id":23056638,"avatar_url":"https://avatars3.githubusercontent.com/u/23056638?v=4","gravatar_id":"","url":"https://api.github.com/users/MysteriumNetwork","html_url":"https://github.com/MysteriumNetwork","followers_url":"https://api.github.com/users/MysteriumNetwork/followers","following_url":"https://api.github.com/users/MysteriumNetwork/following{/other_user}","gists_url":"https://api.github.com/users/MysteriumNetwork/gists{/gist_id}","starred_url":"https://api.github.com/users/MysteriumNetwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MysteriumNetwork/subscriptions","organizations_url":"https://api.github.com/users/MysteriumNetwork/orgs","repos_url":"https://api.github.com/users/MysteriumNetwork/repos","events_url":"https://api.github.com/users/MysteriumNetwork/events{/privacy}","received_events_url":"https://api.github.com/users/MysteriumNetwork/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MysteriumNetwork/api","description":null,"fork":false,"url":"https://api.github.com/repos/MysteriumNetwork/api","forks_url":"https://api.github.com/repos/MysteriumNetwork/api/forks","keys_url":"https://api.github.com/repos/MysteriumNetwork/api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MysteriumNetwork/api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MysteriumNetwork/api/teams","hooks_url":"https://api.github.com/repos/MysteriumNetwork/api/hooks","issue_events_url":"https://api.github.com/repos/MysteriumNetwork/api/issues/events{/number}","events_url":"https://api.github.com/repos/MysteriumNetwork/api/events","assignees_url":"https://api.github.com/repos/MysteriumNetwork/api/assignees{/user}","branches_url":"https://api.github.com/repos/MysteriumNetwork/api/branches{/branch}","tags_url":"https://api.github.com/repos/MysteriumNetwork/api/tags","blobs_url":"https://api.github.com/repos/MysteriumNetwork/api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MysteriumNetwork/api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MysteriumNetwork/api/git/refs{/sha}","trees_url":"https://api.github.com/repos/MysteriumNetwork/api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MysteriumNetwork/api/statuses/{sha}","languages_url":"https://api.github.com/repos/MysteriumNetwork/api/languages","stargazers_url":"https://api.github.com/repos/MysteriumNetwork/api/stargazers","contributors_url":"https://api.github.com/repos/MysteriumNetwork/api/contributors","subscribers_url":"https://api.github.com/repos/MysteriumNetwork/api/subscribers","subscription_url":"https://api.github.com/repos/MysteriumNetwork/api/subscription","commits_url":"https://api.github.com/repos/MysteriumNetwork/api/commits{/sha}","git_commits_url":"https://api.github.com/repos/MysteriumNetwork/api/git/commits{/sha}","comments_url":"https://api.github.com/repos/MysteriumNetwork/api/comments{/number}","issue_comment_url":"https://api.github.com/repos/MysteriumNetwork/api/issues/comments{/number}","contents_url":"https://api.github.com/repos/MysteriumNetwork/api/contents/{+path}","compare_url":"https://api.github.com/repos/MysteriumNetwork/api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MysteriumNetwork/api/merges","archive_url":"https://api.github.com/repos/MysteriumNetwork/api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MysteriumNetwork/api/downloads","issues_url":"https://api.github.com/repos/MysteriumNetwork/api/issues{/number}","pulls_url":"https://api.github.com/repos/MysteriumNetwork/api/pulls{/number}","milestones_url":"https://api.github.com/repos/MysteriumNetwork/api/milestones{/number}","notifications_url":"https://api.github.com/repos/MysteriumNetwork/api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MysteriumNetwork/api/labels{/name}","releases_url":"https://api.github.com/repos/MysteriumNetwork/api/releases{/id}","deployments_url":"https://api.github.com/repos/MysteriumNetwork/api/deployments","created_at":"2017-01-26T00:49:03Z","updated_at":"2017-12-20T15:04:46Z","pushed_at":"2017-12-22T16:42:24Z","git_url":"git://github.com/MysteriumNetwork/api.git","ssh_url":"git@github.com:MysteriumNetwork/api.git","clone_url":"https://github.com/MysteriumNetwork/api.git","svn_url":"https://github.com/MysteriumNetwork/api","homepage":null,"size":35,"stargazers_count":13,"watchers_count":13,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":3,"open_issues":2,"watchers":13,"default_branch":"master"}},"base":{"label":"MysteriumNetwork:release/v1","ref":"release/v1","sha":"b782f1b4072fe245f6193fc1f97012f72fd7d890","user":{"login":"MysteriumNetwork","id":23056638,"avatar_url":"https://avatars3.githubusercontent.com/u/23056638?v=4","gravatar_id":"","url":"https://api.github.com/users/MysteriumNetwork","html_url":"https://github.com/MysteriumNetwork","followers_url":"https://api.github.com/users/MysteriumNetwork/followers","following_url":"https://api.github.com/users/MysteriumNetwork/following{/other_user}","gists_url":"https://api.github.com/users/MysteriumNetwork/gists{/gist_id}","starred_url":"https://api.github.com/users/MysteriumNetwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MysteriumNetwork/subscriptions","organizations_url":"https://api.github.com/users/MysteriumNetwork/orgs","repos_url":"https://api.github.com/users/MysteriumNetwork/repos","events_url":"https://api.github.com/users/MysteriumNetwork/events{/privacy}","received_events_url":"https://api.github.com/users/MysteriumNetwork/received_events","type":"Organization","site_admin":false},"repo":{"id":80073454,"name":"api","full_name":"MysteriumNetwork/api","owner":{"login":"MysteriumNetwork","id":23056638,"avatar_url":"https://avatars3.githubusercontent.com/u/23056638?v=4","gravatar_id":"","url":"https://api.github.com/users/MysteriumNetwork","html_url":"https://github.com/MysteriumNetwork","followers_url":"https://api.github.com/users/MysteriumNetwork/followers","following_url":"https://api.github.com/users/MysteriumNetwork/following{/other_user}","gists_url":"https://api.github.com/users/MysteriumNetwork/gists{/gist_id}","starred_url":"https://api.github.com/users/MysteriumNetwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MysteriumNetwork/subscriptions","organizations_url":"https://api.github.com/users/MysteriumNetwork/orgs","repos_url":"https://api.github.com/users/MysteriumNetwork/repos","events_url":"https://api.github.com/users/MysteriumNetwork/events{/privacy}","received_events_url":"https://api.github.com/users/MysteriumNetwork/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MysteriumNetwork/api","description":null,"fork":false,"url":"https://api.github.com/repos/MysteriumNetwork/api","forks_url":"https://api.github.com/repos/MysteriumNetwork/api/forks","keys_url":"https://api.github.com/repos/MysteriumNetwork/api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MysteriumNetwork/api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MysteriumNetwork/api/teams","hooks_url":"https://api.github.com/repos/MysteriumNetwork/api/hooks","issue_events_url":"https://api.github.com/repos/MysteriumNetwork/api/issues/events{/number}","events_url":"https://api.github.com/repos/MysteriumNetwork/api/events","assignees_url":"https://api.github.com/repos/MysteriumNetwork/api/assignees{/user}","branches_url":"https://api.github.com/repos/MysteriumNetwork/api/branches{/branch}","tags_url":"https://api.github.com/repos/MysteriumNetwork/api/tags","blobs_url":"https://api.github.com/repos/MysteriumNetwork/api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MysteriumNetwork/api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MysteriumNetwork/api/git/refs{/sha}","trees_url":"https://api.github.com/repos/MysteriumNetwork/api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MysteriumNetwork/api/statuses/{sha}","languages_url":"https://api.github.com/repos/MysteriumNetwork/api/languages","stargazers_url":"https://api.github.com/repos/MysteriumNetwork/api/stargazers","contributors_url":"https://api.github.com/repos/MysteriumNetwork/api/contributors","subscribers_url":"https://api.github.com/repos/MysteriumNetwork/api/subscribers","subscription_url":"https://api.github.com/repos/MysteriumNetwork/api/subscription","commits_url":"https://api.github.com/repos/MysteriumNetwork/api/commits{/sha}","git_commits_url":"https://api.github.com/repos/MysteriumNetwork/api/git/commits{/sha}","comments_url":"https://api.github.com/repos/MysteriumNetwork/api/comments{/number}","issue_comment_url":"https://api.github.com/repos/MysteriumNetwork/api/issues/comments{/number}","contents_url":"https://api.github.com/repos/MysteriumNetwork/api/contents/{+path}","compare_url":"https://api.github.com/repos/MysteriumNetwork/api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MysteriumNetwork/api/merges","archive_url":"https://api.github.com/repos/MysteriumNetwork/api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MysteriumNetwork/api/downloads","issues_url":"https://api.github.com/repos/MysteriumNetwork/api/issues{/number}","pulls_url":"https://api.github.com/repos/MysteriumNetwork/api/pulls{/number}","milestones_url":"https://api.github.com/repos/MysteriumNetwork/api/milestones{/number}","notifications_url":"https://api.github.com/repos/MysteriumNetwork/api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MysteriumNetwork/api/labels{/name}","releases_url":"https://api.github.com/repos/MysteriumNetwork/api/releases{/id}","deployments_url":"https://api.github.com/repos/MysteriumNetwork/api/deployments","created_at":"2017-01-26T00:49:03Z","updated_at":"2017-12-20T15:04:46Z","pushed_at":"2017-12-22T16:42:24Z","git_url":"git://github.com/MysteriumNetwork/api.git","ssh_url":"git@github.com:MysteriumNetwork/api.git","clone_url":"https://github.com/MysteriumNetwork/api.git","svn_url":"https://github.com/MysteriumNetwork/api","homepage":null,"size":35,"stargazers_count":13,"watchers_count":13,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":3,"open_issues":2,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MysteriumNetwork/api/pulls/2"},"html":{"href":"https://github.com/MysteriumNetwork/api/pull/2"},"issue":{"href":"https://api.github.com/repos/MysteriumNetwork/api/issues/2"},"comments":{"href":"https://api.github.com/repos/MysteriumNetwork/api/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/MysteriumNetwork/api/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/MysteriumNetwork/api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MysteriumNetwork/api/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/MysteriumNetwork/api/statuses/99a958e581de93160e0daeae8db0b455daaeda84"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"donce"}}