{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/firefox-ui-tests/pulls/comments/25198700","id":25198700,"diff_hunk":"@@ -0,0 +1,54 @@\n+# This Source Code Form is subject to the terms of the Mozilla Public\n+# License, v. 2.0. If a copy of the MPL was not distributed with this file,\n+# You can obtain one at http://mozilla.org/MPL/2.0/.\n+\n+import re\n+\n+from ..base import BaseLib\n+from ..errors import NoCertificateError\n+\n+\n+class Security(BaseLib):\n+    \"\"\"Low-level access to security (SSL, TLS) related information.\"\"\"\n+\n+    # Security related helpers #\n+\n+    def get_address_from_certificate(self, certificate):\n+        \"\"\"Retrieves the address of the organization from the certificate information.\n+\n+        The returned address may be `None` in case of no address found, or a dictionary\n+        with the following entries: `city`, `country`, `postal_code`, `state`, `street`.\n+\n+        :param certificate: A JSON blob representing the certificate, which can usually be\n+         retrieved via the current tab: `self.browser.tabbar.selectedTab.certificate`.\n+\n+        :returns: Address details as dictionary\n+        \"\"\"\n+        regex = re.compile('.*?L=(?P<city>.+?),ST=(?P<state>.+?),C=(?P<country>.+?)'\n+                           ',postalCode=(?P<postal_code>.+?),STREET=(?P<street>.+?)'\n+                           ',serial')\n+        results = regex.search(certificate['subjectName'])\n+\n+        return results.groupdict() if results else results\n+\n+    def get_certificate_for_page(self, tab_element):\n+        \"\"\"The SSL certificate assiciated with the loaded web page in the given tab.\n+\n+        :returns: Certificate details as JSON blob.","path":"firefox_puppeteer/api/security.py","position":37,"original_position":37,"commit_id":"86859f4c792e7d21f4f892062a39ff7d143043a6","original_commit_id":"86859f4c792e7d21f4f892062a39ff7d143043a6","user":{"login":"whimboo","id":129603,"avatar_url":"https://avatars.githubusercontent.com/u/129603?v=3","gravatar_id":"","url":"https://api.github.com/users/whimboo","html_url":"https://github.com/whimboo","followers_url":"https://api.github.com/users/whimboo/followers","following_url":"https://api.github.com/users/whimboo/following{/other_user}","gists_url":"https://api.github.com/users/whimboo/gists{/gist_id}","starred_url":"https://api.github.com/users/whimboo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whimboo/subscriptions","organizations_url":"https://api.github.com/users/whimboo/orgs","repos_url":"https://api.github.com/users/whimboo/repos","events_url":"https://api.github.com/users/whimboo/events{/privacy}","received_events_url":"https://api.github.com/users/whimboo/received_events","type":"User","site_admin":false},"body":"Ups. Thanks for the note. Simply missed it.","created_at":"2015-02-23T20:29:13Z","updated_at":"2015-02-23T20:29:13Z","html_url":"https://github.com/mozilla/firefox-ui-tests/pull/85#discussion_r25198700","pull_request_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/pulls/85","_links":{"self":{"href":"https://api.github.com/repos/mozilla/firefox-ui-tests/pulls/comments/25198700"},"html":{"href":"https://github.com/mozilla/firefox-ui-tests/pull/85#discussion_r25198700"},"pull_request":{"href":"https://api.github.com/repos/mozilla/firefox-ui-tests/pulls/85"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/firefox-ui-tests/pulls/85","id":29432038,"html_url":"https://github.com/mozilla/firefox-ui-tests/pull/85","diff_url":"https://github.com/mozilla/firefox-ui-tests/pull/85.diff","patch_url":"https://github.com/mozilla/firefox-ui-tests/pull/85.patch","issue_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/issues/85","number":85,"state":"open","locked":false,"title":"Bug 1132940 - Convert security module from Mozmill tests to Marionette. r=chmanchester","user":{"login":"whimboo","id":129603,"avatar_url":"https://avatars.githubusercontent.com/u/129603?v=3","gravatar_id":"","url":"https://api.github.com/users/whimboo","html_url":"https://github.com/whimboo","followers_url":"https://api.github.com/users/whimboo/followers","following_url":"https://api.github.com/users/whimboo/following{/other_user}","gists_url":"https://api.github.com/users/whimboo/gists{/gist_id}","starred_url":"https://api.github.com/users/whimboo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whimboo/subscriptions","organizations_url":"https://api.github.com/users/whimboo/orgs","repos_url":"https://api.github.com/users/whimboo/repos","events_url":"https://api.github.com/users/whimboo/events{/privacy}","received_events_url":"https://api.github.com/users/whimboo/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-17T10:40:25Z","updated_at":"2015-02-23T20:29:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"233791312eeecc1f429803a19513498c18af8fe9","assignee":{"login":"whimboo","id":129603,"avatar_url":"https://avatars.githubusercontent.com/u/129603?v=3","gravatar_id":"","url":"https://api.github.com/users/whimboo","html_url":"https://github.com/whimboo","followers_url":"https://api.github.com/users/whimboo/followers","following_url":"https://api.github.com/users/whimboo/following{/other_user}","gists_url":"https://api.github.com/users/whimboo/gists{/gist_id}","starred_url":"https://api.github.com/users/whimboo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whimboo/subscriptions","organizations_url":"https://api.github.com/users/whimboo/orgs","repos_url":"https://api.github.com/users/whimboo/repos","events_url":"https://api.github.com/users/whimboo/events{/privacy}","received_events_url":"https://api.github.com/users/whimboo/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/pulls/85/commits","review_comments_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/pulls/85/comments","review_comment_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/issues/85/comments","statuses_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/statuses/86859f4c792e7d21f4f892062a39ff7d143043a6","head":{"label":"whimboo:security","ref":"security","sha":"86859f4c792e7d21f4f892062a39ff7d143043a6","user":{"login":"whimboo","id":129603,"avatar_url":"https://avatars.githubusercontent.com/u/129603?v=3","gravatar_id":"","url":"https://api.github.com/users/whimboo","html_url":"https://github.com/whimboo","followers_url":"https://api.github.com/users/whimboo/followers","following_url":"https://api.github.com/users/whimboo/following{/other_user}","gists_url":"https://api.github.com/users/whimboo/gists{/gist_id}","starred_url":"https://api.github.com/users/whimboo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whimboo/subscriptions","organizations_url":"https://api.github.com/users/whimboo/orgs","repos_url":"https://api.github.com/users/whimboo/repos","events_url":"https://api.github.com/users/whimboo/events{/privacy}","received_events_url":"https://api.github.com/users/whimboo/received_events","type":"User","site_admin":false},"repo":{"id":27267720,"name":"firefox-ui-tests","full_name":"whimboo/firefox-ui-tests","owner":{"login":"whimboo","id":129603,"avatar_url":"https://avatars.githubusercontent.com/u/129603?v=3","gravatar_id":"","url":"https://api.github.com/users/whimboo","html_url":"https://github.com/whimboo","followers_url":"https://api.github.com/users/whimboo/followers","following_url":"https://api.github.com/users/whimboo/following{/other_user}","gists_url":"https://api.github.com/users/whimboo/gists{/gist_id}","starred_url":"https://api.github.com/users/whimboo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whimboo/subscriptions","organizations_url":"https://api.github.com/users/whimboo/orgs","repos_url":"https://api.github.com/users/whimboo/repos","events_url":"https://api.github.com/users/whimboo/events{/privacy}","received_events_url":"https://api.github.com/users/whimboo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/whimboo/firefox-ui-tests","description":"","fork":true,"url":"https://api.github.com/repos/whimboo/firefox-ui-tests","forks_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/forks","keys_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/teams","hooks_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/hooks","issue_events_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/issues/events{/number}","events_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/events","assignees_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/assignees{/user}","branches_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/branches{/branch}","tags_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/tags","blobs_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/git/refs{/sha}","trees_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/statuses/{sha}","languages_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/languages","stargazers_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/stargazers","contributors_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/contributors","subscribers_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/subscribers","subscription_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/subscription","commits_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/commits{/sha}","git_commits_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/git/commits{/sha}","comments_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/comments{/number}","issue_comment_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/issues/comments{/number}","contents_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/contents/{+path}","compare_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/merges","archive_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/downloads","issues_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/issues{/number}","pulls_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/pulls{/number}","milestones_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/milestones{/number}","notifications_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/labels{/name}","releases_url":"https://api.github.com/repos/whimboo/firefox-ui-tests/releases{/id}","created_at":"2014-11-28T13:17:46Z","updated_at":"2015-01-16T13:26:09Z","pushed_at":"2015-02-23T18:51:53Z","git_url":"git://github.com/whimboo/firefox-ui-tests.git","ssh_url":"git@github.com:whimboo/firefox-ui-tests.git","clone_url":"https://github.com/whimboo/firefox-ui-tests.git","svn_url":"https://github.com/whimboo/firefox-ui-tests","homepage":null,"size":667,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"7b2ccef3632b21251c0ea0cee20ee17843ae2185","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":25004372,"name":"firefox-ui-tests","full_name":"mozilla/firefox-ui-tests","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/firefox-ui-tests","description":"","fork":false,"url":"https://api.github.com/repos/mozilla/firefox-ui-tests","forks_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/forks","keys_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/teams","hooks_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/hooks","issue_events_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/events","assignees_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/tags","blobs_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/languages","stargazers_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/stargazers","contributors_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/contributors","subscribers_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/subscribers","subscription_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/subscription","commits_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/merges","archive_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/downloads","issues_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/firefox-ui-tests/releases{/id}","created_at":"2014-10-09T19:09:05Z","updated_at":"2015-02-23T19:56:13Z","pushed_at":"2015-02-23T19:56:13Z","git_url":"git://github.com/mozilla/firefox-ui-tests.git","ssh_url":"git@github.com:mozilla/firefox-ui-tests.git","clone_url":"https://github.com/mozilla/firefox-ui-tests.git","svn_url":"https://github.com/mozilla/firefox-ui-tests","homepage":null,"size":1872,"stargazers_count":5,"watchers_count":5,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":18,"forks":17,"open_issues":18,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/firefox-ui-tests/pulls/85"},"html":{"href":"https://github.com/mozilla/firefox-ui-tests/pull/85"},"issue":{"href":"https://api.github.com/repos/mozilla/firefox-ui-tests/issues/85"},"comments":{"href":"https://api.github.com/repos/mozilla/firefox-ui-tests/issues/85/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/firefox-ui-tests/pulls/85/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/firefox-ui-tests/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/firefox-ui-tests/pulls/85/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/firefox-ui-tests/statuses/86859f4c792e7d21f4f892062a39ff7d143043a6"}}}}