{"action":"created","comment":{"url":"https://api.github.com/repos/clearhaus/pedicel/pulls/comments/198147157","pull_request_review_id":132023768,"id":198147157,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5ODE0NzE1Nw==","diff_hunk":"@@ -0,0 +1,95 @@\n+require 'pedicel/validator'\n+require 'expectations/schema'\n+require 'lib/pedicel/validator/helper'\n+\n+describe 'Pedicel::Validator::TokenSchema' do\n+  let(:ts) { Pedicel::Validator::TokenSchema }\n+  let(:token_h) { token.to_hash }\n+  subject { token_h }\n+\n+  context 'wrong data' do\n+    it 'errs when data is missing' do\n+      token_h.delete('data')\n+      is_expected.to dissatisfy_schema(ts, data: ['is missing'])\n+    end\n+\n+    it 'errs when data is not a string' do\n+      token_h['data'] = [1,2,3]\n+      is_expected.to dissatisfy_schema(ts, data: ['must be a string'])\n+\n+      token_h['data'] = { :'a string as a hash key' => 'a string in a hash value' }\n+      is_expected.to dissatisfy_schema(ts, data: ['must be a string'])\n+    end\n+\n+    it 'errs when data is not Base64' do\n+      token_h['data'] = '%'\n+      is_expected.to dissatisfy_schema(ts, data: ['must be Base64'])\n+    end\n+  end\n+\n+  context 'signature' do\n+    it 'errs when invalid' do\n+      token_h['signature'] = 'invalid signature'\n+      is_expected.to dissatisfy_schema(ts, signature: nil)\n+    end\n+\n+    it 'errs when missing' do\n+      token_h.delete('signature')\n+      is_expected.to dissatisfy_schema(ts, signature: ['is missing'])\n+    end\n+\n+    it 'errs when not a string' do\n+      token_h['signature'] = 123\n+      is_expected.to dissatisfy_schema(ts, signature: ['must be a string'])\n+    end\n+\n+    it 'errs when not a Base64 string' do\n+      token_h['signature'] = 'not Base64'\n+      is_expected.to dissatisfy_schema(ts, signature: ['must be Base64'])\n+    end\n+  end\n+\n+  context 'version' do\n+    it 'errs when invalid' do\n+      token_h['version'] = 'invalid version'\n+      is_expected.to dissatisfy_schema(ts, version: nil)\n+    end\n+\n+    it 'errs when missing' do\n+      token_h.delete('version')\n+      is_expected.to dissatisfy_schema(ts, version: ['is missing'])\n+    end\n+\n+    it 'errs when not a strign' do","path":"spec/lib/pedicel/validator/token_schema_spec.rb","position":63,"original_position":63,"commit_id":"3f2c527bdf132d9596498f070ceafef7f348823a","original_commit_id":"3f2c527bdf132d9596498f070ceafef7f348823a","user":{"login":"kse-clearhaus","id":34437910,"node_id":"MDQ6VXNlcjM0NDM3OTEw","avatar_url":"https://avatars2.githubusercontent.com/u/34437910?v=4","gravatar_id":"","url":"https://api.github.com/users/kse-clearhaus","html_url":"https://github.com/kse-clearhaus","followers_url":"https://api.github.com/users/kse-clearhaus/followers","following_url":"https://api.github.com/users/kse-clearhaus/following{/other_user}","gists_url":"https://api.github.com/users/kse-clearhaus/gists{/gist_id}","starred_url":"https://api.github.com/users/kse-clearhaus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kse-clearhaus/subscriptions","organizations_url":"https://api.github.com/users/kse-clearhaus/orgs","repos_url":"https://api.github.com/users/kse-clearhaus/repos","events_url":"https://api.github.com/users/kse-clearhaus/events{/privacy}","received_events_url":"https://api.github.com/users/kse-clearhaus/received_events","type":"User","site_admin":false},"body":"s/strign/string/","created_at":"2018-06-26T13:41:35Z","updated_at":"2018-06-26T13:41:35Z","html_url":"https://github.com/clearhaus/pedicel/pull/19#discussion_r198147157","pull_request_url":"https://api.github.com/repos/clearhaus/pedicel/pulls/19","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/clearhaus/pedicel/pulls/comments/198147157"},"html":{"href":"https://github.com/clearhaus/pedicel/pull/19#discussion_r198147157"},"pull_request":{"href":"https://api.github.com/repos/clearhaus/pedicel/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/clearhaus/pedicel/pulls/19","id":195965003,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1OTY1MDAz","html_url":"https://github.com/clearhaus/pedicel/pull/19","diff_url":"https://github.com/clearhaus/pedicel/pull/19.diff","patch_url":"https://github.com/clearhaus/pedicel/pull/19.patch","issue_url":"https://api.github.com/repos/clearhaus/pedicel/issues/19","number":19,"state":"open","locked":false,"title":"Improve validator","user":{"login":"ct-clearhaus","id":6168505,"node_id":"MDQ6VXNlcjYxNjg1MDU=","avatar_url":"https://avatars2.githubusercontent.com/u/6168505?v=4","gravatar_id":"","url":"https://api.github.com/users/ct-clearhaus","html_url":"https://github.com/ct-clearhaus","followers_url":"https://api.github.com/users/ct-clearhaus/followers","following_url":"https://api.github.com/users/ct-clearhaus/following{/other_user}","gists_url":"https://api.github.com/users/ct-clearhaus/gists{/gist_id}","starred_url":"https://api.github.com/users/ct-clearhaus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ct-clearhaus/subscriptions","organizations_url":"https://api.github.com/users/ct-clearhaus/orgs","repos_url":"https://api.github.com/users/ct-clearhaus/repos","events_url":"https://api.github.com/users/ct-clearhaus/events{/privacy}","received_events_url":"https://api.github.com/users/ct-clearhaus/received_events","type":"User","site_admin":false},"body":"Specs will need an update.","created_at":"2018-06-19T21:35:50Z","updated_at":"2018-06-26T13:41:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"75429b562dac37ede9ad32b8dd3fb73c262350de","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/clearhaus/pedicel/pulls/19/commits","review_comments_url":"https://api.github.com/repos/clearhaus/pedicel/pulls/19/comments","review_comment_url":"https://api.github.com/repos/clearhaus/pedicel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/clearhaus/pedicel/issues/19/comments","statuses_url":"https://api.github.com/repos/clearhaus/pedicel/statuses/3f2c527bdf132d9596498f070ceafef7f348823a","head":{"label":"clearhaus:improve-validator","ref":"improve-validator","sha":"3f2c527bdf132d9596498f070ceafef7f348823a","user":{"login":"clearhaus","id":1713497,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3MTM0OTc=","avatar_url":"https://avatars1.githubusercontent.com/u/1713497?v=4","gravatar_id":"","url":"https://api.github.com/users/clearhaus","html_url":"https://github.com/clearhaus","followers_url":"https://api.github.com/users/clearhaus/followers","following_url":"https://api.github.com/users/clearhaus/following{/other_user}","gists_url":"https://api.github.com/users/clearhaus/gists{/gist_id}","starred_url":"https://api.github.com/users/clearhaus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clearhaus/subscriptions","organizations_url":"https://api.github.com/users/clearhaus/orgs","repos_url":"https://api.github.com/users/clearhaus/repos","events_url":"https://api.github.com/users/clearhaus/events{/privacy}","received_events_url":"https://api.github.com/users/clearhaus/received_events","type":"Organization","site_admin":false},"repo":{"id":116819969,"node_id":"MDEwOlJlcG9zaXRvcnkxMTY4MTk5Njk=","name":"pedicel","full_name":"clearhaus/pedicel","owner":{"login":"clearhaus","id":1713497,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3MTM0OTc=","avatar_url":"https://avatars1.githubusercontent.com/u/1713497?v=4","gravatar_id":"","url":"https://api.github.com/users/clearhaus","html_url":"https://github.com/clearhaus","followers_url":"https://api.github.com/users/clearhaus/followers","following_url":"https://api.github.com/users/clearhaus/following{/other_user}","gists_url":"https://api.github.com/users/clearhaus/gists{/gist_id}","starred_url":"https://api.github.com/users/clearhaus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clearhaus/subscriptions","organizations_url":"https://api.github.com/users/clearhaus/orgs","repos_url":"https://api.github.com/users/clearhaus/repos","events_url":"https://api.github.com/users/clearhaus/events{/privacy}","received_events_url":"https://api.github.com/users/clearhaus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/clearhaus/pedicel","description":"Handle Apple Pay payment tokens","fork":false,"url":"https://api.github.com/repos/clearhaus/pedicel","forks_url":"https://api.github.com/repos/clearhaus/pedicel/forks","keys_url":"https://api.github.com/repos/clearhaus/pedicel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/clearhaus/pedicel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/clearhaus/pedicel/teams","hooks_url":"https://api.github.com/repos/clearhaus/pedicel/hooks","issue_events_url":"https://api.github.com/repos/clearhaus/pedicel/issues/events{/number}","events_url":"https://api.github.com/repos/clearhaus/pedicel/events","assignees_url":"https://api.github.com/repos/clearhaus/pedicel/assignees{/user}","branches_url":"https://api.github.com/repos/clearhaus/pedicel/branches{/branch}","tags_url":"https://api.github.com/repos/clearhaus/pedicel/tags","blobs_url":"https://api.github.com/repos/clearhaus/pedicel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/clearhaus/pedicel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/clearhaus/pedicel/git/refs{/sha}","trees_url":"https://api.github.com/repos/clearhaus/pedicel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/clearhaus/pedicel/statuses/{sha}","languages_url":"https://api.github.com/repos/clearhaus/pedicel/languages","stargazers_url":"https://api.github.com/repos/clearhaus/pedicel/stargazers","contributors_url":"https://api.github.com/repos/clearhaus/pedicel/contributors","subscribers_url":"https://api.github.com/repos/clearhaus/pedicel/subscribers","subscription_url":"https://api.github.com/repos/clearhaus/pedicel/subscription","commits_url":"https://api.github.com/repos/clearhaus/pedicel/commits{/sha}","git_commits_url":"https://api.github.com/repos/clearhaus/pedicel/git/commits{/sha}","comments_url":"https://api.github.com/repos/clearhaus/pedicel/comments{/number}","issue_comment_url":"https://api.github.com/repos/clearhaus/pedicel/issues/comments{/number}","contents_url":"https://api.github.com/repos/clearhaus/pedicel/contents/{+path}","compare_url":"https://api.github.com/repos/clearhaus/pedicel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/clearhaus/pedicel/merges","archive_url":"https://api.github.com/repos/clearhaus/pedicel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/clearhaus/pedicel/downloads","issues_url":"https://api.github.com/repos/clearhaus/pedicel/issues{/number}","pulls_url":"https://api.github.com/repos/clearhaus/pedicel/pulls{/number}","milestones_url":"https://api.github.com/repos/clearhaus/pedicel/milestones{/number}","notifications_url":"https://api.github.com/repos/clearhaus/pedicel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/clearhaus/pedicel/labels{/name}","releases_url":"https://api.github.com/repos/clearhaus/pedicel/releases{/id}","deployments_url":"https://api.github.com/repos/clearhaus/pedicel/deployments","created_at":"2018-01-09T13:32:39Z","updated_at":"2018-06-04T13:12:08Z","pushed_at":"2018-06-26T11:58:56Z","git_url":"git://github.com/clearhaus/pedicel.git","ssh_url":"git@github.com:clearhaus/pedicel.git","clone_url":"https://github.com/clearhaus/pedicel.git","svn_url":"https://github.com/clearhaus/pedicel","homepage":null,"size":291,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":3,"watchers":2,"default_branch":"master"}},"base":{"label":"clearhaus:master","ref":"master","sha":"b1e69bb8c749e891524f2b57de4da251d6341f05","user":{"login":"clearhaus","id":1713497,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3MTM0OTc=","avatar_url":"https://avatars1.githubusercontent.com/u/1713497?v=4","gravatar_id":"","url":"https://api.github.com/users/clearhaus","html_url":"https://github.com/clearhaus","followers_url":"https://api.github.com/users/clearhaus/followers","following_url":"https://api.github.com/users/clearhaus/following{/other_user}","gists_url":"https://api.github.com/users/clearhaus/gists{/gist_id}","starred_url":"https://api.github.com/users/clearhaus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clearhaus/subscriptions","organizations_url":"https://api.github.com/users/clearhaus/orgs","repos_url":"https://api.github.com/users/clearhaus/repos","events_url":"https://api.github.com/users/clearhaus/events{/privacy}","received_events_url":"https://api.github.com/users/clearhaus/received_events","type":"Organization","site_admin":false},"repo":{"id":116819969,"node_id":"MDEwOlJlcG9zaXRvcnkxMTY4MTk5Njk=","name":"pedicel","full_name":"clearhaus/pedicel","owner":{"login":"clearhaus","id":1713497,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3MTM0OTc=","avatar_url":"https://avatars1.githubusercontent.com/u/1713497?v=4","gravatar_id":"","url":"https://api.github.com/users/clearhaus","html_url":"https://github.com/clearhaus","followers_url":"https://api.github.com/users/clearhaus/followers","following_url":"https://api.github.com/users/clearhaus/following{/other_user}","gists_url":"https://api.github.com/users/clearhaus/gists{/gist_id}","starred_url":"https://api.github.com/users/clearhaus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clearhaus/subscriptions","organizations_url":"https://api.github.com/users/clearhaus/orgs","repos_url":"https://api.github.com/users/clearhaus/repos","events_url":"https://api.github.com/users/clearhaus/events{/privacy}","received_events_url":"https://api.github.com/users/clearhaus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/clearhaus/pedicel","description":"Handle Apple Pay payment tokens","fork":false,"url":"https://api.github.com/repos/clearhaus/pedicel","forks_url":"https://api.github.com/repos/clearhaus/pedicel/forks","keys_url":"https://api.github.com/repos/clearhaus/pedicel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/clearhaus/pedicel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/clearhaus/pedicel/teams","hooks_url":"https://api.github.com/repos/clearhaus/pedicel/hooks","issue_events_url":"https://api.github.com/repos/clearhaus/pedicel/issues/events{/number}","events_url":"https://api.github.com/repos/clearhaus/pedicel/events","assignees_url":"https://api.github.com/repos/clearhaus/pedicel/assignees{/user}","branches_url":"https://api.github.com/repos/clearhaus/pedicel/branches{/branch}","tags_url":"https://api.github.com/repos/clearhaus/pedicel/tags","blobs_url":"https://api.github.com/repos/clearhaus/pedicel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/clearhaus/pedicel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/clearhaus/pedicel/git/refs{/sha}","trees_url":"https://api.github.com/repos/clearhaus/pedicel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/clearhaus/pedicel/statuses/{sha}","languages_url":"https://api.github.com/repos/clearhaus/pedicel/languages","stargazers_url":"https://api.github.com/repos/clearhaus/pedicel/stargazers","contributors_url":"https://api.github.com/repos/clearhaus/pedicel/contributors","subscribers_url":"https://api.github.com/repos/clearhaus/pedicel/subscribers","subscription_url":"https://api.github.com/repos/clearhaus/pedicel/subscription","commits_url":"https://api.github.com/repos/clearhaus/pedicel/commits{/sha}","git_commits_url":"https://api.github.com/repos/clearhaus/pedicel/git/commits{/sha}","comments_url":"https://api.github.com/repos/clearhaus/pedicel/comments{/number}","issue_comment_url":"https://api.github.com/repos/clearhaus/pedicel/issues/comments{/number}","contents_url":"https://api.github.com/repos/clearhaus/pedicel/contents/{+path}","compare_url":"https://api.github.com/repos/clearhaus/pedicel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/clearhaus/pedicel/merges","archive_url":"https://api.github.com/repos/clearhaus/pedicel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/clearhaus/pedicel/downloads","issues_url":"https://api.github.com/repos/clearhaus/pedicel/issues{/number}","pulls_url":"https://api.github.com/repos/clearhaus/pedicel/pulls{/number}","milestones_url":"https://api.github.com/repos/clearhaus/pedicel/milestones{/number}","notifications_url":"https://api.github.com/repos/clearhaus/pedicel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/clearhaus/pedicel/labels{/name}","releases_url":"https://api.github.com/repos/clearhaus/pedicel/releases{/id}","deployments_url":"https://api.github.com/repos/clearhaus/pedicel/deployments","created_at":"2018-01-09T13:32:39Z","updated_at":"2018-06-04T13:12:08Z","pushed_at":"2018-06-26T11:58:56Z","git_url":"git://github.com/clearhaus/pedicel.git","ssh_url":"git@github.com:clearhaus/pedicel.git","clone_url":"https://github.com/clearhaus/pedicel.git","svn_url":"https://github.com/clearhaus/pedicel","homepage":null,"size":291,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":3,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/clearhaus/pedicel/pulls/19"},"html":{"href":"https://github.com/clearhaus/pedicel/pull/19"},"issue":{"href":"https://api.github.com/repos/clearhaus/pedicel/issues/19"},"comments":{"href":"https://api.github.com/repos/clearhaus/pedicel/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/clearhaus/pedicel/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/clearhaus/pedicel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/clearhaus/pedicel/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/clearhaus/pedicel/statuses/3f2c527bdf132d9596498f070ceafef7f348823a"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"kse-clearhaus"}}