{"action":"created","comment":{"url":"https://api.github.com/repos/bigkevmcd/erlfernet/pulls/comments/32823158","id":32823158,"diff_hunk":"@@ -207,59 +269,51 @@ decode_key_test() ->\n %]\n % 1985-10-26T01:20:00-07:00 == 499162800 Seconds since the epoch\n %\n-generate_token_test() ->\n-  Tok = generate_token(\"hello\", <<0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15>>, 499162800, decode_key(\"cw_0x689RpI-jtRR7oE8h_eQsKImvJapLeSbXpwF4e4=\")),\n-  ?assertEqual(decode_token(\"gAAAAAAdwJ6wAAECAwQFBgcICQoLDA0ODy021cpGVWKZ_eEwCGM4BLLF_5CV9dOPmrhuVUPgJobwOz7JcbmrR64jVmpU4IwqDA==\"),\n-               decode_token(Tok)).\n+generate_token_test_() ->","path":"src/fernet.erl","position":380,"original_position":380,"commit_id":"5fa1b71ca1e34746eb7387c658bfed03c110383a","original_commit_id":"5fa1b71ca1e34746eb7387c658bfed03c110383a","user":{"login":"ferd","id":111141,"avatar_url":"https://avatars.githubusercontent.com/u/111141?v=3","gravatar_id":"","url":"https://api.github.com/users/ferd","html_url":"https://github.com/ferd","followers_url":"https://api.github.com/users/ferd/followers","following_url":"https://api.github.com/users/ferd/following{/other_user}","gists_url":"https://api.github.com/users/ferd/gists{/gist_id}","starred_url":"https://api.github.com/users/ferd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ferd/subscriptions","organizations_url":"https://api.github.com/users/ferd/orgs","repos_url":"https://api.github.com/users/ferd/repos","events_url":"https://api.github.com/users/ferd/events{/privacy}","received_events_url":"https://api.github.com/users/ferd/received_events","type":"User","site_admin":false},"body":"Ah yes. You'll notice that instead of having\r\n\r\n```erlang```\r\n?assertEqual(A, B),\r\n?assertEqual(C, D).\r\n```\r\nto end the test, I have instead:\r\n\r\n```erlang\r\n[?_assertEqual(A,B),\r\n ?_assertEqual(C,D)].\r\n```\r\nThis, instead of being an assertion, is a *generator*, which produces a test case and returns it as a function. i.e. it's pretty much equivalent to \r\n\r\n```erlang\r\n[fun() -> ?assertEqual(A,B) end,\r\n fun() -> ?assertEqual(C,D) end].\r\n```\r\nWhich is a list of functions containing unit tests. EUnit generall perceives unit tests as all functions that end with `_test` and take 0 arguments. To tell Eunit that what I have is a function that is gonna return is a list of tests, I have to declare it as a generator. So instead of having `_test()`, I have `_test_()` as a suffix, and EUnit interprets that to say \"I'm gonna get a list of unit tests, run them all\".\r\n\r\nThe final difference is that instead of EUnit reporting `generate_token_test()` as a single test (with two assertions), it is going to instead report two independent tests.","created_at":"2015-06-19T12:11:50Z","updated_at":"2015-06-19T12:11:50Z","html_url":"https://github.com/bigkevmcd/erlfernet/pull/6#discussion_r32823158","pull_request_url":"https://api.github.com/repos/bigkevmcd/erlfernet/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/bigkevmcd/erlfernet/pulls/comments/32823158"},"html":{"href":"https://github.com/bigkevmcd/erlfernet/pull/6#discussion_r32823158"},"pull_request":{"href":"https://api.github.com/repos/bigkevmcd/erlfernet/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/bigkevmcd/erlfernet/pulls/6","id":38002143,"html_url":"https://github.com/bigkevmcd/erlfernet/pull/6","diff_url":"https://github.com/bigkevmcd/erlfernet/pull/6.diff","patch_url":"https://github.com/bigkevmcd/erlfernet/pull/6.patch","issue_url":"https://api.github.com/repos/bigkevmcd/erlfernet/issues/6","number":6,"state":"open","locked":false,"title":"Bring erlfernet up to spec","user":{"login":"ferd","id":111141,"avatar_url":"https://avatars.githubusercontent.com/u/111141?v=3","gravatar_id":"","url":"https://api.github.com/users/ferd","html_url":"https://github.com/ferd","followers_url":"https://api.github.com/users/ferd/followers","following_url":"https://api.github.com/users/ferd/following{/other_user}","gists_url":"https://api.github.com/users/ferd/gists{/gist_id}","starred_url":"https://api.github.com/users/ferd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ferd/subscriptions","organizations_url":"https://api.github.com/users/ferd/orgs","repos_url":"https://api.github.com/users/ferd/repos","events_url":"https://api.github.com/users/ferd/events{/privacy}","received_events_url":"https://api.github.com/users/ferd/received_events","type":"User","site_admin":false},"body":"- move to rebar3\r\n- optional TTL validation\r\n- Fixed TTL validation to work on seconds rather than µs\r\n- Adding compliance tests from the spec (https://github.com/fernet/spec)\r\n- Updated pkcs7 dependency to do strict unpadding\r\n- removed handling of skew on old hashes (as per spec)\r\n- removing proper deps (not needed after all)\r\n- implemented hmac validation with constant-time comparison\r\n- added validation for message size and block size\r\n- added validation of b64url decoding\r\n- Use base64url encoding with MIME compatibility\r\n- Rework API to:\r\n    - Accept iodata\r\n    - Always return binaries\r\n    - Keys are accepted as base64url encoded (MIME) for both encoding and\r\n      decoding only\r\n    - Added key generation functions that give an encoded key\r\n    - Added key encoding function that works in a signing and crypting key\r\n      respecting the spec\r\n- 18.0 compatibility","created_at":"2015-06-18T12:43:23Z","updated_at":"2015-06-19T12:11:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"97eb5e1e7b1344336a0458acf189d5cbf488913e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bigkevmcd/erlfernet/pulls/6/commits","review_comments_url":"https://api.github.com/repos/bigkevmcd/erlfernet/pulls/6/comments","review_comment_url":"https://api.github.com/repos/bigkevmcd/erlfernet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bigkevmcd/erlfernet/issues/6/comments","statuses_url":"https://api.github.com/repos/bigkevmcd/erlfernet/statuses/5fa1b71ca1e34746eb7387c658bfed03c110383a","head":{"label":"ferd:skip-ttl","ref":"skip-ttl","sha":"5fa1b71ca1e34746eb7387c658bfed03c110383a","user":{"login":"ferd","id":111141,"avatar_url":"https://avatars.githubusercontent.com/u/111141?v=3","gravatar_id":"","url":"https://api.github.com/users/ferd","html_url":"https://github.com/ferd","followers_url":"https://api.github.com/users/ferd/followers","following_url":"https://api.github.com/users/ferd/following{/other_user}","gists_url":"https://api.github.com/users/ferd/gists{/gist_id}","starred_url":"https://api.github.com/users/ferd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ferd/subscriptions","organizations_url":"https://api.github.com/users/ferd/orgs","repos_url":"https://api.github.com/users/ferd/repos","events_url":"https://api.github.com/users/ferd/events{/privacy}","received_events_url":"https://api.github.com/users/ferd/received_events","type":"User","site_admin":false},"repo":{"id":37658764,"name":"erlfernet","full_name":"ferd/erlfernet","owner":{"login":"ferd","id":111141,"avatar_url":"https://avatars.githubusercontent.com/u/111141?v=3","gravatar_id":"","url":"https://api.github.com/users/ferd","html_url":"https://github.com/ferd","followers_url":"https://api.github.com/users/ferd/followers","following_url":"https://api.github.com/users/ferd/following{/other_user}","gists_url":"https://api.github.com/users/ferd/gists{/gist_id}","starred_url":"https://api.github.com/users/ferd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ferd/subscriptions","organizations_url":"https://api.github.com/users/ferd/orgs","repos_url":"https://api.github.com/users/ferd/repos","events_url":"https://api.github.com/users/ferd/events{/privacy}","received_events_url":"https://api.github.com/users/ferd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ferd/erlfernet","description":"","fork":true,"url":"https://api.github.com/repos/ferd/erlfernet","forks_url":"https://api.github.com/repos/ferd/erlfernet/forks","keys_url":"https://api.github.com/repos/ferd/erlfernet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ferd/erlfernet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ferd/erlfernet/teams","hooks_url":"https://api.github.com/repos/ferd/erlfernet/hooks","issue_events_url":"https://api.github.com/repos/ferd/erlfernet/issues/events{/number}","events_url":"https://api.github.com/repos/ferd/erlfernet/events","assignees_url":"https://api.github.com/repos/ferd/erlfernet/assignees{/user}","branches_url":"https://api.github.com/repos/ferd/erlfernet/branches{/branch}","tags_url":"https://api.github.com/repos/ferd/erlfernet/tags","blobs_url":"https://api.github.com/repos/ferd/erlfernet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ferd/erlfernet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ferd/erlfernet/git/refs{/sha}","trees_url":"https://api.github.com/repos/ferd/erlfernet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ferd/erlfernet/statuses/{sha}","languages_url":"https://api.github.com/repos/ferd/erlfernet/languages","stargazers_url":"https://api.github.com/repos/ferd/erlfernet/stargazers","contributors_url":"https://api.github.com/repos/ferd/erlfernet/contributors","subscribers_url":"https://api.github.com/repos/ferd/erlfernet/subscribers","subscription_url":"https://api.github.com/repos/ferd/erlfernet/subscription","commits_url":"https://api.github.com/repos/ferd/erlfernet/commits{/sha}","git_commits_url":"https://api.github.com/repos/ferd/erlfernet/git/commits{/sha}","comments_url":"https://api.github.com/repos/ferd/erlfernet/comments{/number}","issue_comment_url":"https://api.github.com/repos/ferd/erlfernet/issues/comments{/number}","contents_url":"https://api.github.com/repos/ferd/erlfernet/contents/{+path}","compare_url":"https://api.github.com/repos/ferd/erlfernet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ferd/erlfernet/merges","archive_url":"https://api.github.com/repos/ferd/erlfernet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ferd/erlfernet/downloads","issues_url":"https://api.github.com/repos/ferd/erlfernet/issues{/number}","pulls_url":"https://api.github.com/repos/ferd/erlfernet/pulls{/number}","milestones_url":"https://api.github.com/repos/ferd/erlfernet/milestones{/number}","notifications_url":"https://api.github.com/repos/ferd/erlfernet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ferd/erlfernet/labels{/name}","releases_url":"https://api.github.com/repos/ferd/erlfernet/releases{/id}","created_at":"2015-06-18T12:41:08Z","updated_at":"2015-06-18T16:04:30Z","pushed_at":"2015-06-18T19:56:20Z","git_url":"git://github.com/ferd/erlfernet.git","ssh_url":"git@github.com:ferd/erlfernet.git","clone_url":"https://github.com/ferd/erlfernet.git","svn_url":"https://github.com/ferd/erlfernet","homepage":null,"size":94,"stargazers_count":1,"watchers_count":1,"language":"Erlang","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"bigkevmcd:master","ref":"master","sha":"d81e2d8896f7eb4e69ecd51cbd7b4ae79c3b0ad2","user":{"login":"bigkevmcd","id":867746,"avatar_url":"https://avatars.githubusercontent.com/u/867746?v=3","gravatar_id":"","url":"https://api.github.com/users/bigkevmcd","html_url":"https://github.com/bigkevmcd","followers_url":"https://api.github.com/users/bigkevmcd/followers","following_url":"https://api.github.com/users/bigkevmcd/following{/other_user}","gists_url":"https://api.github.com/users/bigkevmcd/gists{/gist_id}","starred_url":"https://api.github.com/users/bigkevmcd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bigkevmcd/subscriptions","organizations_url":"https://api.github.com/users/bigkevmcd/orgs","repos_url":"https://api.github.com/users/bigkevmcd/repos","events_url":"https://api.github.com/users/bigkevmcd/events{/privacy}","received_events_url":"https://api.github.com/users/bigkevmcd/received_events","type":"User","site_admin":false},"repo":{"id":27139406,"name":"erlfernet","full_name":"bigkevmcd/erlfernet","owner":{"login":"bigkevmcd","id":867746,"avatar_url":"https://avatars.githubusercontent.com/u/867746?v=3","gravatar_id":"","url":"https://api.github.com/users/bigkevmcd","html_url":"https://github.com/bigkevmcd","followers_url":"https://api.github.com/users/bigkevmcd/followers","following_url":"https://api.github.com/users/bigkevmcd/following{/other_user}","gists_url":"https://api.github.com/users/bigkevmcd/gists{/gist_id}","starred_url":"https://api.github.com/users/bigkevmcd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bigkevmcd/subscriptions","organizations_url":"https://api.github.com/users/bigkevmcd/orgs","repos_url":"https://api.github.com/users/bigkevmcd/repos","events_url":"https://api.github.com/users/bigkevmcd/events{/privacy}","received_events_url":"https://api.github.com/users/bigkevmcd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bigkevmcd/erlfernet","description":"","fork":false,"url":"https://api.github.com/repos/bigkevmcd/erlfernet","forks_url":"https://api.github.com/repos/bigkevmcd/erlfernet/forks","keys_url":"https://api.github.com/repos/bigkevmcd/erlfernet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bigkevmcd/erlfernet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bigkevmcd/erlfernet/teams","hooks_url":"https://api.github.com/repos/bigkevmcd/erlfernet/hooks","issue_events_url":"https://api.github.com/repos/bigkevmcd/erlfernet/issues/events{/number}","events_url":"https://api.github.com/repos/bigkevmcd/erlfernet/events","assignees_url":"https://api.github.com/repos/bigkevmcd/erlfernet/assignees{/user}","branches_url":"https://api.github.com/repos/bigkevmcd/erlfernet/branches{/branch}","tags_url":"https://api.github.com/repos/bigkevmcd/erlfernet/tags","blobs_url":"https://api.github.com/repos/bigkevmcd/erlfernet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bigkevmcd/erlfernet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bigkevmcd/erlfernet/git/refs{/sha}","trees_url":"https://api.github.com/repos/bigkevmcd/erlfernet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bigkevmcd/erlfernet/statuses/{sha}","languages_url":"https://api.github.com/repos/bigkevmcd/erlfernet/languages","stargazers_url":"https://api.github.com/repos/bigkevmcd/erlfernet/stargazers","contributors_url":"https://api.github.com/repos/bigkevmcd/erlfernet/contributors","subscribers_url":"https://api.github.com/repos/bigkevmcd/erlfernet/subscribers","subscription_url":"https://api.github.com/repos/bigkevmcd/erlfernet/subscription","commits_url":"https://api.github.com/repos/bigkevmcd/erlfernet/commits{/sha}","git_commits_url":"https://api.github.com/repos/bigkevmcd/erlfernet/git/commits{/sha}","comments_url":"https://api.github.com/repos/bigkevmcd/erlfernet/comments{/number}","issue_comment_url":"https://api.github.com/repos/bigkevmcd/erlfernet/issues/comments{/number}","contents_url":"https://api.github.com/repos/bigkevmcd/erlfernet/contents/{+path}","compare_url":"https://api.github.com/repos/bigkevmcd/erlfernet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bigkevmcd/erlfernet/merges","archive_url":"https://api.github.com/repos/bigkevmcd/erlfernet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bigkevmcd/erlfernet/downloads","issues_url":"https://api.github.com/repos/bigkevmcd/erlfernet/issues{/number}","pulls_url":"https://api.github.com/repos/bigkevmcd/erlfernet/pulls{/number}","milestones_url":"https://api.github.com/repos/bigkevmcd/erlfernet/milestones{/number}","notifications_url":"https://api.github.com/repos/bigkevmcd/erlfernet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bigkevmcd/erlfernet/labels{/name}","releases_url":"https://api.github.com/repos/bigkevmcd/erlfernet/releases{/id}","created_at":"2014-11-25T18:15:59Z","updated_at":"2015-06-18T17:11:01Z","pushed_at":"2015-06-18T19:56:21Z","git_url":"git://github.com/bigkevmcd/erlfernet.git","ssh_url":"git@github.com:bigkevmcd/erlfernet.git","clone_url":"https://github.com/bigkevmcd/erlfernet.git","svn_url":"https://github.com/bigkevmcd/erlfernet","homepage":null,"size":245,"stargazers_count":5,"watchers_count":5,"language":"Erlang","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bigkevmcd/erlfernet/pulls/6"},"html":{"href":"https://github.com/bigkevmcd/erlfernet/pull/6"},"issue":{"href":"https://api.github.com/repos/bigkevmcd/erlfernet/issues/6"},"comments":{"href":"https://api.github.com/repos/bigkevmcd/erlfernet/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/bigkevmcd/erlfernet/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/bigkevmcd/erlfernet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bigkevmcd/erlfernet/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/bigkevmcd/erlfernet/statuses/5fa1b71ca1e34746eb7387c658bfed03c110383a"}}}}