{"action":"created","comment":{"url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/pulls/comments/38299171","id":38299171,"diff_hunk":"@@ -0,0 +1,26 @@\n+jQuery(function ($) {\n+\n+    /**\n+     * Success. Not used in errors but reserved.\n+     *\n+     * @type {number}\n+     * @see https://fidoalliance.org/specs/fido-u2f-v1.0-nfc-bt-amendment-20150514/fido-u2f-javascript-api.html#error-codes\n+     */\n+    var ERROR_CODE_OK = 0;\n+\n+    $('form[data-u2f-register-request]').first().forEach(function () {\n+        var $form = $(this),\n+            $errorCode = $form.find('input[data-u2f-register-response-field=\"errorCode\"]'),\n+            $registrationData = $form.find('input[data-u2f-register-response-field=\"registrationData\"]'),\n+            $clientData = $form.find('input[data-u2f-register-response-field=\"clientData\"]'),\n+            registerRequest = $form.data('u2f-register-request');\n+\n+        u2f.register([registerRequest], [], function (response) {\n+            $errorCode.val(response.errorCode || ERROR_CODE_OK);\n+            $registrationData.val(response.registrationData);\n+            $clientData.val(response.clientData);\n+            $form.submit();\n+        });\n+    });\n+","path":"src/Resources/public/u2f.js","position":25,"original_position":25,"commit_id":"fdcaa5e52b99cb50ee68738040568fa86cf7de4e","original_commit_id":"f559657ada3e3b54c02a3da6f1e7ed22fae5b075","user":{"login":"DRvanR","id":1422284,"avatar_url":"https://avatars.githubusercontent.com/u/1422284?v=3","gravatar_id":"","url":"https://api.github.com/users/DRvanR","html_url":"https://github.com/DRvanR","followers_url":"https://api.github.com/users/DRvanR/followers","following_url":"https://api.github.com/users/DRvanR/following{/other_user}","gists_url":"https://api.github.com/users/DRvanR/gists{/gist_id}","starred_url":"https://api.github.com/users/DRvanR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DRvanR/subscriptions","organizations_url":"https://api.github.com/users/DRvanR/orgs","repos_url":"https://api.github.com/users/DRvanR/repos","events_url":"https://api.github.com/users/DRvanR/events{/privacy}","received_events_url":"https://api.github.com/users/DRvanR/received_events","type":"User","site_admin":false},"body":"Nice :dancers: ","created_at":"2015-08-31T10:10:26Z","updated_at":"2015-08-31T10:10:26Z","html_url":"https://github.com/SURFnet/Stepup-u2f-bundle/pull/3#discussion_r38299171","pull_request_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/pulls/comments/38299171"},"html":{"href":"https://github.com/SURFnet/Stepup-u2f-bundle/pull/3#discussion_r38299171"},"pull_request":{"href":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/pulls/3","id":43631017,"html_url":"https://github.com/SURFnet/Stepup-u2f-bundle/pull/3","diff_url":"https://github.com/SURFnet/Stepup-u2f-bundle/pull/3.diff","patch_url":"https://github.com/SURFnet/Stepup-u2f-bundle/pull/3.patch","issue_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/issues/3","number":3,"state":"open","locked":false,"title":"[WIP] Create U2F device registration form","user":{"login":"rjkip","id":1734555,"avatar_url":"https://avatars.githubusercontent.com/u/1734555?v=3","gravatar_id":"","url":"https://api.github.com/users/rjkip","html_url":"https://github.com/rjkip","followers_url":"https://api.github.com/users/rjkip/followers","following_url":"https://api.github.com/users/rjkip/following{/other_user}","gists_url":"https://api.github.com/users/rjkip/gists{/gist_id}","starred_url":"https://api.github.com/users/rjkip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjkip/subscriptions","organizations_url":"https://api.github.com/users/rjkip/orgs","repos_url":"https://api.github.com/users/rjkip/repos","events_url":"https://api.github.com/users/rjkip/events{/privacy}","received_events_url":"https://api.github.com/users/rjkip/received_events","type":"User","site_admin":false},"body":"- [ ] Merge #1","created_at":"2015-08-28T14:04:48Z","updated_at":"2015-08-31T10:10:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"87d0a2ff2134c5dade52a5f5613d16e9aead3951","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/pulls/3/commits","review_comments_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/pulls/3/comments","review_comment_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/issues/3/comments","statuses_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/statuses/fdcaa5e52b99cb50ee68738040568fa86cf7de4e","head":{"label":"SURFnet:feature/device-registration-form","ref":"feature/device-registration-form","sha":"fdcaa5e52b99cb50ee68738040568fa86cf7de4e","user":{"login":"SURFnet","id":1485353,"avatar_url":"https://avatars.githubusercontent.com/u/1485353?v=3","gravatar_id":"","url":"https://api.github.com/users/SURFnet","html_url":"https://github.com/SURFnet","followers_url":"https://api.github.com/users/SURFnet/followers","following_url":"https://api.github.com/users/SURFnet/following{/other_user}","gists_url":"https://api.github.com/users/SURFnet/gists{/gist_id}","starred_url":"https://api.github.com/users/SURFnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SURFnet/subscriptions","organizations_url":"https://api.github.com/users/SURFnet/orgs","repos_url":"https://api.github.com/users/SURFnet/repos","events_url":"https://api.github.com/users/SURFnet/events{/privacy}","received_events_url":"https://api.github.com/users/SURFnet/received_events","type":"Organization","site_admin":false},"repo":{"id":41414460,"name":"Stepup-u2f-bundle","full_name":"SURFnet/Stepup-u2f-bundle","owner":{"login":"SURFnet","id":1485353,"avatar_url":"https://avatars.githubusercontent.com/u/1485353?v=3","gravatar_id":"","url":"https://api.github.com/users/SURFnet","html_url":"https://github.com/SURFnet","followers_url":"https://api.github.com/users/SURFnet/followers","following_url":"https://api.github.com/users/SURFnet/following{/other_user}","gists_url":"https://api.github.com/users/SURFnet/gists{/gist_id}","starred_url":"https://api.github.com/users/SURFnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SURFnet/subscriptions","organizations_url":"https://api.github.com/users/SURFnet/orgs","repos_url":"https://api.github.com/users/SURFnet/repos","events_url":"https://api.github.com/users/SURFnet/events{/privacy}","received_events_url":"https://api.github.com/users/SURFnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SURFnet/Stepup-u2f-bundle","description":"","fork":false,"url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle","forks_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/forks","keys_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/teams","hooks_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/hooks","issue_events_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/issues/events{/number}","events_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/events","assignees_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/assignees{/user}","branches_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/branches{/branch}","tags_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/tags","blobs_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/statuses/{sha}","languages_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/languages","stargazers_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/stargazers","contributors_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/contributors","subscribers_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/subscribers","subscription_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/subscription","commits_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/contents/{+path}","compare_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/merges","archive_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/downloads","issues_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/issues{/number}","pulls_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/pulls{/number}","milestones_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/milestones{/number}","notifications_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/labels{/name}","releases_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/releases{/id}","created_at":"2015-08-26T08:36:09Z","updated_at":"2015-08-26T08:40:19Z","pushed_at":"2015-08-31T10:02:21Z","git_url":"git://github.com/SURFnet/Stepup-u2f-bundle.git","ssh_url":"git@github.com:SURFnet/Stepup-u2f-bundle.git","clone_url":"https://github.com/SURFnet/Stepup-u2f-bundle.git","svn_url":"https://github.com/SURFnet/Stepup-u2f-bundle","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"develop"}},"base":{"label":"SURFnet:develop","ref":"develop","sha":"c7ce5c5ac7dac3638b2ce773628536c877b79584","user":{"login":"SURFnet","id":1485353,"avatar_url":"https://avatars.githubusercontent.com/u/1485353?v=3","gravatar_id":"","url":"https://api.github.com/users/SURFnet","html_url":"https://github.com/SURFnet","followers_url":"https://api.github.com/users/SURFnet/followers","following_url":"https://api.github.com/users/SURFnet/following{/other_user}","gists_url":"https://api.github.com/users/SURFnet/gists{/gist_id}","starred_url":"https://api.github.com/users/SURFnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SURFnet/subscriptions","organizations_url":"https://api.github.com/users/SURFnet/orgs","repos_url":"https://api.github.com/users/SURFnet/repos","events_url":"https://api.github.com/users/SURFnet/events{/privacy}","received_events_url":"https://api.github.com/users/SURFnet/received_events","type":"Organization","site_admin":false},"repo":{"id":41414460,"name":"Stepup-u2f-bundle","full_name":"SURFnet/Stepup-u2f-bundle","owner":{"login":"SURFnet","id":1485353,"avatar_url":"https://avatars.githubusercontent.com/u/1485353?v=3","gravatar_id":"","url":"https://api.github.com/users/SURFnet","html_url":"https://github.com/SURFnet","followers_url":"https://api.github.com/users/SURFnet/followers","following_url":"https://api.github.com/users/SURFnet/following{/other_user}","gists_url":"https://api.github.com/users/SURFnet/gists{/gist_id}","starred_url":"https://api.github.com/users/SURFnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SURFnet/subscriptions","organizations_url":"https://api.github.com/users/SURFnet/orgs","repos_url":"https://api.github.com/users/SURFnet/repos","events_url":"https://api.github.com/users/SURFnet/events{/privacy}","received_events_url":"https://api.github.com/users/SURFnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SURFnet/Stepup-u2f-bundle","description":"","fork":false,"url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle","forks_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/forks","keys_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/teams","hooks_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/hooks","issue_events_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/issues/events{/number}","events_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/events","assignees_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/assignees{/user}","branches_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/branches{/branch}","tags_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/tags","blobs_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/statuses/{sha}","languages_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/languages","stargazers_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/stargazers","contributors_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/contributors","subscribers_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/subscribers","subscription_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/subscription","commits_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/contents/{+path}","compare_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/merges","archive_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/downloads","issues_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/issues{/number}","pulls_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/pulls{/number}","milestones_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/milestones{/number}","notifications_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/labels{/name}","releases_url":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/releases{/id}","created_at":"2015-08-26T08:36:09Z","updated_at":"2015-08-26T08:40:19Z","pushed_at":"2015-08-31T10:02:21Z","git_url":"git://github.com/SURFnet/Stepup-u2f-bundle.git","ssh_url":"git@github.com:SURFnet/Stepup-u2f-bundle.git","clone_url":"https://github.com/SURFnet/Stepup-u2f-bundle.git","svn_url":"https://github.com/SURFnet/Stepup-u2f-bundle","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/pulls/3"},"html":{"href":"https://github.com/SURFnet/Stepup-u2f-bundle/pull/3"},"issue":{"href":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/issues/3"},"comments":{"href":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/SURFnet/Stepup-u2f-bundle/statuses/fdcaa5e52b99cb50ee68738040568fa86cf7de4e"}}}}