From 720861e3835556a5f06b86af4385fdc24be7d465 Mon Sep 17 00:00:00 2001 From: Ulises <0xTlaloc@gmail.com> Date: Wed, 20 Sep 2023 12:16:22 -0700 Subject: [PATCH 1/3] Adding new enums for verification reasons using X.509 certificate signatures --- .../org/kohsuke/github/GHVerification.java | 43 ++++-- .../github/GHVerificationReasonTest.java | 84 +++++++++++ .../__files/repos_hub4j_github-api-2.json | 130 ++++++++++++++++++ ...245aa6d71d54923655066049d9e21a15f01-3.json | 98 +++++++++++++ .../wiremock/testBadCert/__files/user-1.json | 45 ++++++ .../mappings/repos_hub4j_github-api-2.json | 48 +++++++ ...245aa6d71d54923655066049d9e21a15f01-3.json | 48 +++++++ .../wiremock/testBadCert/mappings/user-1.json | 48 +++++++ .../__files/repos_hub4j_github-api-2.json | 130 ++++++++++++++++++ ...245aa6d71d54923655066049d9e21a15f01-3.json | 98 +++++++++++++ .../testMalformedSig/__files/user-1.json | 45 ++++++ .../mappings/repos_hub4j_github-api-2.json | 48 +++++++ ...245aa6d71d54923655066049d9e21a15f01-3.json | 48 +++++++ .../testMalformedSig/mappings/user-1.json | 48 +++++++ .../__files/repos_hub4j_github-api-2.json | 130 ++++++++++++++++++ ...245aa6d71d54923655066049d9e21a15f01-3.json | 98 +++++++++++++ .../testOcspError/__files/user-1.json | 45 ++++++ .../mappings/repos_hub4j_github-api-2.json | 48 +++++++ ...245aa6d71d54923655066049d9e21a15f01-3.json | 48 +++++++ .../testOcspError/mappings/user-1.json | 48 +++++++ .../__files/repos_hub4j_github-api-2.json | 130 ++++++++++++++++++ ...245aa6d71d54923655066049d9e21a15f01-3.json | 98 +++++++++++++ .../testOscpPending/__files/user-1.json | 45 ++++++ .../mappings/repos_hub4j_github-api-2.json | 48 +++++++ ...245aa6d71d54923655066049d9e21a15f01-3.json | 48 +++++++ .../testOscpPending/mappings/user-1.json | 48 +++++++ .../__files/repos_hub4j_github-api-2.json | 130 ++++++++++++++++++ ...245aa6d71d54923655066049d9e21a15f01-3.json | 98 +++++++++++++ .../testOscpRevoked/__files/user-1.json | 45 ++++++ .../mappings/repos_hub4j_github-api-2.json | 48 +++++++ ...245aa6d71d54923655066049d9e21a15f01-3.json | 48 +++++++ .../testOscpRevoked/mappings/user-1.json | 48 +++++++ 32 files changed, 2198 insertions(+), 14 deletions(-) create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testBadCert/__files/repos_hub4j_github-api-2.json create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testBadCert/__files/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testBadCert/__files/user-1.json create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testBadCert/mappings/repos_hub4j_github-api-2.json create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testBadCert/mappings/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testBadCert/mappings/user-1.json create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testMalformedSig/__files/repos_hub4j_github-api-2.json create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testMalformedSig/__files/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testMalformedSig/__files/user-1.json create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testMalformedSig/mappings/repos_hub4j_github-api-2.json create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testMalformedSig/mappings/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testMalformedSig/mappings/user-1.json create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOcspError/__files/repos_hub4j_github-api-2.json create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOcspError/__files/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOcspError/__files/user-1.json create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOcspError/mappings/repos_hub4j_github-api-2.json create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOcspError/mappings/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOcspError/mappings/user-1.json create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpPending/__files/repos_hub4j_github-api-2.json create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpPending/__files/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpPending/__files/user-1.json create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpPending/mappings/repos_hub4j_github-api-2.json create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpPending/mappings/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpPending/mappings/user-1.json create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpRevoked/__files/repos_hub4j_github-api-2.json create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpRevoked/__files/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpRevoked/__files/user-1.json create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpRevoked/mappings/repos_hub4j_github-api-2.json create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpRevoked/mappings/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json create mode 100644 src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpRevoked/mappings/user-1.json diff --git a/src/main/java/org/kohsuke/github/GHVerification.java b/src/main/java/org/kohsuke/github/GHVerification.java index 382d39a26e..ce92905730 100644 --- a/src/main/java/org/kohsuke/github/GHVerification.java +++ b/src/main/java/org/kohsuke/github/GHVerification.java @@ -66,43 +66,58 @@ public String getPayload() { */ public enum Reason { - /** The expired key. */ + /** Signing key expired. */ EXPIRED_KEY, - /** The not signing key. */ + /** The usage flags for the key that signed this don't allow signing. */ NOT_SIGNING_KEY, - /** The gpgverify error. */ + /** The GPG verification service misbehaved. */ GPGVERIFY_ERROR, - /** The gpgverify unavailable. */ + /** The GPG verification service is unavailable at the moment. */ GPGVERIFY_UNAVAILABLE, - /** The unsigned. */ + /** Unsigned. */ UNSIGNED, - /** The unknown signature type. */ + /** Unknown signature type. */ UNKNOWN_SIGNATURE_TYPE, - /** The no user. */ + /** Email used for signing not known to GitHub. */ NO_USER, - /** The unverified email. */ + /** Email used for signing unverified on GitHub. */ UNVERIFIED_EMAIL, - /** The bad email. */ + /** Invalid email used for signing. */ BAD_EMAIL, - /** The unknown key. */ + /** Key used for signing not known to GitHub. */ UNKNOWN_KEY, - /** The malformed signature. */ + /** Malformed signature. */ MALFORMED_SIGNATURE, - /** The invalid. */ + /** Invalid signature. */ INVALID, - /** The valid. */ - VALID + /** Valid signature and verified by GitHub. */ + VALID, + + /** The signing certificate or its chain could not be verified. */ + BAD_CERT, + + /** Malformed signature. (Returned by graphQL) */ + MALFORMED_SIG, + + /** Valid signature, though certificate revocation check failed. */ + OCSP_ERROR, + + /** Valid signature, pending certificate revocation checking. */ + OCSP_PENDING, + + /** One or more certificates in chain has been revoked. */ + OCSP_REVOKED } } diff --git a/src/test/java/org/kohsuke/github/GHVerificationReasonTest.java b/src/test/java/org/kohsuke/github/GHVerificationReasonTest.java index 73977ef1d4..42b3292c72 100644 --- a/src/test/java/org/kohsuke/github/GHVerificationReasonTest.java +++ b/src/test/java/org/kohsuke/github/GHVerificationReasonTest.java @@ -217,4 +217,88 @@ public void testValid() throws Exception { assertThat(commit.getCommitShortInfo().getVerification().getPayload(), notNullValue()); assertThat(commit.getCommitShortInfo().getVerification().getSignature(), notNullValue()); } + + /** + * Test bad cert. + * + * @throws Exception + * the exception + */ + @Test + public void testBadCert() throws Exception { + GHRepository r = gitHub.getRepository("hub4j/github-api"); + GHCommit commit = r.getCommit("86a2e245aa6d71d54923655066049d9e21a15f01"); + assertThat(commit.getCommitShortInfo().getAuthor().getName(), equalTo("Sourabh Parkala")); + assertThat(commit.getCommitShortInfo().getVerification().getSignature(), notNullValue()); + assertThat(commit.getCommitShortInfo().getVerification().isVerified(), is(false)); + assertThat(commit.getCommitShortInfo().getVerification().getReason(), equalTo(GHVerification.Reason.BAD_CERT)); + } + + /** + * Test malformed sig. + * + * @throws Exception + * the exception + */ + @Test + public void testMalformedSig() throws Exception { + GHRepository r = gitHub.getRepository("hub4j/github-api"); + GHCommit commit = r.getCommit("86a2e245aa6d71d54923655066049d9e21a15f01"); + assertThat(commit.getCommitShortInfo().getAuthor().getName(), equalTo("Sourabh Parkala")); + assertThat(commit.getCommitShortInfo().getVerification().getSignature(), notNullValue()); + assertThat(commit.getCommitShortInfo().getVerification().isVerified(), is(false)); + assertThat(commit.getCommitShortInfo().getVerification().getReason(), + equalTo(GHVerification.Reason.MALFORMED_SIG)); + } + + /** + * Test OSCP error. + * + * @throws Exception + * the exception + */ + @Test + public void testOcspError() throws Exception { + GHRepository r = gitHub.getRepository("hub4j/github-api"); + GHCommit commit = r.getCommit("86a2e245aa6d71d54923655066049d9e21a15f01"); + assertThat(commit.getCommitShortInfo().getAuthor().getName(), equalTo("Sourabh Parkala")); + assertThat(commit.getCommitShortInfo().getVerification().getSignature(), notNullValue()); + assertThat(commit.getCommitShortInfo().getVerification().isVerified(), is(false)); + assertThat(commit.getCommitShortInfo().getVerification().getReason(), + equalTo(GHVerification.Reason.OCSP_ERROR)); + } + + /** + * Test OSCP pending. + * + * @throws Exception + * the exception + */ + @Test + public void testOscpPending() throws Exception { + GHRepository r = gitHub.getRepository("hub4j/github-api"); + GHCommit commit = r.getCommit("86a2e245aa6d71d54923655066049d9e21a15f01"); + assertThat(commit.getCommitShortInfo().getAuthor().getName(), equalTo("Sourabh Parkala")); + assertThat(commit.getCommitShortInfo().getVerification().getSignature(), notNullValue()); + assertThat(commit.getCommitShortInfo().getVerification().isVerified(), is(false)); + assertThat(commit.getCommitShortInfo().getVerification().getReason(), + equalTo(GHVerification.Reason.OCSP_PENDING)); + } + + /** + * Test OCSP revoked. + * + * @throws Exception + * the exception + */ + @Test + public void testOscpRevoked() throws Exception { + GHRepository r = gitHub.getRepository("hub4j/github-api"); + GHCommit commit = r.getCommit("86a2e245aa6d71d54923655066049d9e21a15f01"); + assertThat(commit.getCommitShortInfo().getAuthor().getName(), equalTo("Sourabh Parkala")); + assertThat(commit.getCommitShortInfo().getVerification().getSignature(), notNullValue()); + assertThat(commit.getCommitShortInfo().getVerification().isVerified(), is(false)); + assertThat(commit.getCommitShortInfo().getVerification().getReason(), + equalTo(GHVerification.Reason.OCSP_REVOKED)); + } } diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testBadCert/__files/repos_hub4j_github-api-2.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testBadCert/__files/repos_hub4j_github-api-2.json new file mode 100644 index 0000000000..43ee270874 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testBadCert/__files/repos_hub4j_github-api-2.json @@ -0,0 +1,130 @@ +{ + "id": 617210, + "node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=", + "name": "github-api", + "full_name": "hub4j/github-api", + "private": false, + "owner": { + "login": "hub4j", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j", + "html_url": "https://github.com/hub4j", + "followers_url": "https://api.github.com/users/hub4j/followers", + "following_url": "https://api.github.com/users/hub4j/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j/orgs", + "repos_url": "https://api.github.com/users/hub4j/repos", + "events_url": "https://api.github.com/users/hub4j/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j/github-api", + "description": "Java API for GitHub", + "fork": false, + "url": "https://api.github.com/repos/hub4j/github-api", + "forks_url": "https://api.github.com/repos/hub4j/github-api/forks", + "keys_url": "https://api.github.com/repos/hub4j/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j/github-api/teams", + "hooks_url": "https://api.github.com/repos/hub4j/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j/github-api/events", + "assignees_url": "https://api.github.com/repos/hub4j/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j/github-api/tags", + "blobs_url": "https://api.github.com/repos/hub4j/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j/github-api/languages", + "stargazers_url": "https://api.github.com/repos/hub4j/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j/github-api/subscription", + "commits_url": "https://api.github.com/repos/hub4j/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j/github-api/merges", + "archive_url": "https://api.github.com/repos/hub4j/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j/github-api/downloads", + "issues_url": "https://api.github.com/repos/hub4j/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j/github-api/deployments", + "created_at": "2010-04-19T04:13:03Z", + "updated_at": "2019-10-25T01:32:16Z", + "pushed_at": "2019-10-25T16:41:09Z", + "git_url": "git://github.com/hub4j/github-api.git", + "ssh_url": "git@github.com:hub4j/github-api.git", + "clone_url": "https://github.com/hub4j/github-api.git", + "svn_url": "https://github.com/hub4j/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 13494, + "stargazers_count": 565, + "watchers_count": 565, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 433, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 64, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 433, + "open_issues": 64, + "watchers": 565, + "default_branch": "main", + "permissions": { + "admin": true, + "push": true, + "pull": true + }, + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "organization": { + "login": "hub4j", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j", + "html_url": "https://github.com/hub4j", + "followers_url": "https://api.github.com/users/hub4j/followers", + "following_url": "https://api.github.com/users/hub4j/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j/orgs", + "repos_url": "https://api.github.com/users/hub4j/repos", + "events_url": "https://api.github.com/users/hub4j/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j/received_events", + "type": "Organization", + "site_admin": false + }, + "network_count": 433, + "subscribers_count": 48 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testBadCert/__files/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testBadCert/__files/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json new file mode 100644 index 0000000000..77895afe2c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testBadCert/__files/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json @@ -0,0 +1,98 @@ +{ + "sha": "86a2e245aa6d71d54923655066049d9e21a15f01", + "node_id": "MDY6Q29tbWl0NjE3MjEwOjg2YTJlMjQ1YWE2ZDcxZDU0OTIzNjU1MDY2MDQ5ZDllMjFhMTVmMjM=", + "commit": { + "author": { + "name": "Sourabh Parkala", + "email": "sourabh.sarvotham.parkala@sap.com", + "date": "2010-04-19T04:12:41Z" + }, + "committer": { + "name": "Sourabh Parkala", + "email": "sourabh.sarvotham.parkala@sap.com", + "date": "2010-04-19T04:12:41Z" + }, + "message": "doc", + "tree": { + "sha": "17ed4173aeb2e98c93216e8b6e16138dc7f8cd91", + "url": "https://api.github.com/repos/hub4j/github-api/git/trees/17ed4173aeb2e98c93216e8b6e16138dc7f8cd91" + }, + "url": "https://api.github.com/repos/hub4j/github-api/git/commits/86a2e245aa6d71d54923655066049d9e21a15f01", + "comment_count": 0, + "verification": { + "verified": false, + "reason": "bad_cert", + "signature": "-----BEGIN SIGNED MESSAGE-----\nMIIFdQYJKoZIhvcNAQcCoIIFZjCCBWICAQExDTALBglghkgBZQMEAgEwCwYJKoZI\nhvcNAQcBoIIDejCCA3YwggJeoAMCAQICAQIwDQYJKoZIhvcNAQELBQAwKjEbMBkG\nA1UEAwwSQXN0cm9UbGFsb2PigJlzIENBMQswCQYDVQQGEwJVUzAeFw0yMzA5MTgy\nMzI2MDlaFw0yNDA5MTcyMzI2MDlaMEYxFDASBgNVBAMMC0FzdHJvVGxhbG9jMQsw\nCQYDVQQGEwJVUzEhMB8GCSqGSIb3DQEJARYSMHhUbGFsb2NAZ21haWwuY29tMIIB\nIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA+Zq+N5v68htABs4ZLPORns/F\nzixnI+6L+WaVGeQFzxIBs9zsm9IRGJ4xoMBPSg1BuoilRXzsQoCH6+5zyQ4jaHMa\nHBBEijVM7kor3Um+35KdYh79nIY7ZQoDRypLF02FiqfNjhN8Nm8ciNf2EUkiGIcj\n/+TPhVFMxnwlZ2SmSJoMBE5pkDBllb/8kfxgenSoVLXaOigYJ1It6AqH2L8Ju9pa\nJ1zJGu2edjN6xi/0yjzZ7CmPFbnWcY5flJfMqdaj0Po3dMwYKYK07rE7KQHc8wFT\ngAUtQNtJkGBjEcTBh1B7SUsnJ/x4XcSQwOMxPNSm4Esn2RWanJYunez75eCWlwID\nAQABo4GKMIGHMA4GA1UdDwEB/wQEAwIFoDAWBgNVHSUBAf8EDDAKBggrBgEFBQcD\nBDAdBgNVHQ4EFgQUSi5d7oqzSYNhpeG4I2VNF9j881UwHwYDVR0jBBgwFoAULCWl\nbibBiKOX/6M3RWgIlSPM7dcwHQYDVR0RBBYwFIESMHhUbGFsb2NAZ21haWwuY29t\nMA0GCSqGSIb3DQEBCwUAA4IBAQDSn3caORjlSXCSm8ZY1uAbG+IngvEooIJvbl+y\n0yglPA3pkWybXxLfvayJVRGtNgLambnPpulzZmdwjj7qSTzd9K/+OIsI2qjNrZZ+\napXJLhlfabNHzydj0y0DUWgbtKzQ1SVhWgglHaCp440UmVAi0PtsMy3F1S5S0HlZ\n80V1CE3r7UYsC64GG3CmyXVf5MB+pzPriE729Gglig5z6rq8F+GNk5hJW7tOKBRb\nCyXFkqbkMWHPJ/CP5wrFjrEITsn8fIhlJsYRIAGzTnffCOs9i3rMpUTXRBOwSVMB\nI1I3VPm+WxVE7O9NY7TGBDe7010D4DorTNUPYo8xsPtKYyrpMYIBwTCCAb0CAQEw\nLzAqMRswGQYDVQQDDBJBc3Ryb1RsYWxvY+KAmXMgQ0ExCzAJBgNVBAYTAlVTAgEC\nMAsGCWCGSAFlAwQCAaBpMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZI\nhvcNAQkFMQ8XDTIzMDkxODIzMjg1MFowLwYJKoZIhvcNAQkEMSIEIIFHI8Ick3Tu\nBlnfTU6v24ls8D+jGkpQoDK+MF4rk5iTMAsGCSqGSIb3DQEBCwSCAQC4nIUEB/bR\ngeXnO7KdtqRFn/slCNTKZaQObsyL7C7cmNYAlgQAYj/qOBhKGMd3ZAFHRUroCiCy\n5GPs1sEnPKT1Bh7E7HJbpfdMXZINxoiRBrwQpAD/UKxk6etF5qvtAwDJaFMZiTMh\nd6tPNVBcThhUglSqqQFT3BKE9z5KTGwonMeqZlyf/EpXRBn0YcaoWvcAzaahMBQw\nUPwwEtU3FVyYBbLQee0SoYDsddEjdaNN/37auMVIltYmKNq/A4KhJWduTGFcaD/k\nfcXIzhzBi4vk1No6y2ftDgbivxP3MVQyf1tIfD1fv9cw/55JnDRA3IXkQRc+yyUG\nGmHXpKHhqNKm\n-----END SIGNED MESSAGE-----", + "payload": null + } + }, + "url": "https://api.github.com/repos/hub4j/github-api/commits/86a2e245aa6d71d54923655066049d9e21a15f01", + "html_url": "https://github.com/hub4j/github-api/commit/86a2e245aa6d71d54923655066049d9e21a15f01", + "comments_url": "https://api.github.com/repos/hub4j/github-api/commits/86a2e245aa6d71d54923655066049d9e21a15f01/comments", + "author": { + "login": "kohsuke", + "id": 50003, + "node_id": "MDQ6VXNlcjUwMDAz", + "avatar_url": "https://avatars1.githubusercontent.com/u/50003?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kohsuke", + "html_url": "https://github.com/kohsuke", + "followers_url": "https://api.github.com/users/kohsuke/followers", + "following_url": "https://api.github.com/users/kohsuke/following{/other_user}", + "gists_url": "https://api.github.com/users/kohsuke/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kohsuke/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kohsuke/subscriptions", + "organizations_url": "https://api.github.com/users/kohsuke/orgs", + "repos_url": "https://api.github.com/users/kohsuke/repos", + "events_url": "https://api.github.com/users/kohsuke/events{/privacy}", + "received_events_url": "https://api.github.com/users/kohsuke/received_events", + "type": "User", + "site_admin": false + }, + "committer": { + "login": "kohsuke", + "id": 50003, + "node_id": "MDQ6VXNlcjUwMDAz", + "avatar_url": "https://avatars1.githubusercontent.com/u/50003?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kohsuke", + "html_url": "https://github.com/kohsuke", + "followers_url": "https://api.github.com/users/kohsuke/followers", + "following_url": "https://api.github.com/users/kohsuke/following{/other_user}", + "gists_url": "https://api.github.com/users/kohsuke/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kohsuke/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kohsuke/subscriptions", + "organizations_url": "https://api.github.com/users/kohsuke/orgs", + "repos_url": "https://api.github.com/users/kohsuke/repos", + "events_url": "https://api.github.com/users/kohsuke/events{/privacy}", + "received_events_url": "https://api.github.com/users/kohsuke/received_events", + "type": "User", + "site_admin": false + }, + "parents": [ + { + "sha": "ecbfdd7315ef2cf04b2be7f11a072ce0bd00c396", + "url": "https://api.github.com/repos/hub4j/github-api/commits/ecbfdd7315ef2cf04b2be7f11a072ce0bd00c396", + "html_url": "https://github.com/hub4j/github-api/commit/ecbfdd7315ef2cf04b2be7f11a072ce0bd00c396" + } + ], + "stats": { + "total": 3, + "additions": 3, + "deletions": 0 + }, + "files": [ + { + "sha": "2a2e1f77fd77bd03273946d893d25a455f696be0", + "filename": "README", + "status": "added", + "additions": 3, + "deletions": 0, + "changes": 3, + "blob_url": "https://github.com/hub4j/github-api/blob/86a2e245aa6d71d54923655066049d9e21a15f01/README", + "raw_url": "https://github.com/hub4j/github-api/raw/86a2e245aa6d71d54923655066049d9e21a15f01/README", + "contents_url": "https://api.github.com/repos/hub4j/github-api/contents/README?ref=86a2e245aa6d71d54923655066049d9e21a15f01", + "patch": "@@ -0,0 +1,3 @@\n+Java API for GitHub\n+\n+See http://kohsuke.org/github-api/ for more details" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testBadCert/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testBadCert/__files/user-1.json new file mode 100644 index 0000000000..a4b576e8a7 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testBadCert/__files/user-1.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 169, + "public_gists": 7, + "followers": 139, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z", + "private_gists": 7, + "total_private_repos": 9, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testBadCert/mappings/repos_hub4j_github-api-2.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testBadCert/mappings/repos_hub4j_github-api-2.json new file mode 100644 index 0000000000..80fb7dfa4e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testBadCert/mappings/repos_hub4j_github-api-2.json @@ -0,0 +1,48 @@ +{ + "id": "441cdfd7-a44a-42b4-b732-57e674227760", + "name": "repos_hub4j_github-api", + "request": { + "url": "/repos/hub4j/github-api", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j_github-api-2.json", + "headers": { + "Date": "Sat, 26 Oct 2019 01:28:40 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4295", + "X-RateLimit-Reset": "1572055286", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"c1a01d01a6354d93b3cc6098e0b2d047\"", + "Last-Modified": "Fri, 25 Oct 2019 01:32:16 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CB01:05A2:A65B56:C4A050:5DB3A147" + } + }, + "uuid": "441cdfd7-a44a-42b4-b732-57e674227760", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testBadCert/mappings/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testBadCert/mappings/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json new file mode 100644 index 0000000000..6b5904361c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testBadCert/mappings/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json @@ -0,0 +1,48 @@ +{ + "id": "d76abea9-c1be-430a-bbd0-28931c58e1e8", + "name": "repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01", + "request": { + "url": "/repos/hub4j/github-api/commits/86a2e245aa6d71d54923655066049d9e21a15f01", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json", + "headers": { + "Date": "Sat, 26 Oct 2019 01:28:40 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4294", + "X-RateLimit-Reset": "1572055286", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"0a8c453e4290ce879ea09578e06a5961\"", + "Last-Modified": "Mon, 19 Apr 2010 04:12:41 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CB01:05A2:A65B5F:C4A064:5DB3A148" + } + }, + "uuid": "d76abea9-c1be-430a-bbd0-28931c58e1e8", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testBadCert/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testBadCert/mappings/user-1.json new file mode 100644 index 0000000000..7c0606ff2f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testBadCert/mappings/user-1.json @@ -0,0 +1,48 @@ +{ + "id": "c247f81b-84b8-44e9-820a-0a91dc74ce98", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-1.json", + "headers": { + "Date": "Sat, 26 Oct 2019 01:28:39 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4297", + "X-RateLimit-Reset": "1572055286", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"8c3d3dcf6fc5f9edaf26c902295396e5\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CB01:05A2:A65B49:C4A046:5DB3A147" + } + }, + "uuid": "c247f81b-84b8-44e9-820a-0a91dc74ce98", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testMalformedSig/__files/repos_hub4j_github-api-2.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testMalformedSig/__files/repos_hub4j_github-api-2.json new file mode 100644 index 0000000000..43ee270874 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testMalformedSig/__files/repos_hub4j_github-api-2.json @@ -0,0 +1,130 @@ +{ + "id": 617210, + "node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=", + "name": "github-api", + "full_name": "hub4j/github-api", + "private": false, + "owner": { + "login": "hub4j", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j", + "html_url": "https://github.com/hub4j", + "followers_url": "https://api.github.com/users/hub4j/followers", + "following_url": "https://api.github.com/users/hub4j/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j/orgs", + "repos_url": "https://api.github.com/users/hub4j/repos", + "events_url": "https://api.github.com/users/hub4j/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j/github-api", + "description": "Java API for GitHub", + "fork": false, + "url": "https://api.github.com/repos/hub4j/github-api", + "forks_url": "https://api.github.com/repos/hub4j/github-api/forks", + "keys_url": "https://api.github.com/repos/hub4j/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j/github-api/teams", + "hooks_url": "https://api.github.com/repos/hub4j/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j/github-api/events", + "assignees_url": "https://api.github.com/repos/hub4j/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j/github-api/tags", + "blobs_url": "https://api.github.com/repos/hub4j/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j/github-api/languages", + "stargazers_url": "https://api.github.com/repos/hub4j/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j/github-api/subscription", + "commits_url": "https://api.github.com/repos/hub4j/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j/github-api/merges", + "archive_url": "https://api.github.com/repos/hub4j/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j/github-api/downloads", + "issues_url": "https://api.github.com/repos/hub4j/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j/github-api/deployments", + "created_at": "2010-04-19T04:13:03Z", + "updated_at": "2019-10-25T01:32:16Z", + "pushed_at": "2019-10-25T16:41:09Z", + "git_url": "git://github.com/hub4j/github-api.git", + "ssh_url": "git@github.com:hub4j/github-api.git", + "clone_url": "https://github.com/hub4j/github-api.git", + "svn_url": "https://github.com/hub4j/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 13494, + "stargazers_count": 565, + "watchers_count": 565, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 433, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 64, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 433, + "open_issues": 64, + "watchers": 565, + "default_branch": "main", + "permissions": { + "admin": true, + "push": true, + "pull": true + }, + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "organization": { + "login": "hub4j", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j", + "html_url": "https://github.com/hub4j", + "followers_url": "https://api.github.com/users/hub4j/followers", + "following_url": "https://api.github.com/users/hub4j/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j/orgs", + "repos_url": "https://api.github.com/users/hub4j/repos", + "events_url": "https://api.github.com/users/hub4j/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j/received_events", + "type": "Organization", + "site_admin": false + }, + "network_count": 433, + "subscribers_count": 48 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testMalformedSig/__files/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testMalformedSig/__files/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json new file mode 100644 index 0000000000..8ec18c631d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testMalformedSig/__files/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json @@ -0,0 +1,98 @@ +{ + "sha": "86a2e245aa6d71d54923655066049d9e21a15f01", + "node_id": "MDY6Q29tbWl0NjE3MjEwOjg2YTJlMjQ1YWE2ZDcxZDU0OTIzNjU1MDY2MDQ5ZDllMjFhMTVmMjM=", + "commit": { + "author": { + "name": "Sourabh Parkala", + "email": "sourabh.sarvotham.parkala@sap.com", + "date": "2010-04-19T04:12:41Z" + }, + "committer": { + "name": "Sourabh Parkala", + "email": "sourabh.sarvotham.parkala@sap.com", + "date": "2010-04-19T04:12:41Z" + }, + "message": "doc", + "tree": { + "sha": "17ed4173aeb2e98c93216e8b6e16138dc7f8cd91", + "url": "https://api.github.com/repos/hub4j/github-api/git/trees/17ed4173aeb2e98c93216e8b6e16138dc7f8cd91" + }, + "url": "https://api.github.com/repos/hub4j/github-api/git/commits/86a2e245aa6d71d54923655066049d9e21a15f01", + "comment_count": 0, + "verification": { + "verified": false, + "reason": "malformed_sig", + "signature": "-----BEGIN SIGNED MESSAGE-----\nMIIFdQYJKoZIhvcNAQcCoIIFZjCCBWICAQExDTALBglghkgBZQMEAgEwCwYJKoZI\nhvcNAQcBoIIDejCCA3YwggJeoAMCAQICAQIwDQYJKoZIhvcNAQELBQAwKjEbMBkG\nA1UEAwwSQXN0cm9UbGFsb2PigJlzIENBMQswCQYDVQQGEwJVUzAeFw0yMzA5MTgy\nMzI2MDlaFw0yNDA5MTcyMzI2MDlaMEYxFDASBgNVBAMMC0FzdHJvVGxhbG9jMQsw\nCQYDVQQGEwJVUzEhMB8GCSqGSIb3DQEJARYSMHhUbGFsb2NAZ21haWwuY29tMIIB\nIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA+Zq+N5v68htABs4ZLPORns/F\nzixnI+6L+WaVGeQFzxIBs9zsm9IRGJ4xoMBPSg1BuoilRXzsQoCH6+5zyQ4jaHMa\nHBBEijVM7kor3Um+35KdYh79nIY7ZQoDRypLF02FiqfNjhN8Nm8ciNf2EUkiGIcj\n/+TPhVFMxnwlZ2SmSJoMBE5pkDBllb/8kfxgenSoVLXaOigYJ1It6AqH2L8Ju9pa\nJ1zJGu2edjN6xi/0yjzZ7CmPFbnWcY5flJfMqdaj0Po3dMwYKYK07rE7KQHc8wFT\ngAUtQNtJkGBjEcTBh1B7SUsnJ/x4XcSQwOMxPNSm4Esn2RWanJYunez75eCWlwID\nAQABo4GKMIGHMA4GA1UdDwEB/wQEAwIFoDAWBgNVHSUBAf8EDDAKBggrBgEFBQcD\nBDAdBgNVHQ4EFgQUSi5d7oqzSYNhpeG4I2VNF9j881UwHwYDVR0jBBgwFoAULCWl\nbibBiKOX/6M3RWgIlSPM7dcwHQYDVR0RBBYwFIESMHhUbGFsb2NAZ21haWwuY29t\nMA0GCSqGSIb3DQEBCwUAA4IBAQDSn3caORjlSXCSm8ZY1uAbG+IngvEooIJvbl+y\n0yglPA3pkWybXxLfvayJVRGtNgLambnPpulzZmdwjj7qSTzd9K/+OIsI2qjNrZZ+\napXJLhlfabNHzydj0y0DUWgbtKzQ1SVhWgglHaCp440UmVAi0PtsMy3F1S5S0HlZ\n80V1CE3r7UYsC64GG3CmyXVf5MB+pzPriE729Gglig5z6rq8F+GNk5hJW7tOKBRb\nCyXFkqbkMWHPJ/CP5wrFjrEITsn8fIhlJsYRIAGzTnffCOs9i3rMpUTXRBOwSVMB\nI1I3VPm+WxVE7O9NY7TGBDe7010D4DorTNUPYo8xsPtKYyrpMYIBwTCCAb0CAQEw\nLzAqMRswGQYDVQQDDBJBc3Ryb1RsYWxvY+KAmXMgQ0ExCzAJBgNVBAYTAlVTAgEC\nMAsGCWCGSAFlAwQCAaBpMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZI\nhvcNAQkFMQ8XDTIzMDkxODIzMjg1MFowLwYJKoZIhvcNAQkEMSIEIIFHI8Ick3Tu\nBlnfTU6v24ls8D+jGkpQoDK+MF4rk5iTMAsGCSqGSIb3DQEBCwSCAQC4nIUEB/bR\ngeXnO7KdtqRFn/slCNTKZaQObsyL7C7cmNYAlgQAYj/qOBhKGMd3ZAFHRUroCiCy\n5GPs1sEnPKT1Bh7E7HJbpfdMXZINxoiRBrwQpAD/UKxk6etF5qvtAwDJaFMZiTMh\nd6tPNVBcThhUglSqqQFT3BKE9z5KTGwonMeqZlyf/EpXRBn0YcaoWvcAzaahMBQw\nUPwwEtU3FVyYBbLQee0SoYDsddEjdaNN/37auMVIltYmKNq/A4KhJWduTGFcaD/k\nfcXIzhzBi4vk1No6y2ftDgbivxP3MVQyf1tIfD1fv9cw/55JnDRA3IXkQRc+yyUG\nGmHXpKHhqNKm\n-----END SIGNED MESSAGE-----", + "payload": null + } + }, + "url": "https://api.github.com/repos/hub4j/github-api/commits/86a2e245aa6d71d54923655066049d9e21a15f01", + "html_url": "https://github.com/hub4j/github-api/commit/86a2e245aa6d71d54923655066049d9e21a15f01", + "comments_url": "https://api.github.com/repos/hub4j/github-api/commits/86a2e245aa6d71d54923655066049d9e21a15f01/comments", + "author": { + "login": "kohsuke", + "id": 50003, + "node_id": "MDQ6VXNlcjUwMDAz", + "avatar_url": "https://avatars1.githubusercontent.com/u/50003?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kohsuke", + "html_url": "https://github.com/kohsuke", + "followers_url": "https://api.github.com/users/kohsuke/followers", + "following_url": "https://api.github.com/users/kohsuke/following{/other_user}", + "gists_url": "https://api.github.com/users/kohsuke/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kohsuke/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kohsuke/subscriptions", + "organizations_url": "https://api.github.com/users/kohsuke/orgs", + "repos_url": "https://api.github.com/users/kohsuke/repos", + "events_url": "https://api.github.com/users/kohsuke/events{/privacy}", + "received_events_url": "https://api.github.com/users/kohsuke/received_events", + "type": "User", + "site_admin": false + }, + "committer": { + "login": "kohsuke", + "id": 50003, + "node_id": "MDQ6VXNlcjUwMDAz", + "avatar_url": "https://avatars1.githubusercontent.com/u/50003?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kohsuke", + "html_url": "https://github.com/kohsuke", + "followers_url": "https://api.github.com/users/kohsuke/followers", + "following_url": "https://api.github.com/users/kohsuke/following{/other_user}", + "gists_url": "https://api.github.com/users/kohsuke/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kohsuke/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kohsuke/subscriptions", + "organizations_url": "https://api.github.com/users/kohsuke/orgs", + "repos_url": "https://api.github.com/users/kohsuke/repos", + "events_url": "https://api.github.com/users/kohsuke/events{/privacy}", + "received_events_url": "https://api.github.com/users/kohsuke/received_events", + "type": "User", + "site_admin": false + }, + "parents": [ + { + "sha": "ecbfdd7315ef2cf04b2be7f11a072ce0bd00c396", + "url": "https://api.github.com/repos/hub4j/github-api/commits/ecbfdd7315ef2cf04b2be7f11a072ce0bd00c396", + "html_url": "https://github.com/hub4j/github-api/commit/ecbfdd7315ef2cf04b2be7f11a072ce0bd00c396" + } + ], + "stats": { + "total": 3, + "additions": 3, + "deletions": 0 + }, + "files": [ + { + "sha": "2a2e1f77fd77bd03273946d893d25a455f696be0", + "filename": "README", + "status": "added", + "additions": 3, + "deletions": 0, + "changes": 3, + "blob_url": "https://github.com/hub4j/github-api/blob/86a2e245aa6d71d54923655066049d9e21a15f01/README", + "raw_url": "https://github.com/hub4j/github-api/raw/86a2e245aa6d71d54923655066049d9e21a15f01/README", + "contents_url": "https://api.github.com/repos/hub4j/github-api/contents/README?ref=86a2e245aa6d71d54923655066049d9e21a15f01", + "patch": "@@ -0,0 +1,3 @@\n+Java API for GitHub\n+\n+See http://kohsuke.org/github-api/ for more details" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testMalformedSig/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testMalformedSig/__files/user-1.json new file mode 100644 index 0000000000..a4b576e8a7 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testMalformedSig/__files/user-1.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 169, + "public_gists": 7, + "followers": 139, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z", + "private_gists": 7, + "total_private_repos": 9, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testMalformedSig/mappings/repos_hub4j_github-api-2.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testMalformedSig/mappings/repos_hub4j_github-api-2.json new file mode 100644 index 0000000000..80fb7dfa4e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testMalformedSig/mappings/repos_hub4j_github-api-2.json @@ -0,0 +1,48 @@ +{ + "id": "441cdfd7-a44a-42b4-b732-57e674227760", + "name": "repos_hub4j_github-api", + "request": { + "url": "/repos/hub4j/github-api", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j_github-api-2.json", + "headers": { + "Date": "Sat, 26 Oct 2019 01:28:40 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4295", + "X-RateLimit-Reset": "1572055286", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"c1a01d01a6354d93b3cc6098e0b2d047\"", + "Last-Modified": "Fri, 25 Oct 2019 01:32:16 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CB01:05A2:A65B56:C4A050:5DB3A147" + } + }, + "uuid": "441cdfd7-a44a-42b4-b732-57e674227760", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testMalformedSig/mappings/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testMalformedSig/mappings/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json new file mode 100644 index 0000000000..6b5904361c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testMalformedSig/mappings/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json @@ -0,0 +1,48 @@ +{ + "id": "d76abea9-c1be-430a-bbd0-28931c58e1e8", + "name": "repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01", + "request": { + "url": "/repos/hub4j/github-api/commits/86a2e245aa6d71d54923655066049d9e21a15f01", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json", + "headers": { + "Date": "Sat, 26 Oct 2019 01:28:40 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4294", + "X-RateLimit-Reset": "1572055286", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"0a8c453e4290ce879ea09578e06a5961\"", + "Last-Modified": "Mon, 19 Apr 2010 04:12:41 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CB01:05A2:A65B5F:C4A064:5DB3A148" + } + }, + "uuid": "d76abea9-c1be-430a-bbd0-28931c58e1e8", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testMalformedSig/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testMalformedSig/mappings/user-1.json new file mode 100644 index 0000000000..7c0606ff2f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testMalformedSig/mappings/user-1.json @@ -0,0 +1,48 @@ +{ + "id": "c247f81b-84b8-44e9-820a-0a91dc74ce98", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-1.json", + "headers": { + "Date": "Sat, 26 Oct 2019 01:28:39 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4297", + "X-RateLimit-Reset": "1572055286", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"8c3d3dcf6fc5f9edaf26c902295396e5\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CB01:05A2:A65B49:C4A046:5DB3A147" + } + }, + "uuid": "c247f81b-84b8-44e9-820a-0a91dc74ce98", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOcspError/__files/repos_hub4j_github-api-2.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOcspError/__files/repos_hub4j_github-api-2.json new file mode 100644 index 0000000000..43ee270874 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOcspError/__files/repos_hub4j_github-api-2.json @@ -0,0 +1,130 @@ +{ + "id": 617210, + "node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=", + "name": "github-api", + "full_name": "hub4j/github-api", + "private": false, + "owner": { + "login": "hub4j", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j", + "html_url": "https://github.com/hub4j", + "followers_url": "https://api.github.com/users/hub4j/followers", + "following_url": "https://api.github.com/users/hub4j/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j/orgs", + "repos_url": "https://api.github.com/users/hub4j/repos", + "events_url": "https://api.github.com/users/hub4j/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j/github-api", + "description": "Java API for GitHub", + "fork": false, + "url": "https://api.github.com/repos/hub4j/github-api", + "forks_url": "https://api.github.com/repos/hub4j/github-api/forks", + "keys_url": "https://api.github.com/repos/hub4j/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j/github-api/teams", + "hooks_url": "https://api.github.com/repos/hub4j/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j/github-api/events", + "assignees_url": "https://api.github.com/repos/hub4j/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j/github-api/tags", + "blobs_url": "https://api.github.com/repos/hub4j/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j/github-api/languages", + "stargazers_url": "https://api.github.com/repos/hub4j/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j/github-api/subscription", + "commits_url": "https://api.github.com/repos/hub4j/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j/github-api/merges", + "archive_url": "https://api.github.com/repos/hub4j/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j/github-api/downloads", + "issues_url": "https://api.github.com/repos/hub4j/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j/github-api/deployments", + "created_at": "2010-04-19T04:13:03Z", + "updated_at": "2019-10-25T01:32:16Z", + "pushed_at": "2019-10-25T16:41:09Z", + "git_url": "git://github.com/hub4j/github-api.git", + "ssh_url": "git@github.com:hub4j/github-api.git", + "clone_url": "https://github.com/hub4j/github-api.git", + "svn_url": "https://github.com/hub4j/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 13494, + "stargazers_count": 565, + "watchers_count": 565, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 433, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 64, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 433, + "open_issues": 64, + "watchers": 565, + "default_branch": "main", + "permissions": { + "admin": true, + "push": true, + "pull": true + }, + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "organization": { + "login": "hub4j", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j", + "html_url": "https://github.com/hub4j", + "followers_url": "https://api.github.com/users/hub4j/followers", + "following_url": "https://api.github.com/users/hub4j/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j/orgs", + "repos_url": "https://api.github.com/users/hub4j/repos", + "events_url": "https://api.github.com/users/hub4j/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j/received_events", + "type": "Organization", + "site_admin": false + }, + "network_count": 433, + "subscribers_count": 48 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOcspError/__files/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOcspError/__files/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json new file mode 100644 index 0000000000..4f60cb235f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOcspError/__files/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json @@ -0,0 +1,98 @@ +{ + "sha": "86a2e245aa6d71d54923655066049d9e21a15f01", + "node_id": "MDY6Q29tbWl0NjE3MjEwOjg2YTJlMjQ1YWE2ZDcxZDU0OTIzNjU1MDY2MDQ5ZDllMjFhMTVmMjM=", + "commit": { + "author": { + "name": "Sourabh Parkala", + "email": "sourabh.sarvotham.parkala@sap.com", + "date": "2010-04-19T04:12:41Z" + }, + "committer": { + "name": "Sourabh Parkala", + "email": "sourabh.sarvotham.parkala@sap.com", + "date": "2010-04-19T04:12:41Z" + }, + "message": "doc", + "tree": { + "sha": "17ed4173aeb2e98c93216e8b6e16138dc7f8cd91", + "url": "https://api.github.com/repos/hub4j/github-api/git/trees/17ed4173aeb2e98c93216e8b6e16138dc7f8cd91" + }, + "url": "https://api.github.com/repos/hub4j/github-api/git/commits/86a2e245aa6d71d54923655066049d9e21a15f01", + "comment_count": 0, + "verification": { + "verified": false, + "reason": "ocsp_error", + "signature": "-----BEGIN SIGNED MESSAGE-----\nMIIFdQYJKoZIhvcNAQcCoIIFZjCCBWICAQExDTALBglghkgBZQMEAgEwCwYJKoZI\nhvcNAQcBoIIDejCCA3YwggJeoAMCAQICAQIwDQYJKoZIhvcNAQELBQAwKjEbMBkG\nA1UEAwwSQXN0cm9UbGFsb2PigJlzIENBMQswCQYDVQQGEwJVUzAeFw0yMzA5MTgy\nMzI2MDlaFw0yNDA5MTcyMzI2MDlaMEYxFDASBgNVBAMMC0FzdHJvVGxhbG9jMQsw\nCQYDVQQGEwJVUzEhMB8GCSqGSIb3DQEJARYSMHhUbGFsb2NAZ21haWwuY29tMIIB\nIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA+Zq+N5v68htABs4ZLPORns/F\nzixnI+6L+WaVGeQFzxIBs9zsm9IRGJ4xoMBPSg1BuoilRXzsQoCH6+5zyQ4jaHMa\nHBBEijVM7kor3Um+35KdYh79nIY7ZQoDRypLF02FiqfNjhN8Nm8ciNf2EUkiGIcj\n/+TPhVFMxnwlZ2SmSJoMBE5pkDBllb/8kfxgenSoVLXaOigYJ1It6AqH2L8Ju9pa\nJ1zJGu2edjN6xi/0yjzZ7CmPFbnWcY5flJfMqdaj0Po3dMwYKYK07rE7KQHc8wFT\ngAUtQNtJkGBjEcTBh1B7SUsnJ/x4XcSQwOMxPNSm4Esn2RWanJYunez75eCWlwID\nAQABo4GKMIGHMA4GA1UdDwEB/wQEAwIFoDAWBgNVHSUBAf8EDDAKBggrBgEFBQcD\nBDAdBgNVHQ4EFgQUSi5d7oqzSYNhpeG4I2VNF9j881UwHwYDVR0jBBgwFoAULCWl\nbibBiKOX/6M3RWgIlSPM7dcwHQYDVR0RBBYwFIESMHhUbGFsb2NAZ21haWwuY29t\nMA0GCSqGSIb3DQEBCwUAA4IBAQDSn3caORjlSXCSm8ZY1uAbG+IngvEooIJvbl+y\n0yglPA3pkWybXxLfvayJVRGtNgLambnPpulzZmdwjj7qSTzd9K/+OIsI2qjNrZZ+\napXJLhlfabNHzydj0y0DUWgbtKzQ1SVhWgglHaCp440UmVAi0PtsMy3F1S5S0HlZ\n80V1CE3r7UYsC64GG3CmyXVf5MB+pzPriE729Gglig5z6rq8F+GNk5hJW7tOKBRb\nCyXFkqbkMWHPJ/CP5wrFjrEITsn8fIhlJsYRIAGzTnffCOs9i3rMpUTXRBOwSVMB\nI1I3VPm+WxVE7O9NY7TGBDe7010D4DorTNUPYo8xsPtKYyrpMYIBwTCCAb0CAQEw\nLzAqMRswGQYDVQQDDBJBc3Ryb1RsYWxvY+KAmXMgQ0ExCzAJBgNVBAYTAlVTAgEC\nMAsGCWCGSAFlAwQCAaBpMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZI\nhvcNAQkFMQ8XDTIzMDkxODIzMjg1MFowLwYJKoZIhvcNAQkEMSIEIIFHI8Ick3Tu\nBlnfTU6v24ls8D+jGkpQoDK+MF4rk5iTMAsGCSqGSIb3DQEBCwSCAQC4nIUEB/bR\ngeXnO7KdtqRFn/slCNTKZaQObsyL7C7cmNYAlgQAYj/qOBhKGMd3ZAFHRUroCiCy\n5GPs1sEnPKT1Bh7E7HJbpfdMXZINxoiRBrwQpAD/UKxk6etF5qvtAwDJaFMZiTMh\nd6tPNVBcThhUglSqqQFT3BKE9z5KTGwonMeqZlyf/EpXRBn0YcaoWvcAzaahMBQw\nUPwwEtU3FVyYBbLQee0SoYDsddEjdaNN/37auMVIltYmKNq/A4KhJWduTGFcaD/k\nfcXIzhzBi4vk1No6y2ftDgbivxP3MVQyf1tIfD1fv9cw/55JnDRA3IXkQRc+yyUG\nGmHXpKHhqNKm\n-----END SIGNED MESSAGE-----", + "payload": null + } + }, + "url": "https://api.github.com/repos/hub4j/github-api/commits/86a2e245aa6d71d54923655066049d9e21a15f01", + "html_url": "https://github.com/hub4j/github-api/commit/86a2e245aa6d71d54923655066049d9e21a15f01", + "comments_url": "https://api.github.com/repos/hub4j/github-api/commits/86a2e245aa6d71d54923655066049d9e21a15f01/comments", + "author": { + "login": "kohsuke", + "id": 50003, + "node_id": "MDQ6VXNlcjUwMDAz", + "avatar_url": "https://avatars1.githubusercontent.com/u/50003?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kohsuke", + "html_url": "https://github.com/kohsuke", + "followers_url": "https://api.github.com/users/kohsuke/followers", + "following_url": "https://api.github.com/users/kohsuke/following{/other_user}", + "gists_url": "https://api.github.com/users/kohsuke/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kohsuke/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kohsuke/subscriptions", + "organizations_url": "https://api.github.com/users/kohsuke/orgs", + "repos_url": "https://api.github.com/users/kohsuke/repos", + "events_url": "https://api.github.com/users/kohsuke/events{/privacy}", + "received_events_url": "https://api.github.com/users/kohsuke/received_events", + "type": "User", + "site_admin": false + }, + "committer": { + "login": "kohsuke", + "id": 50003, + "node_id": "MDQ6VXNlcjUwMDAz", + "avatar_url": "https://avatars1.githubusercontent.com/u/50003?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kohsuke", + "html_url": "https://github.com/kohsuke", + "followers_url": "https://api.github.com/users/kohsuke/followers", + "following_url": "https://api.github.com/users/kohsuke/following{/other_user}", + "gists_url": "https://api.github.com/users/kohsuke/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kohsuke/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kohsuke/subscriptions", + "organizations_url": "https://api.github.com/users/kohsuke/orgs", + "repos_url": "https://api.github.com/users/kohsuke/repos", + "events_url": "https://api.github.com/users/kohsuke/events{/privacy}", + "received_events_url": "https://api.github.com/users/kohsuke/received_events", + "type": "User", + "site_admin": false + }, + "parents": [ + { + "sha": "ecbfdd7315ef2cf04b2be7f11a072ce0bd00c396", + "url": "https://api.github.com/repos/hub4j/github-api/commits/ecbfdd7315ef2cf04b2be7f11a072ce0bd00c396", + "html_url": "https://github.com/hub4j/github-api/commit/ecbfdd7315ef2cf04b2be7f11a072ce0bd00c396" + } + ], + "stats": { + "total": 3, + "additions": 3, + "deletions": 0 + }, + "files": [ + { + "sha": "2a2e1f77fd77bd03273946d893d25a455f696be0", + "filename": "README", + "status": "added", + "additions": 3, + "deletions": 0, + "changes": 3, + "blob_url": "https://github.com/hub4j/github-api/blob/86a2e245aa6d71d54923655066049d9e21a15f01/README", + "raw_url": "https://github.com/hub4j/github-api/raw/86a2e245aa6d71d54923655066049d9e21a15f01/README", + "contents_url": "https://api.github.com/repos/hub4j/github-api/contents/README?ref=86a2e245aa6d71d54923655066049d9e21a15f01", + "patch": "@@ -0,0 +1,3 @@\n+Java API for GitHub\n+\n+See http://kohsuke.org/github-api/ for more details" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOcspError/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOcspError/__files/user-1.json new file mode 100644 index 0000000000..a4b576e8a7 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOcspError/__files/user-1.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 169, + "public_gists": 7, + "followers": 139, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z", + "private_gists": 7, + "total_private_repos": 9, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOcspError/mappings/repos_hub4j_github-api-2.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOcspError/mappings/repos_hub4j_github-api-2.json new file mode 100644 index 0000000000..80fb7dfa4e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOcspError/mappings/repos_hub4j_github-api-2.json @@ -0,0 +1,48 @@ +{ + "id": "441cdfd7-a44a-42b4-b732-57e674227760", + "name": "repos_hub4j_github-api", + "request": { + "url": "/repos/hub4j/github-api", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j_github-api-2.json", + "headers": { + "Date": "Sat, 26 Oct 2019 01:28:40 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4295", + "X-RateLimit-Reset": "1572055286", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"c1a01d01a6354d93b3cc6098e0b2d047\"", + "Last-Modified": "Fri, 25 Oct 2019 01:32:16 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CB01:05A2:A65B56:C4A050:5DB3A147" + } + }, + "uuid": "441cdfd7-a44a-42b4-b732-57e674227760", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOcspError/mappings/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOcspError/mappings/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json new file mode 100644 index 0000000000..6b5904361c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOcspError/mappings/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json @@ -0,0 +1,48 @@ +{ + "id": "d76abea9-c1be-430a-bbd0-28931c58e1e8", + "name": "repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01", + "request": { + "url": "/repos/hub4j/github-api/commits/86a2e245aa6d71d54923655066049d9e21a15f01", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json", + "headers": { + "Date": "Sat, 26 Oct 2019 01:28:40 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4294", + "X-RateLimit-Reset": "1572055286", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"0a8c453e4290ce879ea09578e06a5961\"", + "Last-Modified": "Mon, 19 Apr 2010 04:12:41 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CB01:05A2:A65B5F:C4A064:5DB3A148" + } + }, + "uuid": "d76abea9-c1be-430a-bbd0-28931c58e1e8", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOcspError/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOcspError/mappings/user-1.json new file mode 100644 index 0000000000..7c0606ff2f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOcspError/mappings/user-1.json @@ -0,0 +1,48 @@ +{ + "id": "c247f81b-84b8-44e9-820a-0a91dc74ce98", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-1.json", + "headers": { + "Date": "Sat, 26 Oct 2019 01:28:39 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4297", + "X-RateLimit-Reset": "1572055286", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"8c3d3dcf6fc5f9edaf26c902295396e5\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CB01:05A2:A65B49:C4A046:5DB3A147" + } + }, + "uuid": "c247f81b-84b8-44e9-820a-0a91dc74ce98", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpPending/__files/repos_hub4j_github-api-2.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpPending/__files/repos_hub4j_github-api-2.json new file mode 100644 index 0000000000..43ee270874 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpPending/__files/repos_hub4j_github-api-2.json @@ -0,0 +1,130 @@ +{ + "id": 617210, + "node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=", + "name": "github-api", + "full_name": "hub4j/github-api", + "private": false, + "owner": { + "login": "hub4j", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j", + "html_url": "https://github.com/hub4j", + "followers_url": "https://api.github.com/users/hub4j/followers", + "following_url": "https://api.github.com/users/hub4j/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j/orgs", + "repos_url": "https://api.github.com/users/hub4j/repos", + "events_url": "https://api.github.com/users/hub4j/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j/github-api", + "description": "Java API for GitHub", + "fork": false, + "url": "https://api.github.com/repos/hub4j/github-api", + "forks_url": "https://api.github.com/repos/hub4j/github-api/forks", + "keys_url": "https://api.github.com/repos/hub4j/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j/github-api/teams", + "hooks_url": "https://api.github.com/repos/hub4j/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j/github-api/events", + "assignees_url": "https://api.github.com/repos/hub4j/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j/github-api/tags", + "blobs_url": "https://api.github.com/repos/hub4j/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j/github-api/languages", + "stargazers_url": "https://api.github.com/repos/hub4j/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j/github-api/subscription", + "commits_url": "https://api.github.com/repos/hub4j/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j/github-api/merges", + "archive_url": "https://api.github.com/repos/hub4j/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j/github-api/downloads", + "issues_url": "https://api.github.com/repos/hub4j/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j/github-api/deployments", + "created_at": "2010-04-19T04:13:03Z", + "updated_at": "2019-10-25T01:32:16Z", + "pushed_at": "2019-10-25T16:41:09Z", + "git_url": "git://github.com/hub4j/github-api.git", + "ssh_url": "git@github.com:hub4j/github-api.git", + "clone_url": "https://github.com/hub4j/github-api.git", + "svn_url": "https://github.com/hub4j/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 13494, + "stargazers_count": 565, + "watchers_count": 565, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 433, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 64, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 433, + "open_issues": 64, + "watchers": 565, + "default_branch": "main", + "permissions": { + "admin": true, + "push": true, + "pull": true + }, + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "organization": { + "login": "hub4j", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j", + "html_url": "https://github.com/hub4j", + "followers_url": "https://api.github.com/users/hub4j/followers", + "following_url": "https://api.github.com/users/hub4j/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j/orgs", + "repos_url": "https://api.github.com/users/hub4j/repos", + "events_url": "https://api.github.com/users/hub4j/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j/received_events", + "type": "Organization", + "site_admin": false + }, + "network_count": 433, + "subscribers_count": 48 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpPending/__files/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpPending/__files/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json new file mode 100644 index 0000000000..c5e2c3995c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpPending/__files/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json @@ -0,0 +1,98 @@ +{ + "sha": "86a2e245aa6d71d54923655066049d9e21a15f01", + "node_id": "MDY6Q29tbWl0NjE3MjEwOjg2YTJlMjQ1YWE2ZDcxZDU0OTIzNjU1MDY2MDQ5ZDllMjFhMTVmMjM=", + "commit": { + "author": { + "name": "Sourabh Parkala", + "email": "sourabh.sarvotham.parkala@sap.com", + "date": "2010-04-19T04:12:41Z" + }, + "committer": { + "name": "Sourabh Parkala", + "email": "sourabh.sarvotham.parkala@sap.com", + "date": "2010-04-19T04:12:41Z" + }, + "message": "doc", + "tree": { + "sha": "17ed4173aeb2e98c93216e8b6e16138dc7f8cd91", + "url": "https://api.github.com/repos/hub4j/github-api/git/trees/17ed4173aeb2e98c93216e8b6e16138dc7f8cd91" + }, + "url": "https://api.github.com/repos/hub4j/github-api/git/commits/86a2e245aa6d71d54923655066049d9e21a15f01", + "comment_count": 0, + "verification": { + "verified": false, + "reason": "ocsp_pending", + "signature": "-----BEGIN SIGNED MESSAGE-----\nMIIFdQYJKoZIhvcNAQcCoIIFZjCCBWICAQExDTALBglghkgBZQMEAgEwCwYJKoZI\nhvcNAQcBoIIDejCCA3YwggJeoAMCAQICAQIwDQYJKoZIhvcNAQELBQAwKjEbMBkG\nA1UEAwwSQXN0cm9UbGFsb2PigJlzIENBMQswCQYDVQQGEwJVUzAeFw0yMzA5MTgy\nMzI2MDlaFw0yNDA5MTcyMzI2MDlaMEYxFDASBgNVBAMMC0FzdHJvVGxhbG9jMQsw\nCQYDVQQGEwJVUzEhMB8GCSqGSIb3DQEJARYSMHhUbGFsb2NAZ21haWwuY29tMIIB\nIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA+Zq+N5v68htABs4ZLPORns/F\nzixnI+6L+WaVGeQFzxIBs9zsm9IRGJ4xoMBPSg1BuoilRXzsQoCH6+5zyQ4jaHMa\nHBBEijVM7kor3Um+35KdYh79nIY7ZQoDRypLF02FiqfNjhN8Nm8ciNf2EUkiGIcj\n/+TPhVFMxnwlZ2SmSJoMBE5pkDBllb/8kfxgenSoVLXaOigYJ1It6AqH2L8Ju9pa\nJ1zJGu2edjN6xi/0yjzZ7CmPFbnWcY5flJfMqdaj0Po3dMwYKYK07rE7KQHc8wFT\ngAUtQNtJkGBjEcTBh1B7SUsnJ/x4XcSQwOMxPNSm4Esn2RWanJYunez75eCWlwID\nAQABo4GKMIGHMA4GA1UdDwEB/wQEAwIFoDAWBgNVHSUBAf8EDDAKBggrBgEFBQcD\nBDAdBgNVHQ4EFgQUSi5d7oqzSYNhpeG4I2VNF9j881UwHwYDVR0jBBgwFoAULCWl\nbibBiKOX/6M3RWgIlSPM7dcwHQYDVR0RBBYwFIESMHhUbGFsb2NAZ21haWwuY29t\nMA0GCSqGSIb3DQEBCwUAA4IBAQDSn3caORjlSXCSm8ZY1uAbG+IngvEooIJvbl+y\n0yglPA3pkWybXxLfvayJVRGtNgLambnPpulzZmdwjj7qSTzd9K/+OIsI2qjNrZZ+\napXJLhlfabNHzydj0y0DUWgbtKzQ1SVhWgglHaCp440UmVAi0PtsMy3F1S5S0HlZ\n80V1CE3r7UYsC64GG3CmyXVf5MB+pzPriE729Gglig5z6rq8F+GNk5hJW7tOKBRb\nCyXFkqbkMWHPJ/CP5wrFjrEITsn8fIhlJsYRIAGzTnffCOs9i3rMpUTXRBOwSVMB\nI1I3VPm+WxVE7O9NY7TGBDe7010D4DorTNUPYo8xsPtKYyrpMYIBwTCCAb0CAQEw\nLzAqMRswGQYDVQQDDBJBc3Ryb1RsYWxvY+KAmXMgQ0ExCzAJBgNVBAYTAlVTAgEC\nMAsGCWCGSAFlAwQCAaBpMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZI\nhvcNAQkFMQ8XDTIzMDkxODIzMjg1MFowLwYJKoZIhvcNAQkEMSIEIIFHI8Ick3Tu\nBlnfTU6v24ls8D+jGkpQoDK+MF4rk5iTMAsGCSqGSIb3DQEBCwSCAQC4nIUEB/bR\ngeXnO7KdtqRFn/slCNTKZaQObsyL7C7cmNYAlgQAYj/qOBhKGMd3ZAFHRUroCiCy\n5GPs1sEnPKT1Bh7E7HJbpfdMXZINxoiRBrwQpAD/UKxk6etF5qvtAwDJaFMZiTMh\nd6tPNVBcThhUglSqqQFT3BKE9z5KTGwonMeqZlyf/EpXRBn0YcaoWvcAzaahMBQw\nUPwwEtU3FVyYBbLQee0SoYDsddEjdaNN/37auMVIltYmKNq/A4KhJWduTGFcaD/k\nfcXIzhzBi4vk1No6y2ftDgbivxP3MVQyf1tIfD1fv9cw/55JnDRA3IXkQRc+yyUG\nGmHXpKHhqNKm\n-----END SIGNED MESSAGE-----", + "payload": null + } + }, + "url": "https://api.github.com/repos/hub4j/github-api/commits/86a2e245aa6d71d54923655066049d9e21a15f01", + "html_url": "https://github.com/hub4j/github-api/commit/86a2e245aa6d71d54923655066049d9e21a15f01", + "comments_url": "https://api.github.com/repos/hub4j/github-api/commits/86a2e245aa6d71d54923655066049d9e21a15f01/comments", + "author": { + "login": "kohsuke", + "id": 50003, + "node_id": "MDQ6VXNlcjUwMDAz", + "avatar_url": "https://avatars1.githubusercontent.com/u/50003?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kohsuke", + "html_url": "https://github.com/kohsuke", + "followers_url": "https://api.github.com/users/kohsuke/followers", + "following_url": "https://api.github.com/users/kohsuke/following{/other_user}", + "gists_url": "https://api.github.com/users/kohsuke/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kohsuke/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kohsuke/subscriptions", + "organizations_url": "https://api.github.com/users/kohsuke/orgs", + "repos_url": "https://api.github.com/users/kohsuke/repos", + "events_url": "https://api.github.com/users/kohsuke/events{/privacy}", + "received_events_url": "https://api.github.com/users/kohsuke/received_events", + "type": "User", + "site_admin": false + }, + "committer": { + "login": "kohsuke", + "id": 50003, + "node_id": "MDQ6VXNlcjUwMDAz", + "avatar_url": "https://avatars1.githubusercontent.com/u/50003?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kohsuke", + "html_url": "https://github.com/kohsuke", + "followers_url": "https://api.github.com/users/kohsuke/followers", + "following_url": "https://api.github.com/users/kohsuke/following{/other_user}", + "gists_url": "https://api.github.com/users/kohsuke/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kohsuke/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kohsuke/subscriptions", + "organizations_url": "https://api.github.com/users/kohsuke/orgs", + "repos_url": "https://api.github.com/users/kohsuke/repos", + "events_url": "https://api.github.com/users/kohsuke/events{/privacy}", + "received_events_url": "https://api.github.com/users/kohsuke/received_events", + "type": "User", + "site_admin": false + }, + "parents": [ + { + "sha": "ecbfdd7315ef2cf04b2be7f11a072ce0bd00c396", + "url": "https://api.github.com/repos/hub4j/github-api/commits/ecbfdd7315ef2cf04b2be7f11a072ce0bd00c396", + "html_url": "https://github.com/hub4j/github-api/commit/ecbfdd7315ef2cf04b2be7f11a072ce0bd00c396" + } + ], + "stats": { + "total": 3, + "additions": 3, + "deletions": 0 + }, + "files": [ + { + "sha": "2a2e1f77fd77bd03273946d893d25a455f696be0", + "filename": "README", + "status": "added", + "additions": 3, + "deletions": 0, + "changes": 3, + "blob_url": "https://github.com/hub4j/github-api/blob/86a2e245aa6d71d54923655066049d9e21a15f01/README", + "raw_url": "https://github.com/hub4j/github-api/raw/86a2e245aa6d71d54923655066049d9e21a15f01/README", + "contents_url": "https://api.github.com/repos/hub4j/github-api/contents/README?ref=86a2e245aa6d71d54923655066049d9e21a15f01", + "patch": "@@ -0,0 +1,3 @@\n+Java API for GitHub\n+\n+See http://kohsuke.org/github-api/ for more details" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpPending/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpPending/__files/user-1.json new file mode 100644 index 0000000000..a4b576e8a7 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpPending/__files/user-1.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 169, + "public_gists": 7, + "followers": 139, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z", + "private_gists": 7, + "total_private_repos": 9, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpPending/mappings/repos_hub4j_github-api-2.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpPending/mappings/repos_hub4j_github-api-2.json new file mode 100644 index 0000000000..80fb7dfa4e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpPending/mappings/repos_hub4j_github-api-2.json @@ -0,0 +1,48 @@ +{ + "id": "441cdfd7-a44a-42b4-b732-57e674227760", + "name": "repos_hub4j_github-api", + "request": { + "url": "/repos/hub4j/github-api", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j_github-api-2.json", + "headers": { + "Date": "Sat, 26 Oct 2019 01:28:40 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4295", + "X-RateLimit-Reset": "1572055286", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"c1a01d01a6354d93b3cc6098e0b2d047\"", + "Last-Modified": "Fri, 25 Oct 2019 01:32:16 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CB01:05A2:A65B56:C4A050:5DB3A147" + } + }, + "uuid": "441cdfd7-a44a-42b4-b732-57e674227760", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpPending/mappings/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpPending/mappings/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json new file mode 100644 index 0000000000..6b5904361c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpPending/mappings/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json @@ -0,0 +1,48 @@ +{ + "id": "d76abea9-c1be-430a-bbd0-28931c58e1e8", + "name": "repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01", + "request": { + "url": "/repos/hub4j/github-api/commits/86a2e245aa6d71d54923655066049d9e21a15f01", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json", + "headers": { + "Date": "Sat, 26 Oct 2019 01:28:40 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4294", + "X-RateLimit-Reset": "1572055286", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"0a8c453e4290ce879ea09578e06a5961\"", + "Last-Modified": "Mon, 19 Apr 2010 04:12:41 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CB01:05A2:A65B5F:C4A064:5DB3A148" + } + }, + "uuid": "d76abea9-c1be-430a-bbd0-28931c58e1e8", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpPending/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpPending/mappings/user-1.json new file mode 100644 index 0000000000..7c0606ff2f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpPending/mappings/user-1.json @@ -0,0 +1,48 @@ +{ + "id": "c247f81b-84b8-44e9-820a-0a91dc74ce98", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-1.json", + "headers": { + "Date": "Sat, 26 Oct 2019 01:28:39 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4297", + "X-RateLimit-Reset": "1572055286", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"8c3d3dcf6fc5f9edaf26c902295396e5\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CB01:05A2:A65B49:C4A046:5DB3A147" + } + }, + "uuid": "c247f81b-84b8-44e9-820a-0a91dc74ce98", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpRevoked/__files/repos_hub4j_github-api-2.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpRevoked/__files/repos_hub4j_github-api-2.json new file mode 100644 index 0000000000..43ee270874 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpRevoked/__files/repos_hub4j_github-api-2.json @@ -0,0 +1,130 @@ +{ + "id": 617210, + "node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=", + "name": "github-api", + "full_name": "hub4j/github-api", + "private": false, + "owner": { + "login": "hub4j", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j", + "html_url": "https://github.com/hub4j", + "followers_url": "https://api.github.com/users/hub4j/followers", + "following_url": "https://api.github.com/users/hub4j/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j/orgs", + "repos_url": "https://api.github.com/users/hub4j/repos", + "events_url": "https://api.github.com/users/hub4j/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j/github-api", + "description": "Java API for GitHub", + "fork": false, + "url": "https://api.github.com/repos/hub4j/github-api", + "forks_url": "https://api.github.com/repos/hub4j/github-api/forks", + "keys_url": "https://api.github.com/repos/hub4j/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j/github-api/teams", + "hooks_url": "https://api.github.com/repos/hub4j/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j/github-api/events", + "assignees_url": "https://api.github.com/repos/hub4j/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j/github-api/tags", + "blobs_url": "https://api.github.com/repos/hub4j/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j/github-api/languages", + "stargazers_url": "https://api.github.com/repos/hub4j/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j/github-api/subscription", + "commits_url": "https://api.github.com/repos/hub4j/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j/github-api/merges", + "archive_url": "https://api.github.com/repos/hub4j/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j/github-api/downloads", + "issues_url": "https://api.github.com/repos/hub4j/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j/github-api/deployments", + "created_at": "2010-04-19T04:13:03Z", + "updated_at": "2019-10-25T01:32:16Z", + "pushed_at": "2019-10-25T16:41:09Z", + "git_url": "git://github.com/hub4j/github-api.git", + "ssh_url": "git@github.com:hub4j/github-api.git", + "clone_url": "https://github.com/hub4j/github-api.git", + "svn_url": "https://github.com/hub4j/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 13494, + "stargazers_count": 565, + "watchers_count": 565, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 433, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 64, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 433, + "open_issues": 64, + "watchers": 565, + "default_branch": "main", + "permissions": { + "admin": true, + "push": true, + "pull": true + }, + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "organization": { + "login": "hub4j", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j", + "html_url": "https://github.com/hub4j", + "followers_url": "https://api.github.com/users/hub4j/followers", + "following_url": "https://api.github.com/users/hub4j/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j/orgs", + "repos_url": "https://api.github.com/users/hub4j/repos", + "events_url": "https://api.github.com/users/hub4j/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j/received_events", + "type": "Organization", + "site_admin": false + }, + "network_count": 433, + "subscribers_count": 48 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpRevoked/__files/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpRevoked/__files/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json new file mode 100644 index 0000000000..26aa4fc983 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpRevoked/__files/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json @@ -0,0 +1,98 @@ +{ + "sha": "86a2e245aa6d71d54923655066049d9e21a15f01", + "node_id": "MDY6Q29tbWl0NjE3MjEwOjg2YTJlMjQ1YWE2ZDcxZDU0OTIzNjU1MDY2MDQ5ZDllMjFhMTVmMjM=", + "commit": { + "author": { + "name": "Sourabh Parkala", + "email": "sourabh.sarvotham.parkala@sap.com", + "date": "2010-04-19T04:12:41Z" + }, + "committer": { + "name": "Sourabh Parkala", + "email": "sourabh.sarvotham.parkala@sap.com", + "date": "2010-04-19T04:12:41Z" + }, + "message": "doc", + "tree": { + "sha": "17ed4173aeb2e98c93216e8b6e16138dc7f8cd91", + "url": "https://api.github.com/repos/hub4j/github-api/git/trees/17ed4173aeb2e98c93216e8b6e16138dc7f8cd91" + }, + "url": "https://api.github.com/repos/hub4j/github-api/git/commits/86a2e245aa6d71d54923655066049d9e21a15f01", + "comment_count": 0, + "verification": { + "verified": false, + "reason": "ocsp_revoked", + "signature": "-----BEGIN SIGNED MESSAGE-----\nMIIFdQYJKoZIhvcNAQcCoIIFZjCCBWICAQExDTALBglghkgBZQMEAgEwCwYJKoZI\nhvcNAQcBoIIDejCCA3YwggJeoAMCAQICAQIwDQYJKoZIhvcNAQELBQAwKjEbMBkG\nA1UEAwwSQXN0cm9UbGFsb2PigJlzIENBMQswCQYDVQQGEwJVUzAeFw0yMzA5MTgy\nMzI2MDlaFw0yNDA5MTcyMzI2MDlaMEYxFDASBgNVBAMMC0FzdHJvVGxhbG9jMQsw\nCQYDVQQGEwJVUzEhMB8GCSqGSIb3DQEJARYSMHhUbGFsb2NAZ21haWwuY29tMIIB\nIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA+Zq+N5v68htABs4ZLPORns/F\nzixnI+6L+WaVGeQFzxIBs9zsm9IRGJ4xoMBPSg1BuoilRXzsQoCH6+5zyQ4jaHMa\nHBBEijVM7kor3Um+35KdYh79nIY7ZQoDRypLF02FiqfNjhN8Nm8ciNf2EUkiGIcj\n/+TPhVFMxnwlZ2SmSJoMBE5pkDBllb/8kfxgenSoVLXaOigYJ1It6AqH2L8Ju9pa\nJ1zJGu2edjN6xi/0yjzZ7CmPFbnWcY5flJfMqdaj0Po3dMwYKYK07rE7KQHc8wFT\ngAUtQNtJkGBjEcTBh1B7SUsnJ/x4XcSQwOMxPNSm4Esn2RWanJYunez75eCWlwID\nAQABo4GKMIGHMA4GA1UdDwEB/wQEAwIFoDAWBgNVHSUBAf8EDDAKBggrBgEFBQcD\nBDAdBgNVHQ4EFgQUSi5d7oqzSYNhpeG4I2VNF9j881UwHwYDVR0jBBgwFoAULCWl\nbibBiKOX/6M3RWgIlSPM7dcwHQYDVR0RBBYwFIESMHhUbGFsb2NAZ21haWwuY29t\nMA0GCSqGSIb3DQEBCwUAA4IBAQDSn3caORjlSXCSm8ZY1uAbG+IngvEooIJvbl+y\n0yglPA3pkWybXxLfvayJVRGtNgLambnPpulzZmdwjj7qSTzd9K/+OIsI2qjNrZZ+\napXJLhlfabNHzydj0y0DUWgbtKzQ1SVhWgglHaCp440UmVAi0PtsMy3F1S5S0HlZ\n80V1CE3r7UYsC64GG3CmyXVf5MB+pzPriE729Gglig5z6rq8F+GNk5hJW7tOKBRb\nCyXFkqbkMWHPJ/CP5wrFjrEITsn8fIhlJsYRIAGzTnffCOs9i3rMpUTXRBOwSVMB\nI1I3VPm+WxVE7O9NY7TGBDe7010D4DorTNUPYo8xsPtKYyrpMYIBwTCCAb0CAQEw\nLzAqMRswGQYDVQQDDBJBc3Ryb1RsYWxvY+KAmXMgQ0ExCzAJBgNVBAYTAlVTAgEC\nMAsGCWCGSAFlAwQCAaBpMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZI\nhvcNAQkFMQ8XDTIzMDkxODIzMjg1MFowLwYJKoZIhvcNAQkEMSIEIIFHI8Ick3Tu\nBlnfTU6v24ls8D+jGkpQoDK+MF4rk5iTMAsGCSqGSIb3DQEBCwSCAQC4nIUEB/bR\ngeXnO7KdtqRFn/slCNTKZaQObsyL7C7cmNYAlgQAYj/qOBhKGMd3ZAFHRUroCiCy\n5GPs1sEnPKT1Bh7E7HJbpfdMXZINxoiRBrwQpAD/UKxk6etF5qvtAwDJaFMZiTMh\nd6tPNVBcThhUglSqqQFT3BKE9z5KTGwonMeqZlyf/EpXRBn0YcaoWvcAzaahMBQw\nUPwwEtU3FVyYBbLQee0SoYDsddEjdaNN/37auMVIltYmKNq/A4KhJWduTGFcaD/k\nfcXIzhzBi4vk1No6y2ftDgbivxP3MVQyf1tIfD1fv9cw/55JnDRA3IXkQRc+yyUG\nGmHXpKHhqNKm\n-----END SIGNED MESSAGE-----", + "payload": null + } + }, + "url": "https://api.github.com/repos/hub4j/github-api/commits/86a2e245aa6d71d54923655066049d9e21a15f01", + "html_url": "https://github.com/hub4j/github-api/commit/86a2e245aa6d71d54923655066049d9e21a15f01", + "comments_url": "https://api.github.com/repos/hub4j/github-api/commits/86a2e245aa6d71d54923655066049d9e21a15f01/comments", + "author": { + "login": "kohsuke", + "id": 50003, + "node_id": "MDQ6VXNlcjUwMDAz", + "avatar_url": "https://avatars1.githubusercontent.com/u/50003?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kohsuke", + "html_url": "https://github.com/kohsuke", + "followers_url": "https://api.github.com/users/kohsuke/followers", + "following_url": "https://api.github.com/users/kohsuke/following{/other_user}", + "gists_url": "https://api.github.com/users/kohsuke/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kohsuke/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kohsuke/subscriptions", + "organizations_url": "https://api.github.com/users/kohsuke/orgs", + "repos_url": "https://api.github.com/users/kohsuke/repos", + "events_url": "https://api.github.com/users/kohsuke/events{/privacy}", + "received_events_url": "https://api.github.com/users/kohsuke/received_events", + "type": "User", + "site_admin": false + }, + "committer": { + "login": "kohsuke", + "id": 50003, + "node_id": "MDQ6VXNlcjUwMDAz", + "avatar_url": "https://avatars1.githubusercontent.com/u/50003?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kohsuke", + "html_url": "https://github.com/kohsuke", + "followers_url": "https://api.github.com/users/kohsuke/followers", + "following_url": "https://api.github.com/users/kohsuke/following{/other_user}", + "gists_url": "https://api.github.com/users/kohsuke/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kohsuke/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kohsuke/subscriptions", + "organizations_url": "https://api.github.com/users/kohsuke/orgs", + "repos_url": "https://api.github.com/users/kohsuke/repos", + "events_url": "https://api.github.com/users/kohsuke/events{/privacy}", + "received_events_url": "https://api.github.com/users/kohsuke/received_events", + "type": "User", + "site_admin": false + }, + "parents": [ + { + "sha": "ecbfdd7315ef2cf04b2be7f11a072ce0bd00c396", + "url": "https://api.github.com/repos/hub4j/github-api/commits/ecbfdd7315ef2cf04b2be7f11a072ce0bd00c396", + "html_url": "https://github.com/hub4j/github-api/commit/ecbfdd7315ef2cf04b2be7f11a072ce0bd00c396" + } + ], + "stats": { + "total": 3, + "additions": 3, + "deletions": 0 + }, + "files": [ + { + "sha": "2a2e1f77fd77bd03273946d893d25a455f696be0", + "filename": "README", + "status": "added", + "additions": 3, + "deletions": 0, + "changes": 3, + "blob_url": "https://github.com/hub4j/github-api/blob/86a2e245aa6d71d54923655066049d9e21a15f01/README", + "raw_url": "https://github.com/hub4j/github-api/raw/86a2e245aa6d71d54923655066049d9e21a15f01/README", + "contents_url": "https://api.github.com/repos/hub4j/github-api/contents/README?ref=86a2e245aa6d71d54923655066049d9e21a15f01", + "patch": "@@ -0,0 +1,3 @@\n+Java API for GitHub\n+\n+See http://kohsuke.org/github-api/ for more details" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpRevoked/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpRevoked/__files/user-1.json new file mode 100644 index 0000000000..a4b576e8a7 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpRevoked/__files/user-1.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 169, + "public_gists": 7, + "followers": 139, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z", + "private_gists": 7, + "total_private_repos": 9, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpRevoked/mappings/repos_hub4j_github-api-2.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpRevoked/mappings/repos_hub4j_github-api-2.json new file mode 100644 index 0000000000..80fb7dfa4e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpRevoked/mappings/repos_hub4j_github-api-2.json @@ -0,0 +1,48 @@ +{ + "id": "441cdfd7-a44a-42b4-b732-57e674227760", + "name": "repos_hub4j_github-api", + "request": { + "url": "/repos/hub4j/github-api", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j_github-api-2.json", + "headers": { + "Date": "Sat, 26 Oct 2019 01:28:40 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4295", + "X-RateLimit-Reset": "1572055286", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"c1a01d01a6354d93b3cc6098e0b2d047\"", + "Last-Modified": "Fri, 25 Oct 2019 01:32:16 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CB01:05A2:A65B56:C4A050:5DB3A147" + } + }, + "uuid": "441cdfd7-a44a-42b4-b732-57e674227760", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpRevoked/mappings/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpRevoked/mappings/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json new file mode 100644 index 0000000000..6b5904361c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpRevoked/mappings/repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json @@ -0,0 +1,48 @@ +{ + "id": "d76abea9-c1be-430a-bbd0-28931c58e1e8", + "name": "repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01", + "request": { + "url": "/repos/hub4j/github-api/commits/86a2e245aa6d71d54923655066049d9e21a15f01", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j_github-api_commits_86a2e245aa6d71d54923655066049d9e21a15f01-3.json", + "headers": { + "Date": "Sat, 26 Oct 2019 01:28:40 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4294", + "X-RateLimit-Reset": "1572055286", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"0a8c453e4290ce879ea09578e06a5961\"", + "Last-Modified": "Mon, 19 Apr 2010 04:12:41 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CB01:05A2:A65B5F:C4A064:5DB3A148" + } + }, + "uuid": "d76abea9-c1be-430a-bbd0-28931c58e1e8", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpRevoked/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpRevoked/mappings/user-1.json new file mode 100644 index 0000000000..7c0606ff2f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHVerificationReasonTest/wiremock/testOscpRevoked/mappings/user-1.json @@ -0,0 +1,48 @@ +{ + "id": "c247f81b-84b8-44e9-820a-0a91dc74ce98", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-1.json", + "headers": { + "Date": "Sat, 26 Oct 2019 01:28:39 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4297", + "X-RateLimit-Reset": "1572055286", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"8c3d3dcf6fc5f9edaf26c902295396e5\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CB01:05A2:A65B49:C4A046:5DB3A147" + } + }, + "uuid": "c247f81b-84b8-44e9-820a-0a91dc74ce98", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file From b1ae2d34e82b2bbb2858ead5f4ed557679204db0 Mon Sep 17 00:00:00 2001 From: Ulises <0xTlaloc@gmail.com> Date: Wed, 20 Sep 2023 13:13:13 -0700 Subject: [PATCH 2/3] Updating url in documentation --- src/main/java/org/kohsuke/github/GHVerification.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/kohsuke/github/GHVerification.java b/src/main/java/org/kohsuke/github/GHVerification.java index ce92905730..367184206a 100644 --- a/src/main/java/org/kohsuke/github/GHVerification.java +++ b/src/main/java/org/kohsuke/github/GHVerification.java @@ -61,8 +61,8 @@ public String getPayload() { * The possible values for reason in verification object from github. * * @author Sourabh Sarvotham Parkala - * @see List of possible - * reason values + * @see List of possible + * reason values. Note graphQL documentation has currently the most updated values. */ public enum Reason { From 7c87ad9f286f4ffc12023748757ccc9a1c6292de Mon Sep 17 00:00:00 2001 From: Ulises <0xTlaloc@gmail.com> Date: Wed, 20 Sep 2023 13:14:18 -0700 Subject: [PATCH 3/3] forgot to run mvn spotless:apply --- src/main/java/org/kohsuke/github/GHVerification.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/kohsuke/github/GHVerification.java b/src/main/java/org/kohsuke/github/GHVerification.java index 367184206a..2a759ea5a5 100644 --- a/src/main/java/org/kohsuke/github/GHVerification.java +++ b/src/main/java/org/kohsuke/github/GHVerification.java @@ -61,8 +61,8 @@ public String getPayload() { * The possible values for reason in verification object from github. * * @author Sourabh Sarvotham Parkala - * @see List of possible - * reason values. Note graphQL documentation has currently the most updated values. + * @see List of possible reason + * values. Note graphQL documentation has currently the most updated values. */ public enum Reason {