diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 038bc93fad..11d644db46 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -42,7 +42,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build.yml index 2ef600e1ec..d572259804 100644 --- a/.github/workflows/maven-build.yml +++ b/.github/workflows/maven-build.yml @@ -19,64 +19,44 @@ permissions: jobs: build: - name: build-only (Java ${{ matrix.java }}) + name: build-only (Java 17) runs-on: ubuntu-latest strategy: - fail-fast: false - matrix: - java: [ 17 ] + fail-fast: true steps: - - uses: actions/checkout@v3 - - name: Set up JDK - uses: actions/setup-java@v3 - with: - java-version: ${{ matrix.java }} - distribution: 'temurin' - cache: 'maven' - - name: Maven Install (skipTests) - env: - MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }} - run: mvn -B clean install -DskipTests --file pom.xml + - uses: actions/checkout@v4 + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: 'temurin' + cache: 'maven' + - name: Maven Install (skipTests) + env: + MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }} + run: mvn -B clean install -DskipTests --file pom.xml + - uses: actions/upload-artifact@v3 + with: + name: maven-target-directory + path: target/ + retention-days: 3 site: - name: site (Java ${{ matrix.java }}) + name: site (Java 17) runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - java: [ 17 ] - steps: - - uses: actions/checkout@v3 - - name: Set up JDK - uses: actions/setup-java@v3 - with: - java-version: ${{ matrix.java }} - distribution: 'temurin' - cache: 'maven' - - name: Maven Site - env: - MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }} - run: mvn -B clean site -D enable-ci --file pom.xml - test-8: - name: test (${{ matrix.os }}, Java 8) - runs-on: ${{ matrix.os }}-latest - strategy: - fail-fast: false - matrix: - os: [ ubuntu ] - java: [ 8 ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: ${{ matrix.java }} + java-version: 17 distribution: 'temurin' cache: 'maven' - # JDK 8 - - name: Maven Install with Code Coverage - run: mvn -B clean install -D enable-ci -Djapicmp.skip --file pom.xml - - name: Codecov Report - uses: codecov/codecov-action@v3.1.4 + - name: Maven Site + env: + MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }} + run: mvn -B clean site -D enable-ci --file pom.xml test: name: test (${{ matrix.os }}, Java ${{ matrix.java }}) runs-on: ${{ matrix.os }}-latest @@ -86,7 +66,7 @@ jobs: os: [ ubuntu, windows ] java: [ 11, 17 ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK uses: actions/setup-java@v3 with: @@ -104,3 +84,25 @@ jobs: env: MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }} run: mvn -B clean install -D enable-ci --file pom.xml "-Dsurefire.argLine=--add-opens java.base/java.net=ALL-UNNAMED" + - name: Codecov Report + if: matrix.os == 'ubuntu' && matrix.java == '17' + uses: codecov/codecov-action@v3.1.4 + + test-java-8: + name: test Java 8 (no-build) + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v3 + with: + name: maven-target-directory + path: target + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: 8 + distribution: 'temurin' + cache: 'maven' + - name: Maven Test (no build) Java 8 + run: mvn -B surefire:test -DfailIfNoTests -Dsurefire.excludesFile=src/test/resources/slow-or-flaky-tests.txt diff --git a/pom.xml b/pom.xml index 497a63b310..629083ad55 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.kohsuke github-api - 1.317-SNAPSHOT + 1.318-SNAPSHOT GitHub API for Java https://github-api.kohsuke.org/ GitHub API for Java @@ -61,7 +61,7 @@ org.apache.maven.scm maven-scm-manager-plexus - 1.13.0 + 2.0.1 @@ -518,7 +554,7 @@ org.eclipse.jgit org.eclipse.jgit - 6.4.0.202211300538-r + 6.7.0.202309050840-r test @@ -586,7 +622,7 @@ com.github.tomakehurst wiremock-jre8-standalone - 2.35.0 + 2.35.1 test @@ -617,7 +653,7 @@ - slow-or-flaky-test + test-slow-multireleasejar-flaky !test @@ -640,6 +676,32 @@ @{jacoco.surefire.argLine} ${surefire.argLine} -Dtest.github.connector=okhttp + + java11-test + integration-test + + test + + + ${project.basedir}/target/github-api-${project.version}.jar + false + src/test/resources/slow-or-flaky-tests.txt + @{jacoco.surefire.argLine} ${surefire.argLine} -Dtest.github.connector=httpclient + + + + java11-urlconnection-test + integration-test + + test + + + ${project.basedir}/target/github-api-${project.version}.jar + false + src/test/resources/slow-or-flaky-tests.txt + @{jacoco.surefire.argLine} ${surefire.argLine} -Dtest.github.connector=urlconnection + + slow-or-flaky-test integration-test @@ -652,7 +714,6 @@ src/test/resources/slow-or-flaky-tests.txt - @{jacoco.surefire.argLine} ${surefire.argLine} @@ -783,105 +844,6 @@ - - multirelease - - [11,) - - - - - org.codehaus.mojo - animal-sniffer-maven-plugin - - - java.net.http.* - - - - - maven-compiler-plugin - 3.10.1 - - - compile-java-11 - compile - - compile - - - 11 - 11 - 11 - - ${project.basedir}/src/main/java11 - - true - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.3.0 - - - - org.kohsuke.github.api - true - - - - - - - - - multirelease-test - - [11,) - - !test - - - - - - maven-surefire-plugin - - - java11-test - integration-test - - test - - - ${project.basedir}/target/github-api-${project.version}.jar - false - src/test/resources/slow-or-flaky-tests.txt - @{jacoco.surefire.argLine} ${surefire.argLine} -Dtest.github.connector=httpclient - - - - java11-urlconnection-test - integration-test - - test - - - ${project.basedir}/target/github-api-${project.version}.jar - false - src/test/resources/slow-or-flaky-tests.txt - @{jacoco.surefire.argLine} ${surefire.argLine} -Dtest.github.connector=urlconnection - - - - - - - - diff --git a/src/main/java/org/kohsuke/github/GHEvent.java b/src/main/java/org/kohsuke/github/GHEvent.java index d93411bedf..1170743ac3 100644 --- a/src/main/java/org/kohsuke/github/GHEvent.java +++ b/src/main/java/org/kohsuke/github/GHEvent.java @@ -102,6 +102,9 @@ public enum GHEvent { /** The merge queue entry. */ MERGE_QUEUE_ENTRY, + /** The merge group entry. */ + MERGE_GROUP, + /** The meta. */ META, diff --git a/src/main/java/org/kohsuke/github/GHRepository.java b/src/main/java/org/kohsuke/github/GHRepository.java index deaf4aeaff..a20aac28eb 100644 --- a/src/main/java/org/kohsuke/github/GHRepository.java +++ b/src/main/java/org/kohsuke/github/GHRepository.java @@ -103,6 +103,8 @@ public class GHRepository extends GHObject { private boolean allow_rebase_merge; + private boolean allow_forking; + private boolean delete_branch_on_merge; @JsonProperty("private") @@ -715,6 +717,15 @@ public boolean isAllowRebaseMerge() { return allow_rebase_merge; } + /** + * Is allow private forks + * + * @return the boolean + */ + public boolean isAllowForking() { + return allow_forking; + } + /** * Automatically deleting head branches when pull requests are merged. * @@ -1461,6 +1472,18 @@ public void allowRebaseMerge(boolean value) throws IOException { set().allowRebaseMerge(value); } + /** + * Allow private fork. + * + * @param value + * the value + * @throws IOException + * the io exception + */ + public void allowForking(boolean value) throws IOException { + set().allowForking(value); + } + /** * After pull requests are merged, you can have head branches deleted automatically. * diff --git a/src/main/java/org/kohsuke/github/GHRepositoryBuilder.java b/src/main/java/org/kohsuke/github/GHRepositoryBuilder.java index 1d8602a044..a7b5b11a72 100644 --- a/src/main/java/org/kohsuke/github/GHRepositoryBuilder.java +++ b/src/main/java/org/kohsuke/github/GHRepositoryBuilder.java @@ -76,6 +76,19 @@ public S allowRebaseMerge(boolean enabled) throws IOException { return with("allow_rebase_merge", enabled); } + /** + * Allow or disallow private forks + * + * @param enabled + * true if enabled + * @return a builder to continue with building + * @throws IOException + * In case of any networking error or error from the server. + */ + public S allowForking(boolean enabled) throws IOException { + return with("allow_forking", enabled); + } + /** * After pull requests are merged, you can have head branches deleted automatically. * diff --git a/src/main/java/org/kohsuke/github/GHVerification.java b/src/main/java/org/kohsuke/github/GHVerification.java index 382d39a26e..2a759ea5a5 100644 --- a/src/main/java/org/kohsuke/github/GHVerification.java +++ b/src/main/java/org/kohsuke/github/GHVerification.java @@ -61,48 +61,63 @@ 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 { - /** 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/AbstractGitHubWireMockTest.java b/src/test/java/org/kohsuke/github/AbstractGitHubWireMockTest.java index 990583c945..044a7122ec 100644 --- a/src/test/java/org/kohsuke/github/AbstractGitHubWireMockTest.java +++ b/src/test/java/org/kohsuke/github/AbstractGitHubWireMockTest.java @@ -226,7 +226,7 @@ protected GHRepository getTempRepository() throws IOException { * Creates a temporary repository that will be deleted at the end of the test. * * @param name - * string name of the the repository + * string name of the repository * * @return a temporary repository * @throws IOException diff --git a/src/test/java/org/kohsuke/github/EnumTest.java b/src/test/java/org/kohsuke/github/EnumTest.java index 59cf1f4d44..939c6360e3 100644 --- a/src/test/java/org/kohsuke/github/EnumTest.java +++ b/src/test/java/org/kohsuke/github/EnumTest.java @@ -32,7 +32,7 @@ public void touchEnums() { assertThat(GHDirection.values().length, equalTo(2)); - assertThat(GHEvent.values().length, equalTo(64)); + assertThat(GHEvent.values().length, equalTo(65)); assertThat(GHEvent.ALL.symbol(), equalTo("*")); assertThat(GHEvent.PULL_REQUEST.symbol(), equalTo(GHEvent.PULL_REQUEST.toString().toLowerCase())); diff --git a/src/test/java/org/kohsuke/github/GHRepositoryTest.java b/src/test/java/org/kohsuke/github/GHRepositoryTest.java index d0ff0f73e1..61ca35c9c8 100644 --- a/src/test/java/org/kohsuke/github/GHRepositoryTest.java +++ b/src/test/java/org/kohsuke/github/GHRepositoryTest.java @@ -98,6 +98,7 @@ public void testGetters() throws IOException { assertThat(r.isAllowMergeCommit(), is(true)); assertThat(r.isAllowRebaseMerge(), is(true)); assertThat(r.isAllowSquashMerge(), is(true)); + assertThat(r.isAllowForking(), is(false)); String httpTransport = "https://github.com/hub4j-test-org/temp-testGetters.git"; assertThat(r.getHttpTransportUrl(), equalTo(httpTransport)); @@ -380,6 +381,7 @@ public void testUpdateRepository() throws Exception { GHRepository updated = builder.allowRebaseMerge(false) .allowSquashMerge(false) .deleteBranchOnMerge(true) + .allowForking(true) .description(description) .downloads(false) .downloads(false) @@ -394,6 +396,7 @@ public void testUpdateRepository() throws Exception { assertThat(updated.isAllowRebaseMerge(), is(false)); assertThat(updated.isAllowSquashMerge(), is(false)); assertThat(updated.isDeleteBranchOnMerge(), is(true)); + assertThat(updated.isAllowForking(), is(true)); assertThat(updated.isPrivate(), is(true)); assertThat(updated.hasDownloads(), is(false)); assertThat(updated.hasIssues(), is(false)); 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/java/org/kohsuke/github/WireMockStatusReporterTest.java b/src/test/java/org/kohsuke/github/WireMockStatusReporterTest.java index f2033f5ae2..07eab6a2f0 100644 --- a/src/test/java/org/kohsuke/github/WireMockStatusReporterTest.java +++ b/src/test/java/org/kohsuke/github/WireMockStatusReporterTest.java @@ -147,7 +147,7 @@ public void BasicBehaviors_whenProxying() throws Exception { assertThat(e, Matchers.instanceOf(GHFileNotFoundException.class)); assertThat(e.getMessage(), containsString( - "{\"message\":\"Not Found\",\"documentation_url\":\"https://docs.github.com/rest/reference/repos#get-a-repository\"}")); + "{\"message\":\"Not Found\",\"documentation_url\":\"https://docs.github.com/rest/repos/repos#get-a-repository\"}")); } /** diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testGetters/__files/repos_hub4j-test-org_temp-testgetters-2.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testGetters/__files/repos_hub4j-test-org_temp-testgetters-2.json index f8d16217fc..dac8e119fa 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testGetters/__files/repos_hub4j-test-org_temp-testgetters-2.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testGetters/__files/repos_hub4j-test-org_temp-testgetters-2.json @@ -101,6 +101,7 @@ "allow_merge_commit": true, "allow_rebase_merge": true, "delete_branch_on_merge": false, + "allow_forking": false, "organization": { "login": "hub4j-test-org", "id": 7544739, @@ -123,4 +124,4 @@ }, "network_count": 0, "subscribers_count": 7 -} \ No newline at end of file +} diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testUpdateRepository/__files/repos_hub4j-test-org_temp-testupdaterepository-2.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testUpdateRepository/__files/repos_hub4j-test-org_temp-testupdaterepository-2.json index a6f5e84b2c..b35dc8ffd7 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testUpdateRepository/__files/repos_hub4j-test-org_temp-testupdaterepository-2.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testUpdateRepository/__files/repos_hub4j-test-org_temp-testupdaterepository-2.json @@ -101,6 +101,7 @@ "allow_merge_commit": true, "allow_rebase_merge": true, "delete_branch_on_merge": false, + "allow_forking": false, "organization": { "login": "hub4j-test-org", "id": 7544739, @@ -123,4 +124,4 @@ }, "network_count": 0, "subscribers_count": 9 -} \ No newline at end of file +} diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testUpdateRepository/__files/repos_hub4j-test-org_temp-testupdaterepository-3.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testUpdateRepository/__files/repos_hub4j-test-org_temp-testupdaterepository-3.json index d62845bc50..ed4894e9e9 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testUpdateRepository/__files/repos_hub4j-test-org_temp-testupdaterepository-3.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testUpdateRepository/__files/repos_hub4j-test-org_temp-testupdaterepository-3.json @@ -100,6 +100,7 @@ "allow_merge_commit": true, "allow_rebase_merge": false, "delete_branch_on_merge": true, + "allow_forking": true, "organization": { "login": "hub4j-test-org", "id": 7544739, @@ -122,4 +123,4 @@ }, "network_count": 0, "subscribers_count": 9 -} \ No newline at end of file +} diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testUpdateRepository/__files/repos_hub4j-test-org_temp-testupdaterepository-4.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testUpdateRepository/__files/repos_hub4j-test-org_temp-testupdaterepository-4.json index 8c2ad19854..8e4d6e85ba 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testUpdateRepository/__files/repos_hub4j-test-org_temp-testupdaterepository-4.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testUpdateRepository/__files/repos_hub4j-test-org_temp-testupdaterepository-4.json @@ -100,6 +100,7 @@ "allow_merge_commit": false, "allow_rebase_merge": true, "delete_branch_on_merge": true, + "allow_forking": false, "organization": { "login": "hub4j-test-org", "id": 7544739, @@ -122,4 +123,4 @@ }, "network_count": 0, "subscribers_count": 9 -} \ No newline at end of file +} diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testUpdateRepository/__files/repos_hub4j-test-org_temp-testupdaterepository-5.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testUpdateRepository/__files/repos_hub4j-test-org_temp-testupdaterepository-5.json index 3ce310fccf..88ad46243c 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testUpdateRepository/__files/repos_hub4j-test-org_temp-testupdaterepository-5.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testUpdateRepository/__files/repos_hub4j-test-org_temp-testupdaterepository-5.json @@ -100,6 +100,7 @@ "allow_merge_commit": false, "allow_rebase_merge": true, "delete_branch_on_merge": true, + "allow_forking": false, "organization": { "login": "hub4j-test-org", "id": 7544739, @@ -122,4 +123,4 @@ }, "network_count": 0, "subscribers_count": 9 -} \ No newline at end of file +} diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testUpdateRepository/mappings/repos_hub4j-test-org_temp-testupdaterepository-3.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testUpdateRepository/mappings/repos_hub4j-test-org_temp-testupdaterepository-3.json index 8596d7744c..38d758a008 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testUpdateRepository/mappings/repos_hub4j-test-org_temp-testupdaterepository-3.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testUpdateRepository/mappings/repos_hub4j-test-org_temp-testupdaterepository-3.json @@ -11,7 +11,7 @@ }, "bodyPatterns": [ { - "equalToJson": "{\"name\":\"temp-testUpdateRepository\",\"has_projects\":false,\"allow_squash_merge\":false,\"private\":true,\"has_downloads\":false,\"has_wiki\":false,\"description\":\"A test repository for update testing via the github-api project\",\"delete_branch_on_merge\":true,\"allow_rebase_merge\":false,\"has_issues\":false,\"homepage\":\"https://github-api.kohsuke.org/apidocs/index.html\"}", + "equalToJson": "{\"name\":\"temp-testUpdateRepository\",\"has_projects\":false,\"allow_squash_merge\":false,\"allow_forking\":true,\"private\":true,\"has_downloads\":false,\"has_wiki\":false,\"description\":\"A test repository for update testing via the github-api project\",\"delete_branch_on_merge\":true,\"allow_rebase_merge\":false,\"has_issues\":false,\"homepage\":\"https://github-api.kohsuke.org/apidocs/index.html\"}", "ignoreArrayOrder": true, "ignoreExtraElements": false } @@ -51,4 +51,4 @@ "uuid": "d0036ebb-64a8-4c4c-bed3-697870892d5f", "persistent": true, "insertionIndex": 3 -} \ No newline at end of file +} 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