{"action":"created","comment":{"url":"https://api.github.com/repos/release-engineering/dockpulp/pulls/comments/135646023","pull_request_review_id":59080779,"id":135646023,"diff_hunk":"@@ -610,25 +617,75 @@ def _test_repoV2(self, dockerid, redirect, pulp_manifests, pulp_blobs, pulp_tags\n \n         return result\n \n-    def _test_sigstore(self, signatures):\n+    def _test_sigstore(self, signatures, prefix_with=PREFIX, exception=None):\n         \"\"\"Confirm we can reach CDN and get data back from it.\"\"\"\n-        result = {'error': False, 'sigs_in_pulp_not_crane': [], 'sigs_in_crane_not_pulp': []}\n+        result = {'error': False, 'sigs_in_pulp_not_crane': [], 'sigs_in_crane_not_pulp': [],\n+                  'manifests_in_sigstore_not_repo': [], 'invalid_sigs': [],\n+                  'missing_repos_in_pulp': []}\n         if not signatures:\n             log.info('  No signatures to test')\n             return result\n+        log.info('  Confirming repos have expected manifests in Pulp')\n+        manifests = {}\n+        for signature in signatures:\n+            (repo, manifest) = signature.split('@')\n+            if not repo.startswith(prefix_with):\n+                repo = prefix_with + repo\n+            repo = repo.replace('/', '-')\n+            manifest = manifest.split('/')[0]\n+            manifest = manifest.replace('=', ':')\n+            manifests.setdefault(repo, []).append(manifest)\n+        signed_repos = self.p.listRepos(manifests.keys(), content=True, strict=False)\n+        repo_sigs = {}\n+        for repo in signed_repos:\n+            repo_sigs[repo['id']] = repo['signatures']\n+            sigstoremanifests = set(manifests[repo['id']])\n+            if not set(repo['manifests'].keys()).issuperset(sigstoremanifests):\n+                mdiff = sigstoremanifests.difference(set(repo['manifests'].keys()))\n+                for m in list(mdiff):\n+                    log.error('  Signatures in sigstore but not in repo %s:', repo['id'])\n+                    log.error('    %s', m)\n+                    result['manifests_in_sigstore_not_repo'].append(m)\n+                result['error'] = True\n         url = self.p.cdnhost + '/content/sigstore/'\n-        log.info('  Confirming CDN has signatures available')\n+        log.info('  Confirming CDN has valid signatures available')\n+        if gnupg:\n+            gpg = gnupg.GPG()\n         for signature in signatures:\n+            (repo, manifest) = signature.split('@')\n+            if not repo.startswith(prefix_with):\n+                repo = prefix_with + repo\n+            repo = repo.replace('/', '-')\n+            if repo in result['missing_repos_in_pulp']:\n+                continue\n             log.debug('  contacting %s', url + signature)\n-            answer = requests.get(url + signature, verify=False)\n+            answer = self.requests.get(url + signature, verify=False)\n             log.debug('  status code: %s', answer.status_code)\n             if not answer.ok:\n                 log.error('  Signature missing in CDN: %s', signature)\n                 result['error'] = True\n                 result['sigs_in_pulp_not_crane'].append(signature)\n+            if gnupg:\n+                data = gpg.decrypt(answer.content)\n+                key_id = data.key_id\n+            else:\n+                data = subprocess.Popen(['gpg', '-d'], stdin=subprocess.PIPE,","path":"dockpulp/__init__.py","position":90,"original_position":90,"commit_id":"efe39efb1c90fe7bfc521d1ae60ac72f3f1c68aa","original_commit_id":"efe39efb1c90fe7bfc521d1ae60ac72f3f1c68aa","user":{"login":"bfontecc007","id":29286673,"avatar_url":"https://avatars2.githubusercontent.com/u/29286673?v=4","gravatar_id":"","url":"https://api.github.com/users/bfontecc007","html_url":"https://github.com/bfontecc007","followers_url":"https://api.github.com/users/bfontecc007/followers","following_url":"https://api.github.com/users/bfontecc007/following{/other_user}","gists_url":"https://api.github.com/users/bfontecc007/gists{/gist_id}","starred_url":"https://api.github.com/users/bfontecc007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bfontecc007/subscriptions","organizations_url":"https://api.github.com/users/bfontecc007/orgs","repos_url":"https://api.github.com/users/bfontecc007/repos","events_url":"https://api.github.com/users/bfontecc007/events{/privacy}","received_events_url":"https://api.github.com/users/bfontecc007/received_events","type":"User","site_admin":false},"body":"Might be worth trapping CalledProcessError and throwing something telling the use to install gpg to their system. Personally, I really get frustrated having to figure out what packages are needed by interpreting all different tracebacks. Just my two cents. If I were breilly I'd probably add the dep, if possible.","created_at":"2017-08-28T21:56:53Z","updated_at":"2017-08-28T21:56:53Z","html_url":"https://github.com/release-engineering/dockpulp/pull/141#discussion_r135646023","pull_request_url":"https://api.github.com/repos/release-engineering/dockpulp/pulls/141","_links":{"self":{"href":"https://api.github.com/repos/release-engineering/dockpulp/pulls/comments/135646023"},"html":{"href":"https://github.com/release-engineering/dockpulp/pull/141#discussion_r135646023"},"pull_request":{"href":"https://api.github.com/repos/release-engineering/dockpulp/pulls/141"}},"in_reply_to_id":135589473},"pull_request":{"url":"https://api.github.com/repos/release-engineering/dockpulp/pulls/141","id":136548144,"html_url":"https://github.com/release-engineering/dockpulp/pull/141","diff_url":"https://github.com/release-engineering/dockpulp/pull/141.diff","patch_url":"https://github.com/release-engineering/dockpulp/pull/141.patch","issue_url":"https://api.github.com/repos/release-engineering/dockpulp/issues/141","number":141,"state":"open","locked":false,"title":"Improved sigstore repo checking","user":{"login":"breillyr","id":14238759,"avatar_url":"https://avatars0.githubusercontent.com/u/14238759?v=4","gravatar_id":"","url":"https://api.github.com/users/breillyr","html_url":"https://github.com/breillyr","followers_url":"https://api.github.com/users/breillyr/followers","following_url":"https://api.github.com/users/breillyr/following{/other_user}","gists_url":"https://api.github.com/users/breillyr/gists{/gist_id}","starred_url":"https://api.github.com/users/breillyr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/breillyr/subscriptions","organizations_url":"https://api.github.com/users/breillyr/orgs","repos_url":"https://api.github.com/users/breillyr/repos","events_url":"https://api.github.com/users/breillyr/events{/privacy}","received_events_url":"https://api.github.com/users/breillyr/received_events","type":"User","site_admin":false},"body":"Just an initial patchset - I will be updating the PR with unit tests.","created_at":"2017-08-18T19:24:09Z","updated_at":"2017-08-28T21:56:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e0d18b2dbfd6fdb135fe35d2c7ccba75d82b7892","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/release-engineering/dockpulp/pulls/141/commits","review_comments_url":"https://api.github.com/repos/release-engineering/dockpulp/pulls/141/comments","review_comment_url":"https://api.github.com/repos/release-engineering/dockpulp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/release-engineering/dockpulp/issues/141/comments","statuses_url":"https://api.github.com/repos/release-engineering/dockpulp/statuses/efe39efb1c90fe7bfc521d1ae60ac72f3f1c68aa","head":{"label":"breillyr:sigstore-4131","ref":"sigstore-4131","sha":"efe39efb1c90fe7bfc521d1ae60ac72f3f1c68aa","user":{"login":"breillyr","id":14238759,"avatar_url":"https://avatars0.githubusercontent.com/u/14238759?v=4","gravatar_id":"","url":"https://api.github.com/users/breillyr","html_url":"https://github.com/breillyr","followers_url":"https://api.github.com/users/breillyr/followers","following_url":"https://api.github.com/users/breillyr/following{/other_user}","gists_url":"https://api.github.com/users/breillyr/gists{/gist_id}","starred_url":"https://api.github.com/users/breillyr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/breillyr/subscriptions","organizations_url":"https://api.github.com/users/breillyr/orgs","repos_url":"https://api.github.com/users/breillyr/repos","events_url":"https://api.github.com/users/breillyr/events{/privacy}","received_events_url":"https://api.github.com/users/breillyr/received_events","type":"User","site_admin":false},"repo":{"id":57329234,"name":"dockpulp","full_name":"breillyr/dockpulp","owner":{"login":"breillyr","id":14238759,"avatar_url":"https://avatars0.githubusercontent.com/u/14238759?v=4","gravatar_id":"","url":"https://api.github.com/users/breillyr","html_url":"https://github.com/breillyr","followers_url":"https://api.github.com/users/breillyr/followers","following_url":"https://api.github.com/users/breillyr/following{/other_user}","gists_url":"https://api.github.com/users/breillyr/gists{/gist_id}","starred_url":"https://api.github.com/users/breillyr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/breillyr/subscriptions","organizations_url":"https://api.github.com/users/breillyr/orgs","repos_url":"https://api.github.com/users/breillyr/repos","events_url":"https://api.github.com/users/breillyr/events{/privacy}","received_events_url":"https://api.github.com/users/breillyr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/breillyr/dockpulp","description":"ReST API Client to Pulp for manipulating docker images","fork":true,"url":"https://api.github.com/repos/breillyr/dockpulp","forks_url":"https://api.github.com/repos/breillyr/dockpulp/forks","keys_url":"https://api.github.com/repos/breillyr/dockpulp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/breillyr/dockpulp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/breillyr/dockpulp/teams","hooks_url":"https://api.github.com/repos/breillyr/dockpulp/hooks","issue_events_url":"https://api.github.com/repos/breillyr/dockpulp/issues/events{/number}","events_url":"https://api.github.com/repos/breillyr/dockpulp/events","assignees_url":"https://api.github.com/repos/breillyr/dockpulp/assignees{/user}","branches_url":"https://api.github.com/repos/breillyr/dockpulp/branches{/branch}","tags_url":"https://api.github.com/repos/breillyr/dockpulp/tags","blobs_url":"https://api.github.com/repos/breillyr/dockpulp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/breillyr/dockpulp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/breillyr/dockpulp/git/refs{/sha}","trees_url":"https://api.github.com/repos/breillyr/dockpulp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/breillyr/dockpulp/statuses/{sha}","languages_url":"https://api.github.com/repos/breillyr/dockpulp/languages","stargazers_url":"https://api.github.com/repos/breillyr/dockpulp/stargazers","contributors_url":"https://api.github.com/repos/breillyr/dockpulp/contributors","subscribers_url":"https://api.github.com/repos/breillyr/dockpulp/subscribers","subscription_url":"https://api.github.com/repos/breillyr/dockpulp/subscription","commits_url":"https://api.github.com/repos/breillyr/dockpulp/commits{/sha}","git_commits_url":"https://api.github.com/repos/breillyr/dockpulp/git/commits{/sha}","comments_url":"https://api.github.com/repos/breillyr/dockpulp/comments{/number}","issue_comment_url":"https://api.github.com/repos/breillyr/dockpulp/issues/comments{/number}","contents_url":"https://api.github.com/repos/breillyr/dockpulp/contents/{+path}","compare_url":"https://api.github.com/repos/breillyr/dockpulp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/breillyr/dockpulp/merges","archive_url":"https://api.github.com/repos/breillyr/dockpulp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/breillyr/dockpulp/downloads","issues_url":"https://api.github.com/repos/breillyr/dockpulp/issues{/number}","pulls_url":"https://api.github.com/repos/breillyr/dockpulp/pulls{/number}","milestones_url":"https://api.github.com/repos/breillyr/dockpulp/milestones{/number}","notifications_url":"https://api.github.com/repos/breillyr/dockpulp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/breillyr/dockpulp/labels{/name}","releases_url":"https://api.github.com/repos/breillyr/dockpulp/releases{/id}","deployments_url":"https://api.github.com/repos/breillyr/dockpulp/deployments","created_at":"2016-04-28T19:45:42Z","updated_at":"2016-04-28T19:45:43Z","pushed_at":"2017-08-23T20:05:28Z","git_url":"git://github.com/breillyr/dockpulp.git","ssh_url":"git@github.com:breillyr/dockpulp.git","clone_url":"https://github.com/breillyr/dockpulp.git","svn_url":"https://github.com/breillyr/dockpulp","homepage":null,"size":579,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"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":0,"default_branch":"master"}},"base":{"label":"release-engineering:master","ref":"master","sha":"a07bb705d67114d20956046f3f5698c85517732b","user":{"login":"release-engineering","id":9591189,"avatar_url":"https://avatars3.githubusercontent.com/u/9591189?v=4","gravatar_id":"","url":"https://api.github.com/users/release-engineering","html_url":"https://github.com/release-engineering","followers_url":"https://api.github.com/users/release-engineering/followers","following_url":"https://api.github.com/users/release-engineering/following{/other_user}","gists_url":"https://api.github.com/users/release-engineering/gists{/gist_id}","starred_url":"https://api.github.com/users/release-engineering/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/release-engineering/subscriptions","organizations_url":"https://api.github.com/users/release-engineering/orgs","repos_url":"https://api.github.com/users/release-engineering/repos","events_url":"https://api.github.com/users/release-engineering/events{/privacy}","received_events_url":"https://api.github.com/users/release-engineering/received_events","type":"Organization","site_admin":false},"repo":{"id":36458026,"name":"dockpulp","full_name":"release-engineering/dockpulp","owner":{"login":"release-engineering","id":9591189,"avatar_url":"https://avatars3.githubusercontent.com/u/9591189?v=4","gravatar_id":"","url":"https://api.github.com/users/release-engineering","html_url":"https://github.com/release-engineering","followers_url":"https://api.github.com/users/release-engineering/followers","following_url":"https://api.github.com/users/release-engineering/following{/other_user}","gists_url":"https://api.github.com/users/release-engineering/gists{/gist_id}","starred_url":"https://api.github.com/users/release-engineering/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/release-engineering/subscriptions","organizations_url":"https://api.github.com/users/release-engineering/orgs","repos_url":"https://api.github.com/users/release-engineering/repos","events_url":"https://api.github.com/users/release-engineering/events{/privacy}","received_events_url":"https://api.github.com/users/release-engineering/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/release-engineering/dockpulp","description":"ReST API Client to Pulp for manipulating docker images","fork":false,"url":"https://api.github.com/repos/release-engineering/dockpulp","forks_url":"https://api.github.com/repos/release-engineering/dockpulp/forks","keys_url":"https://api.github.com/repos/release-engineering/dockpulp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/release-engineering/dockpulp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/release-engineering/dockpulp/teams","hooks_url":"https://api.github.com/repos/release-engineering/dockpulp/hooks","issue_events_url":"https://api.github.com/repos/release-engineering/dockpulp/issues/events{/number}","events_url":"https://api.github.com/repos/release-engineering/dockpulp/events","assignees_url":"https://api.github.com/repos/release-engineering/dockpulp/assignees{/user}","branches_url":"https://api.github.com/repos/release-engineering/dockpulp/branches{/branch}","tags_url":"https://api.github.com/repos/release-engineering/dockpulp/tags","blobs_url":"https://api.github.com/repos/release-engineering/dockpulp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/release-engineering/dockpulp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/release-engineering/dockpulp/git/refs{/sha}","trees_url":"https://api.github.com/repos/release-engineering/dockpulp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/release-engineering/dockpulp/statuses/{sha}","languages_url":"https://api.github.com/repos/release-engineering/dockpulp/languages","stargazers_url":"https://api.github.com/repos/release-engineering/dockpulp/stargazers","contributors_url":"https://api.github.com/repos/release-engineering/dockpulp/contributors","subscribers_url":"https://api.github.com/repos/release-engineering/dockpulp/subscribers","subscription_url":"https://api.github.com/repos/release-engineering/dockpulp/subscription","commits_url":"https://api.github.com/repos/release-engineering/dockpulp/commits{/sha}","git_commits_url":"https://api.github.com/repos/release-engineering/dockpulp/git/commits{/sha}","comments_url":"https://api.github.com/repos/release-engineering/dockpulp/comments{/number}","issue_comment_url":"https://api.github.com/repos/release-engineering/dockpulp/issues/comments{/number}","contents_url":"https://api.github.com/repos/release-engineering/dockpulp/contents/{+path}","compare_url":"https://api.github.com/repos/release-engineering/dockpulp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/release-engineering/dockpulp/merges","archive_url":"https://api.github.com/repos/release-engineering/dockpulp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/release-engineering/dockpulp/downloads","issues_url":"https://api.github.com/repos/release-engineering/dockpulp/issues{/number}","pulls_url":"https://api.github.com/repos/release-engineering/dockpulp/pulls{/number}","milestones_url":"https://api.github.com/repos/release-engineering/dockpulp/milestones{/number}","notifications_url":"https://api.github.com/repos/release-engineering/dockpulp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/release-engineering/dockpulp/labels{/name}","releases_url":"https://api.github.com/repos/release-engineering/dockpulp/releases{/id}","deployments_url":"https://api.github.com/repos/release-engineering/dockpulp/deployments","created_at":"2015-05-28T18:30:30Z","updated_at":"2017-05-04T15:45:26Z","pushed_at":"2017-08-23T20:05:29Z","git_url":"git://github.com/release-engineering/dockpulp.git","ssh_url":"git@github.com:release-engineering/dockpulp.git","clone_url":"https://github.com/release-engineering/dockpulp.git","svn_url":"https://github.com/release-engineering/dockpulp","homepage":null,"size":582,"stargazers_count":5,"watchers_count":5,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":3,"forks":15,"open_issues":3,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/release-engineering/dockpulp/pulls/141"},"html":{"href":"https://github.com/release-engineering/dockpulp/pull/141"},"issue":{"href":"https://api.github.com/repos/release-engineering/dockpulp/issues/141"},"comments":{"href":"https://api.github.com/repos/release-engineering/dockpulp/issues/141/comments"},"review_comments":{"href":"https://api.github.com/repos/release-engineering/dockpulp/pulls/141/comments"},"review_comment":{"href":"https://api.github.com/repos/release-engineering/dockpulp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/release-engineering/dockpulp/pulls/141/commits"},"statuses":{"href":"https://api.github.com/repos/release-engineering/dockpulp/statuses/efe39efb1c90fe7bfc521d1ae60ac72f3f1c68aa"}}}}
{"actor":{"display_login":"bfontecc007"}}