From 6d46a66bee9d4a51de5ea20b20a5e89fe8f56f33 Mon Sep 17 00:00:00 2001 From: acx Date: Tue, 12 Apr 2022 11:43:55 +0300 Subject: [PATCH 1/5] Add method to check if user is collaborator --- .../java/org/kohsuke/github/GHRepository.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/org/kohsuke/github/GHRepository.java b/src/main/java/org/kohsuke/github/GHRepository.java index fd38253a0c..7ab4c6eaec 100644 --- a/src/main/java/org/kohsuke/github/GHRepository.java +++ b/src/main/java/org/kohsuke/github/GHRepository.java @@ -1013,6 +1013,21 @@ public Set getCollaboratorNames(CollaboratorAffiliation affiliation) thr return r; } + /** + * Checks if the given user is a collaborator for this repository. + * + * @param u + * the u + * @return the boolean + * @throws IOException + * the io exception + */ + public boolean isCollaborator(GHUser u) throws IOException { + return root().createRequest() + .withUrlPath(getApiTailUrl("collaborators/" + u.getLogin())) + .fetchHttpStatusCode() == 204; + } + /** * Obtain permission for a given user in this repository. * From 844cb0f6b913935c7332f2f1df1475c282ebfc77 Mon Sep 17 00:00:00 2001 From: acx Date: Tue, 12 Apr 2022 11:50:41 +0300 Subject: [PATCH 2/5] Add test for user is collaborator --- src/test/java/org/kohsuke/github/GHRepositoryTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/java/org/kohsuke/github/GHRepositoryTest.java b/src/test/java/org/kohsuke/github/GHRepositoryTest.java index a1e3833be9..2e7f5d78da 100644 --- a/src/test/java/org/kohsuke/github/GHRepositoryTest.java +++ b/src/test/java/org/kohsuke/github/GHRepositoryTest.java @@ -891,6 +891,13 @@ public void listCollaboratorsFiltered() throws Exception { assertThat(filteredCollaborators.size(), lessThan(allCollaborators.size())); } + @Test + public void userIsCollaborator() throws Exception { + GHRepository repo = getRepository(); + GHUser collaborator = repo.listCollaborators().toList().get(0); + assertThat(repo.isCollaborator(collaborator), is(true)); + } + @Test public void getCheckRuns() throws Exception { final int expectedCount = 8; From 98dd65cdb0e63e38350622f0a705a5078edf2ac5 Mon Sep 17 00:00:00 2001 From: acx Date: Wed, 22 Jun 2022 16:29:30 +0300 Subject: [PATCH 3/5] Add wiremock files for userIsCollaborator test --- .../userIsCollaborator/__files/user-1.json | 46 ++++++++++++++++++ .../userIsCollaborator/mappings/user-1.json | 48 +++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/user-1.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/user-1.json diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/user-1.json new file mode 100644 index 0000000000..0903a33033 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/user-1.json @@ -0,0 +1,46 @@ +{ + "login": "0xacx", + "id": 99351112, + "node_id": "U_kgDOBev6SA", + "avatar_url": "https://avatars.githubusercontent.com/u/99351112?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/0xacx", + "html_url": "https://github.com/0xacx", + "followers_url": "https://api.github.com/users/0xacx/followers", + "following_url": "https://api.github.com/users/0xacx/following{/other_user}", + "gists_url": "https://api.github.com/users/0xacx/gists{/gist_id}", + "starred_url": "https://api.github.com/users/0xacx/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/0xacx/subscriptions", + "organizations_url": "https://api.github.com/users/0xacx/orgs", + "repos_url": "https://api.github.com/users/0xacx/repos", + "events_url": "https://api.github.com/users/0xacx/events{/privacy}", + "received_events_url": "https://api.github.com/users/0xacx/received_events", + "type": "User", + "site_admin": false, + "name": null, + "company": null, + "blog": "", + "location": null, + "email": null, + "hireable": null, + "bio": null, + "twitter_username": null, + "public_repos": 13, + "public_gists": 0, + "followers": 0, + "following": 2, + "created_at": "2022-02-09T16:37:05Z", + "updated_at": "2022-06-15T07:58:04Z", + "private_gists": 0, + "total_private_repos": 0, + "owned_private_repos": 0, + "disk_usage": 725, + "collaborators": 0, + "two_factor_authentication": false, + "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/GHRepositoryTest/wiremock/userIsCollaborator/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/user-1.json new file mode 100644 index 0000000000..d8248b7126 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/user-1.json @@ -0,0 +1,48 @@ +{ + "id": "27a143ee-fd78-47f0-a017-1ffd68615756", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-1.json", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 22 Jun 2022 13:18:14 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"73ba98e72cc4eee3ac22773bf0aca91ee52ada5d7ed1683fb83c677d46388dde\"", + "Last-Modified": "Wed, 15 Jun 2022 07:58:04 GMT", + "X-OAuth-Scopes": "admin:org, admin:repo_hook, gist, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-20 12:51:45 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4888", + "X-RateLimit-Reset": "1655906861", + "X-RateLimit-Used": "112", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CDCC:0F9F:287D3E:2D0A3B:62B31696" + } + }, + "uuid": "27a143ee-fd78-47f0-a017-1ffd68615756", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file From 7178690674fc6893b5a93a64ffb4f09da9e6531f Mon Sep 17 00:00:00 2001 From: acx Date: Thu, 23 Jun 2022 09:58:55 +0300 Subject: [PATCH 4/5] Add remaining wiremock files for userIsCollaborator test --- .../__files/orgs_hub4j-test-org-2.json | 55 ++ .../repos_hub4j-test-org_github-api-3.json | 365 ++++++++ ...j-test-org_github-api_collaborators-4.json | 842 ++++++++++++++++++ ...epositories_206888201_collaborators-5.json | 254 ++++++ .../mappings/orgs_hub4j-test-org-2.json | 48 + .../repos_hub4j-test-org_github-api-3.json | 48 + ...j-test-org_github-api_collaborators-4.json | 48 + ...org_github-api_collaborators_vbehar-6.json | 40 + ...epositories_206888201_collaborators-5.json | 48 + 9 files changed, 1748 insertions(+) create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/orgs_hub4j-test-org-2.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/repos_hub4j-test-org_github-api-3.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/repos_hub4j-test-org_github-api_collaborators-4.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/repositories_206888201_collaborators-5.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/orgs_hub4j-test-org-2.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/repos_hub4j-test-org_github-api-3.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/repos_hub4j-test-org_github-api_collaborators-4.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/repos_hub4j-test-org_github-api_collaborators_vbehar-6.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/repositories_206888201_collaborators-5.json diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..628aa16924 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/orgs_hub4j-test-org-2.json @@ -0,0 +1,55 @@ +{ + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/hub4j-test-org", + "repos_url": "https://api.github.com/orgs/hub4j-test-org/repos", + "events_url": "https://api.github.com/orgs/hub4j-test-org/events", + "hooks_url": "https://api.github.com/orgs/hub4j-test-org/hooks", + "issues_url": "https://api.github.com/orgs/hub4j-test-org/issues", + "members_url": "https://api.github.com/orgs/hub4j-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/hub4j-test-org/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/7544739?v=4", + "description": "Hub4j Test Org Description (this could be null or blank too)", + "name": "Hub4j Test Org Name (this could be null or blank too)", + "company": null, + "blog": "https://hub4j.url.io/could/be/null", + "location": "Hub4j Test Org Location (this could be null or blank too)", + "email": "hub4jtestorgemail@could.be.null.com", + "twitter_username": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 50, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/hub4j-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2020-06-04T05:56:10Z", + "type": "Organization", + "total_private_repos": 4, + "owned_private_repos": 4, + "private_gists": 0, + "disk_usage": 11980, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "members_allowed_repository_creation_type": "none", + "members_can_create_public_repositories": false, + "members_can_create_private_repositories": false, + "members_can_create_internal_repositories": false, + "members_can_create_pages": true, + "members_can_fork_private_repositories": false, + "members_can_create_public_pages": true, + "members_can_create_private_pages": true, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 10000, + "filled_seats": 38, + "seats": 3 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/repos_hub4j-test-org_github-api-3.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/repos_hub4j-test-org_github-api-3.json new file mode 100644 index 0000000000..8716ab734a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/repos_hub4j-test-org_github-api-3.json @@ -0,0 +1,365 @@ +{ + "id": 206888201, + "node_id": "MDEwOlJlcG9zaXRvcnkyMDY4ODgyMDE=", + "name": "github-api", + "full_name": "hub4j-test-org/github-api", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/github-api", + "description": "Tricky", + "fork": true, + "url": "https://api.github.com/repos/hub4j-test-org/github-api", + "forks_url": "https://api.github.com/repos/hub4j-test-org/github-api/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/github-api/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/github-api/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/github-api/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/github-api/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/github-api/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/github-api/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/github-api/deployments", + "created_at": "2019-09-06T23:26:04Z", + "updated_at": "2022-05-23T14:23:52Z", + "pushed_at": "2022-06-21T17:18:17Z", + "git_url": "git://github.com/hub4j-test-org/github-api.git", + "ssh_url": "git@github.com:hub4j-test-org/github-api.git", + "clone_url": "https://github.com/hub4j-test-org/github-api.git", + "svn_url": "https://github.com/hub4j-test-org/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 19045, + "stargazers_count": 1, + "watchers_count": 1, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 7, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": true, + "is_template": false, + "topics": [], + "visibility": "public", + "forks": 0, + "open_issues": 7, + "watchers": 1, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "temp_clone_token": "", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "parent": { + "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://avatars.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": "2022-06-21T16:37:05Z", + "pushed_at": "2022-06-22T03:11:41Z", + "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": "https://github-api.kohsuke.org/", + "size": 40084, + "stargazers_count": 907, + "watchers_count": 907, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 618, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 106, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": true, + "is_template": false, + "topics": [ + "api", + "client-library", + "github", + "github-api", + "github-api-v3", + "java", + "java-api" + ], + "visibility": "public", + "forks": 618, + "open_issues": 106, + "watchers": 907, + "default_branch": "main" + }, + "source": { + "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://avatars.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": "2022-06-21T16:37:05Z", + "pushed_at": "2022-06-22T03:11:41Z", + "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": "https://github-api.kohsuke.org/", + "size": 40084, + "stargazers_count": 907, + "watchers_count": 907, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 618, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 106, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": true, + "is_template": false, + "topics": [ + "api", + "client-library", + "github", + "github-api", + "github-api-v3", + "java", + "java-api" + ], + "visibility": "public", + "forks": 618, + "open_issues": 106, + "watchers": 907, + "default_branch": "main" + }, + "network_count": 618, + "subscribers_count": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/repos_hub4j-test-org_github-api_collaborators-4.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/repos_hub4j-test-org_github-api_collaborators-4.json new file mode 100644 index 0000000000..5cfd5fb504 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/repos_hub4j-test-org_github-api_collaborators-4.json @@ -0,0 +1,842 @@ +[ + { + "login": "vbehar", + "id": 6251, + "node_id": "MDQ6VXNlcjYyNTE=", + "avatar_url": "https://avatars.githubusercontent.com/u/6251?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/vbehar", + "html_url": "https://github.com/vbehar", + "followers_url": "https://api.github.com/users/vbehar/followers", + "following_url": "https://api.github.com/users/vbehar/following{/other_user}", + "gists_url": "https://api.github.com/users/vbehar/gists{/gist_id}", + "starred_url": "https://api.github.com/users/vbehar/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/vbehar/subscriptions", + "organizations_url": "https://api.github.com/users/vbehar/orgs", + "repos_url": "https://api.github.com/users/vbehar/repos", + "events_url": "https://api.github.com/users/vbehar/events{/privacy}", + "received_events_url": "https://api.github.com/users/vbehar/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": false, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "maintain" + }, + { + "login": "kohsuke", + "id": 50003, + "node_id": "MDQ6VXNlcjUwMDAz", + "avatar_url": "https://avatars.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, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "gastaldi", + "id": 54133, + "node_id": "MDQ6VXNlcjU0MTMz", + "avatar_url": "https://avatars.githubusercontent.com/u/54133?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gastaldi", + "html_url": "https://github.com/gastaldi", + "followers_url": "https://api.github.com/users/gastaldi/followers", + "following_url": "https://api.github.com/users/gastaldi/following{/other_user}", + "gists_url": "https://api.github.com/users/gastaldi/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gastaldi/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gastaldi/subscriptions", + "organizations_url": "https://api.github.com/users/gastaldi/orgs", + "repos_url": "https://api.github.com/users/gastaldi/repos", + "events_url": "https://api.github.com/users/gastaldi/events{/privacy}", + "received_events_url": "https://api.github.com/users/gastaldi/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "halkeye", + "id": 110087, + "node_id": "MDQ6VXNlcjExMDA4Nw==", + "avatar_url": "https://avatars.githubusercontent.com/u/110087?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/halkeye", + "html_url": "https://github.com/halkeye", + "followers_url": "https://api.github.com/users/halkeye/followers", + "following_url": "https://api.github.com/users/halkeye/following{/other_user}", + "gists_url": "https://api.github.com/users/halkeye/gists{/gist_id}", + "starred_url": "https://api.github.com/users/halkeye/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/halkeye/subscriptions", + "organizations_url": "https://api.github.com/users/halkeye/orgs", + "repos_url": "https://api.github.com/users/halkeye/repos", + "events_url": "https://api.github.com/users/halkeye/events{/privacy}", + "received_events_url": "https://api.github.com/users/halkeye/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "tedyoung", + "id": 382660, + "node_id": "MDQ6VXNlcjM4MjY2MA==", + "avatar_url": "https://avatars.githubusercontent.com/u/382660?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/tedyoung", + "html_url": "https://github.com/tedyoung", + "followers_url": "https://api.github.com/users/tedyoung/followers", + "following_url": "https://api.github.com/users/tedyoung/following{/other_user}", + "gists_url": "https://api.github.com/users/tedyoung/gists{/gist_id}", + "starred_url": "https://api.github.com/users/tedyoung/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/tedyoung/subscriptions", + "organizations_url": "https://api.github.com/users/tedyoung/orgs", + "repos_url": "https://api.github.com/users/tedyoung/repos", + "events_url": "https://api.github.com/users/tedyoung/events{/privacy}", + "received_events_url": "https://api.github.com/users/tedyoung/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "mrginglymus", + "id": 390569, + "node_id": "MDQ6VXNlcjM5MDU2OQ==", + "avatar_url": "https://avatars.githubusercontent.com/u/390569?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/mrginglymus", + "html_url": "https://github.com/mrginglymus", + "followers_url": "https://api.github.com/users/mrginglymus/followers", + "following_url": "https://api.github.com/users/mrginglymus/following{/other_user}", + "gists_url": "https://api.github.com/users/mrginglymus/gists{/gist_id}", + "starred_url": "https://api.github.com/users/mrginglymus/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/mrginglymus/subscriptions", + "organizations_url": "https://api.github.com/users/mrginglymus/orgs", + "repos_url": "https://api.github.com/users/mrginglymus/repos", + "events_url": "https://api.github.com/users/mrginglymus/events{/privacy}", + "received_events_url": "https://api.github.com/users/mrginglymus/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "cmoulliard", + "id": 463790, + "node_id": "MDQ6VXNlcjQ2Mzc5MA==", + "avatar_url": "https://avatars.githubusercontent.com/u/463790?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/cmoulliard", + "html_url": "https://github.com/cmoulliard", + "followers_url": "https://api.github.com/users/cmoulliard/followers", + "following_url": "https://api.github.com/users/cmoulliard/following{/other_user}", + "gists_url": "https://api.github.com/users/cmoulliard/gists{/gist_id}", + "starred_url": "https://api.github.com/users/cmoulliard/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/cmoulliard/subscriptions", + "organizations_url": "https://api.github.com/users/cmoulliard/orgs", + "repos_url": "https://api.github.com/users/cmoulliard/repos", + "events_url": "https://api.github.com/users/cmoulliard/events{/privacy}", + "received_events_url": "https://api.github.com/users/cmoulliard/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "farmdawgnation", + "id": 620189, + "node_id": "MDQ6VXNlcjYyMDE4OQ==", + "avatar_url": "https://avatars.githubusercontent.com/u/620189?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/farmdawgnation", + "html_url": "https://github.com/farmdawgnation", + "followers_url": "https://api.github.com/users/farmdawgnation/followers", + "following_url": "https://api.github.com/users/farmdawgnation/following{/other_user}", + "gists_url": "https://api.github.com/users/farmdawgnation/gists{/gist_id}", + "starred_url": "https://api.github.com/users/farmdawgnation/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/farmdawgnation/subscriptions", + "organizations_url": "https://api.github.com/users/farmdawgnation/orgs", + "repos_url": "https://api.github.com/users/farmdawgnation/repos", + "events_url": "https://api.github.com/users/farmdawgnation/events{/privacy}", + "received_events_url": "https://api.github.com/users/farmdawgnation/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "alexanderrtaylor", + "id": 852179, + "node_id": "MDQ6VXNlcjg1MjE3OQ==", + "avatar_url": "https://avatars.githubusercontent.com/u/852179?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/alexanderrtaylor", + "html_url": "https://github.com/alexanderrtaylor", + "followers_url": "https://api.github.com/users/alexanderrtaylor/followers", + "following_url": "https://api.github.com/users/alexanderrtaylor/following{/other_user}", + "gists_url": "https://api.github.com/users/alexanderrtaylor/gists{/gist_id}", + "starred_url": "https://api.github.com/users/alexanderrtaylor/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/alexanderrtaylor/subscriptions", + "organizations_url": "https://api.github.com/users/alexanderrtaylor/orgs", + "repos_url": "https://api.github.com/users/alexanderrtaylor/repos", + "events_url": "https://api.github.com/users/alexanderrtaylor/events{/privacy}", + "received_events_url": "https://api.github.com/users/alexanderrtaylor/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "jlengrand", + "id": 921666, + "node_id": "MDQ6VXNlcjkyMTY2Ng==", + "avatar_url": "https://avatars.githubusercontent.com/u/921666?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/jlengrand", + "html_url": "https://github.com/jlengrand", + "followers_url": "https://api.github.com/users/jlengrand/followers", + "following_url": "https://api.github.com/users/jlengrand/following{/other_user}", + "gists_url": "https://api.github.com/users/jlengrand/gists{/gist_id}", + "starred_url": "https://api.github.com/users/jlengrand/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/jlengrand/subscriptions", + "organizations_url": "https://api.github.com/users/jlengrand/orgs", + "repos_url": "https://api.github.com/users/jlengrand/repos", + "events_url": "https://api.github.com/users/jlengrand/events{/privacy}", + "received_events_url": "https://api.github.com/users/jlengrand/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "PauloMigAlmeida", + "id": 1011868, + "node_id": "MDQ6VXNlcjEwMTE4Njg=", + "avatar_url": "https://avatars.githubusercontent.com/u/1011868?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/PauloMigAlmeida", + "html_url": "https://github.com/PauloMigAlmeida", + "followers_url": "https://api.github.com/users/PauloMigAlmeida/followers", + "following_url": "https://api.github.com/users/PauloMigAlmeida/following{/other_user}", + "gists_url": "https://api.github.com/users/PauloMigAlmeida/gists{/gist_id}", + "starred_url": "https://api.github.com/users/PauloMigAlmeida/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/PauloMigAlmeida/subscriptions", + "organizations_url": "https://api.github.com/users/PauloMigAlmeida/orgs", + "repos_url": "https://api.github.com/users/PauloMigAlmeida/repos", + "events_url": "https://api.github.com/users/PauloMigAlmeida/events{/privacy}", + "received_events_url": "https://api.github.com/users/PauloMigAlmeida/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "gsmet", + "id": 1279749, + "node_id": "MDQ6VXNlcjEyNzk3NDk=", + "avatar_url": "https://avatars.githubusercontent.com/u/1279749?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gsmet", + "html_url": "https://github.com/gsmet", + "followers_url": "https://api.github.com/users/gsmet/followers", + "following_url": "https://api.github.com/users/gsmet/following{/other_user}", + "gists_url": "https://api.github.com/users/gsmet/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gsmet/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gsmet/subscriptions", + "organizations_url": "https://api.github.com/users/gsmet/orgs", + "repos_url": "https://api.github.com/users/gsmet/repos", + "events_url": "https://api.github.com/users/gsmet/events{/privacy}", + "received_events_url": "https://api.github.com/users/gsmet/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "JLLeitschuh", + "id": 1323708, + "node_id": "MDQ6VXNlcjEzMjM3MDg=", + "avatar_url": "https://avatars.githubusercontent.com/u/1323708?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/JLLeitschuh", + "html_url": "https://github.com/JLLeitschuh", + "followers_url": "https://api.github.com/users/JLLeitschuh/followers", + "following_url": "https://api.github.com/users/JLLeitschuh/following{/other_user}", + "gists_url": "https://api.github.com/users/JLLeitschuh/gists{/gist_id}", + "starred_url": "https://api.github.com/users/JLLeitschuh/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/JLLeitschuh/subscriptions", + "organizations_url": "https://api.github.com/users/JLLeitschuh/orgs", + "repos_url": "https://api.github.com/users/JLLeitschuh/repos", + "events_url": "https://api.github.com/users/JLLeitschuh/events{/privacy}", + "received_events_url": "https://api.github.com/users/JLLeitschuh/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "kohsuke2", + "id": 1329242, + "node_id": "MDQ6VXNlcjEzMjkyNDI=", + "avatar_url": "https://avatars.githubusercontent.com/u/1329242?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kohsuke2", + "html_url": "https://github.com/kohsuke2", + "followers_url": "https://api.github.com/users/kohsuke2/followers", + "following_url": "https://api.github.com/users/kohsuke2/following{/other_user}", + "gists_url": "https://api.github.com/users/kohsuke2/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kohsuke2/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kohsuke2/subscriptions", + "organizations_url": "https://api.github.com/users/kohsuke2/orgs", + "repos_url": "https://api.github.com/users/kohsuke2/repos", + "events_url": "https://api.github.com/users/kohsuke2/events{/privacy}", + "received_events_url": "https://api.github.com/users/kohsuke2/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "ecxia", + "id": 1586186, + "node_id": "MDQ6VXNlcjE1ODYxODY=", + "avatar_url": "https://avatars.githubusercontent.com/u/1586186?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/ecxia", + "html_url": "https://github.com/ecxia", + "followers_url": "https://api.github.com/users/ecxia/followers", + "following_url": "https://api.github.com/users/ecxia/following{/other_user}", + "gists_url": "https://api.github.com/users/ecxia/gists{/gist_id}", + "starred_url": "https://api.github.com/users/ecxia/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/ecxia/subscriptions", + "organizations_url": "https://api.github.com/users/ecxia/orgs", + "repos_url": "https://api.github.com/users/ecxia/repos", + "events_url": "https://api.github.com/users/ecxia/events{/privacy}", + "received_events_url": "https://api.github.com/users/ecxia/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "jgangemi", + "id": 1831839, + "node_id": "MDQ6VXNlcjE4MzE4Mzk=", + "avatar_url": "https://avatars.githubusercontent.com/u/1831839?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/jgangemi", + "html_url": "https://github.com/jgangemi", + "followers_url": "https://api.github.com/users/jgangemi/followers", + "following_url": "https://api.github.com/users/jgangemi/following{/other_user}", + "gists_url": "https://api.github.com/users/jgangemi/gists{/gist_id}", + "starred_url": "https://api.github.com/users/jgangemi/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/jgangemi/subscriptions", + "organizations_url": "https://api.github.com/users/jgangemi/orgs", + "repos_url": "https://api.github.com/users/jgangemi/repos", + "events_url": "https://api.github.com/users/jgangemi/events{/privacy}", + "received_events_url": "https://api.github.com/users/jgangemi/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars.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, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "antrix190", + "id": 3845033, + "node_id": "MDQ6VXNlcjM4NDUwMzM=", + "avatar_url": "https://avatars.githubusercontent.com/u/3845033?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/antrix190", + "html_url": "https://github.com/antrix190", + "followers_url": "https://api.github.com/users/antrix190/followers", + "following_url": "https://api.github.com/users/antrix190/following{/other_user}", + "gists_url": "https://api.github.com/users/antrix190/gists{/gist_id}", + "starred_url": "https://api.github.com/users/antrix190/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/antrix190/subscriptions", + "organizations_url": "https://api.github.com/users/antrix190/orgs", + "repos_url": "https://api.github.com/users/antrix190/repos", + "events_url": "https://api.github.com/users/antrix190/events{/privacy}", + "received_events_url": "https://api.github.com/users/antrix190/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "qc12su", + "id": 4357348, + "node_id": "MDQ6VXNlcjQzNTczNDg=", + "avatar_url": "https://avatars.githubusercontent.com/u/4357348?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/qc12su", + "html_url": "https://github.com/qc12su", + "followers_url": "https://api.github.com/users/qc12su/followers", + "following_url": "https://api.github.com/users/qc12su/following{/other_user}", + "gists_url": "https://api.github.com/users/qc12su/gists{/gist_id}", + "starred_url": "https://api.github.com/users/qc12su/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/qc12su/subscriptions", + "organizations_url": "https://api.github.com/users/qc12su/orgs", + "repos_url": "https://api.github.com/users/qc12su/repos", + "events_url": "https://api.github.com/users/qc12su/events{/privacy}", + "received_events_url": "https://api.github.com/users/qc12su/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "asthinasthi", + "id": 4577101, + "node_id": "MDQ6VXNlcjQ1NzcxMDE=", + "avatar_url": "https://avatars.githubusercontent.com/u/4577101?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/asthinasthi", + "html_url": "https://github.com/asthinasthi", + "followers_url": "https://api.github.com/users/asthinasthi/followers", + "following_url": "https://api.github.com/users/asthinasthi/following{/other_user}", + "gists_url": "https://api.github.com/users/asthinasthi/gists{/gist_id}", + "starred_url": "https://api.github.com/users/asthinasthi/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/asthinasthi/subscriptions", + "organizations_url": "https://api.github.com/users/asthinasthi/orgs", + "repos_url": "https://api.github.com/users/asthinasthi/repos", + "events_url": "https://api.github.com/users/asthinasthi/events{/privacy}", + "received_events_url": "https://api.github.com/users/asthinasthi/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "ingwarsw", + "id": 5390156, + "node_id": "MDQ6VXNlcjUzOTAxNTY=", + "avatar_url": "https://avatars.githubusercontent.com/u/5390156?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/ingwarsw", + "html_url": "https://github.com/ingwarsw", + "followers_url": "https://api.github.com/users/ingwarsw/followers", + "following_url": "https://api.github.com/users/ingwarsw/following{/other_user}", + "gists_url": "https://api.github.com/users/ingwarsw/gists{/gist_id}", + "starred_url": "https://api.github.com/users/ingwarsw/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/ingwarsw/subscriptions", + "organizations_url": "https://api.github.com/users/ingwarsw/orgs", + "repos_url": "https://api.github.com/users/ingwarsw/repos", + "events_url": "https://api.github.com/users/ingwarsw/events{/privacy}", + "received_events_url": "https://api.github.com/users/ingwarsw/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "Sage-Pierce", + "id": 5396306, + "node_id": "MDQ6VXNlcjUzOTYzMDY=", + "avatar_url": "https://avatars.githubusercontent.com/u/5396306?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Sage-Pierce", + "html_url": "https://github.com/Sage-Pierce", + "followers_url": "https://api.github.com/users/Sage-Pierce/followers", + "following_url": "https://api.github.com/users/Sage-Pierce/following{/other_user}", + "gists_url": "https://api.github.com/users/Sage-Pierce/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Sage-Pierce/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Sage-Pierce/subscriptions", + "organizations_url": "https://api.github.com/users/Sage-Pierce/orgs", + "repos_url": "https://api.github.com/users/Sage-Pierce/repos", + "events_url": "https://api.github.com/users/Sage-Pierce/events{/privacy}", + "received_events_url": "https://api.github.com/users/Sage-Pierce/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "t0m4uk1991", + "id": 6698785, + "node_id": "MDQ6VXNlcjY2OTg3ODU=", + "avatar_url": "https://avatars.githubusercontent.com/u/6698785?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/t0m4uk1991", + "html_url": "https://github.com/t0m4uk1991", + "followers_url": "https://api.github.com/users/t0m4uk1991/followers", + "following_url": "https://api.github.com/users/t0m4uk1991/following{/other_user}", + "gists_url": "https://api.github.com/users/t0m4uk1991/gists{/gist_id}", + "starred_url": "https://api.github.com/users/t0m4uk1991/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/t0m4uk1991/subscriptions", + "organizations_url": "https://api.github.com/users/t0m4uk1991/orgs", + "repos_url": "https://api.github.com/users/t0m4uk1991/repos", + "events_url": "https://api.github.com/users/t0m4uk1991/events{/privacy}", + "received_events_url": "https://api.github.com/users/t0m4uk1991/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "Irialad", + "id": 6895648, + "node_id": "MDQ6VXNlcjY4OTU2NDg=", + "avatar_url": "https://avatars.githubusercontent.com/u/6895648?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Irialad", + "html_url": "https://github.com/Irialad", + "followers_url": "https://api.github.com/users/Irialad/followers", + "following_url": "https://api.github.com/users/Irialad/following{/other_user}", + "gists_url": "https://api.github.com/users/Irialad/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Irialad/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Irialad/subscriptions", + "organizations_url": "https://api.github.com/users/Irialad/orgs", + "repos_url": "https://api.github.com/users/Irialad/repos", + "events_url": "https://api.github.com/users/Irialad/events{/privacy}", + "received_events_url": "https://api.github.com/users/Irialad/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "avano", + "id": 7081216, + "node_id": "MDQ6VXNlcjcwODEyMTY=", + "avatar_url": "https://avatars.githubusercontent.com/u/7081216?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/avano", + "html_url": "https://github.com/avano", + "followers_url": "https://api.github.com/users/avano/followers", + "following_url": "https://api.github.com/users/avano/following{/other_user}", + "gists_url": "https://api.github.com/users/avano/gists{/gist_id}", + "starred_url": "https://api.github.com/users/avano/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/avano/subscriptions", + "organizations_url": "https://api.github.com/users/avano/orgs", + "repos_url": "https://api.github.com/users/avano/repos", + "events_url": "https://api.github.com/users/avano/events{/privacy}", + "received_events_url": "https://api.github.com/users/avano/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "vahrennd", + "id": 8679583, + "node_id": "MDQ6VXNlcjg2Nzk1ODM=", + "avatar_url": "https://avatars.githubusercontent.com/u/8679583?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/vahrennd", + "html_url": "https://github.com/vahrennd", + "followers_url": "https://api.github.com/users/vahrennd/followers", + "following_url": "https://api.github.com/users/vahrennd/following{/other_user}", + "gists_url": "https://api.github.com/users/vahrennd/gists{/gist_id}", + "starred_url": "https://api.github.com/users/vahrennd/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/vahrennd/subscriptions", + "organizations_url": "https://api.github.com/users/vahrennd/orgs", + "repos_url": "https://api.github.com/users/vahrennd/repos", + "events_url": "https://api.github.com/users/vahrennd/events{/privacy}", + "received_events_url": "https://api.github.com/users/vahrennd/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "bloslo", + "id": 11611189, + "node_id": "MDQ6VXNlcjExNjExMTg5", + "avatar_url": "https://avatars.githubusercontent.com/u/11611189?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bloslo", + "html_url": "https://github.com/bloslo", + "followers_url": "https://api.github.com/users/bloslo/followers", + "following_url": "https://api.github.com/users/bloslo/following{/other_user}", + "gists_url": "https://api.github.com/users/bloslo/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bloslo/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bloslo/subscriptions", + "organizations_url": "https://api.github.com/users/bloslo/orgs", + "repos_url": "https://api.github.com/users/bloslo/repos", + "events_url": "https://api.github.com/users/bloslo/events{/privacy}", + "received_events_url": "https://api.github.com/users/bloslo/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "km2018", + "id": 13594336, + "node_id": "MDQ6VXNlcjEzNTk0MzM2", + "avatar_url": "https://avatars.githubusercontent.com/u/13594336?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/km2018", + "html_url": "https://github.com/km2018", + "followers_url": "https://api.github.com/users/km2018/followers", + "following_url": "https://api.github.com/users/km2018/following{/other_user}", + "gists_url": "https://api.github.com/users/km2018/gists{/gist_id}", + "starred_url": "https://api.github.com/users/km2018/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/km2018/subscriptions", + "organizations_url": "https://api.github.com/users/km2018/orgs", + "repos_url": "https://api.github.com/users/km2018/repos", + "events_url": "https://api.github.com/users/km2018/events{/privacy}", + "received_events_url": "https://api.github.com/users/km2018/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "akashRindhe", + "id": 14114123, + "node_id": "MDQ6VXNlcjE0MTE0MTIz", + "avatar_url": "https://avatars.githubusercontent.com/u/14114123?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/akashRindhe", + "html_url": "https://github.com/akashRindhe", + "followers_url": "https://api.github.com/users/akashRindhe/followers", + "following_url": "https://api.github.com/users/akashRindhe/following{/other_user}", + "gists_url": "https://api.github.com/users/akashRindhe/gists{/gist_id}", + "starred_url": "https://api.github.com/users/akashRindhe/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/akashRindhe/subscriptions", + "organizations_url": "https://api.github.com/users/akashRindhe/orgs", + "repos_url": "https://api.github.com/users/akashRindhe/repos", + "events_url": "https://api.github.com/users/akashRindhe/events{/privacy}", + "received_events_url": "https://api.github.com/users/akashRindhe/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "jberglund-BSFT", + "id": 19560713, + "node_id": "MDQ6VXNlcjE5NTYwNzEz", + "avatar_url": "https://avatars.githubusercontent.com/u/19560713?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/jberglund-BSFT", + "html_url": "https://github.com/jberglund-BSFT", + "followers_url": "https://api.github.com/users/jberglund-BSFT/followers", + "following_url": "https://api.github.com/users/jberglund-BSFT/following{/other_user}", + "gists_url": "https://api.github.com/users/jberglund-BSFT/gists{/gist_id}", + "starred_url": "https://api.github.com/users/jberglund-BSFT/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/jberglund-BSFT/subscriptions", + "organizations_url": "https://api.github.com/users/jberglund-BSFT/orgs", + "repos_url": "https://api.github.com/users/jberglund-BSFT/repos", + "events_url": "https://api.github.com/users/jberglund-BSFT/events{/privacy}", + "received_events_url": "https://api.github.com/users/jberglund-BSFT/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/repositories_206888201_collaborators-5.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/repositories_206888201_collaborators-5.json new file mode 100644 index 0000000000..c72cd76f1f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/__files/repositories_206888201_collaborators-5.json @@ -0,0 +1,254 @@ +[ + { + "login": "timja", + "id": 21194782, + "node_id": "MDQ6VXNlcjIxMTk0Nzgy", + "avatar_url": "https://avatars.githubusercontent.com/u/21194782?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/timja", + "html_url": "https://github.com/timja", + "followers_url": "https://api.github.com/users/timja/followers", + "following_url": "https://api.github.com/users/timja/following{/other_user}", + "gists_url": "https://api.github.com/users/timja/gists{/gist_id}", + "starred_url": "https://api.github.com/users/timja/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/timja/subscriptions", + "organizations_url": "https://api.github.com/users/timja/orgs", + "repos_url": "https://api.github.com/users/timja/repos", + "events_url": "https://api.github.com/users/timja/events{/privacy}", + "received_events_url": "https://api.github.com/users/timja/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "kisaga", + "id": 23390439, + "node_id": "MDQ6VXNlcjIzMzkwNDM5", + "avatar_url": "https://avatars.githubusercontent.com/u/23390439?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kisaga", + "html_url": "https://github.com/kisaga", + "followers_url": "https://api.github.com/users/kisaga/followers", + "following_url": "https://api.github.com/users/kisaga/following{/other_user}", + "gists_url": "https://api.github.com/users/kisaga/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kisaga/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kisaga/subscriptions", + "organizations_url": "https://api.github.com/users/kisaga/orgs", + "repos_url": "https://api.github.com/users/kisaga/repos", + "events_url": "https://api.github.com/users/kisaga/events{/privacy}", + "received_events_url": "https://api.github.com/users/kisaga/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "martinvanzijl", + "id": 24422213, + "node_id": "MDQ6VXNlcjI0NDIyMjEz", + "avatar_url": "https://avatars.githubusercontent.com/u/24422213?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/martinvanzijl", + "html_url": "https://github.com/martinvanzijl", + "followers_url": "https://api.github.com/users/martinvanzijl/followers", + "following_url": "https://api.github.com/users/martinvanzijl/following{/other_user}", + "gists_url": "https://api.github.com/users/martinvanzijl/gists{/gist_id}", + "starred_url": "https://api.github.com/users/martinvanzijl/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/martinvanzijl/subscriptions", + "organizations_url": "https://api.github.com/users/martinvanzijl/orgs", + "repos_url": "https://api.github.com/users/martinvanzijl/repos", + "events_url": "https://api.github.com/users/martinvanzijl/events{/privacy}", + "received_events_url": "https://api.github.com/users/martinvanzijl/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "SCHJonathan", + "id": 26502832, + "node_id": "MDQ6VXNlcjI2NTAyODMy", + "avatar_url": "https://avatars.githubusercontent.com/u/26502832?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/SCHJonathan", + "html_url": "https://github.com/SCHJonathan", + "followers_url": "https://api.github.com/users/SCHJonathan/followers", + "following_url": "https://api.github.com/users/SCHJonathan/following{/other_user}", + "gists_url": "https://api.github.com/users/SCHJonathan/gists{/gist_id}", + "starred_url": "https://api.github.com/users/SCHJonathan/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/SCHJonathan/subscriptions", + "organizations_url": "https://api.github.com/users/SCHJonathan/orgs", + "repos_url": "https://api.github.com/users/SCHJonathan/repos", + "events_url": "https://api.github.com/users/SCHJonathan/events{/privacy}", + "received_events_url": "https://api.github.com/users/SCHJonathan/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "willtsai", + "id": 28876888, + "node_id": "MDQ6VXNlcjI4ODc2ODg4", + "avatar_url": "https://avatars.githubusercontent.com/u/28876888?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/willtsai", + "html_url": "https://github.com/willtsai", + "followers_url": "https://api.github.com/users/willtsai/followers", + "following_url": "https://api.github.com/users/willtsai/following{/other_user}", + "gists_url": "https://api.github.com/users/willtsai/gists{/gist_id}", + "starred_url": "https://api.github.com/users/willtsai/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/willtsai/subscriptions", + "organizations_url": "https://api.github.com/users/willtsai/orgs", + "repos_url": "https://api.github.com/users/willtsai/repos", + "events_url": "https://api.github.com/users/willtsai/events{/privacy}", + "received_events_url": "https://api.github.com/users/willtsai/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "Typraeurion", + "id": 36168707, + "node_id": "MDQ6VXNlcjM2MTY4NzA3", + "avatar_url": "https://avatars.githubusercontent.com/u/36168707?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/Typraeurion", + "html_url": "https://github.com/Typraeurion", + "followers_url": "https://api.github.com/users/Typraeurion/followers", + "following_url": "https://api.github.com/users/Typraeurion/following{/other_user}", + "gists_url": "https://api.github.com/users/Typraeurion/gists{/gist_id}", + "starred_url": "https://api.github.com/users/Typraeurion/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/Typraeurion/subscriptions", + "organizations_url": "https://api.github.com/users/Typraeurion/orgs", + "repos_url": "https://api.github.com/users/Typraeurion/repos", + "events_url": "https://api.github.com/users/Typraeurion/events{/privacy}", + "received_events_url": "https://api.github.com/users/Typraeurion/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "mxandeco", + "id": 42962662, + "node_id": "MDQ6VXNlcjQyOTYyNjYy", + "avatar_url": "https://avatars.githubusercontent.com/u/42962662?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/mxandeco", + "html_url": "https://github.com/mxandeco", + "followers_url": "https://api.github.com/users/mxandeco/followers", + "following_url": "https://api.github.com/users/mxandeco/following{/other_user}", + "gists_url": "https://api.github.com/users/mxandeco/gists{/gist_id}", + "starred_url": "https://api.github.com/users/mxandeco/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/mxandeco/subscriptions", + "organizations_url": "https://api.github.com/users/mxandeco/orgs", + "repos_url": "https://api.github.com/users/mxandeco/repos", + "events_url": "https://api.github.com/users/mxandeco/events{/privacy}", + "received_events_url": "https://api.github.com/users/mxandeco/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "tginiotis-at-work", + "id": 61763026, + "node_id": "MDQ6VXNlcjYxNzYzMDI2", + "avatar_url": "https://avatars.githubusercontent.com/u/61763026?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/tginiotis-at-work", + "html_url": "https://github.com/tginiotis-at-work", + "followers_url": "https://api.github.com/users/tginiotis-at-work/followers", + "following_url": "https://api.github.com/users/tginiotis-at-work/following{/other_user}", + "gists_url": "https://api.github.com/users/tginiotis-at-work/gists{/gist_id}", + "starred_url": "https://api.github.com/users/tginiotis-at-work/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/tginiotis-at-work/subscriptions", + "organizations_url": "https://api.github.com/users/tginiotis-at-work/orgs", + "repos_url": "https://api.github.com/users/tginiotis-at-work/repos", + "events_url": "https://api.github.com/users/tginiotis-at-work/events{/privacy}", + "received_events_url": "https://api.github.com/users/tginiotis-at-work/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + }, + { + "login": "0xacx", + "id": 99351112, + "node_id": "U_kgDOBev6SA", + "avatar_url": "https://avatars.githubusercontent.com/u/99351112?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/0xacx", + "html_url": "https://github.com/0xacx", + "followers_url": "https://api.github.com/users/0xacx/followers", + "following_url": "https://api.github.com/users/0xacx/following{/other_user}", + "gists_url": "https://api.github.com/users/0xacx/gists{/gist_id}", + "starred_url": "https://api.github.com/users/0xacx/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/0xacx/subscriptions", + "organizations_url": "https://api.github.com/users/0xacx/orgs", + "repos_url": "https://api.github.com/users/0xacx/repos", + "events_url": "https://api.github.com/users/0xacx/events{/privacy}", + "received_events_url": "https://api.github.com/users/0xacx/received_events", + "type": "User", + "site_admin": false, + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "role_name": "admin" + } +] \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..bb3d284504 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/orgs_hub4j-test-org-2.json @@ -0,0 +1,48 @@ +{ + "id": "12d0904c-a249-4339-b8ab-e9c5f1484c38", + "name": "orgs_hub4j-test-org", + "request": { + "url": "/orgs/hub4j-test-org", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_hub4j-test-org-2.json", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 22 Jun 2022 13:18:15 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"80dbe7cd27a01d294925375cca9edb73bc5b5215126873fa5b58df298a20e7a1\"", + "Last-Modified": "Thu, 04 Jun 2020 05:56:10 GMT", + "X-OAuth-Scopes": "admin:org, admin:repo_hook, gist, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "github-authentication-token-expiration": "2022-09-20 12:51:45 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4886", + "X-RateLimit-Reset": "1655906861", + "X-RateLimit-Used": "114", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CDCD:2B83:13B8A8F:1423E49:62B31697" + } + }, + "uuid": "12d0904c-a249-4339-b8ab-e9c5f1484c38", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/repos_hub4j-test-org_github-api-3.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/repos_hub4j-test-org_github-api-3.json new file mode 100644 index 0000000000..3ccf0df2be --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/repos_hub4j-test-org_github-api-3.json @@ -0,0 +1,48 @@ +{ + "id": "cb685d03-9994-419a-bba7-a43525aec7c5", + "name": "repos_hub4j-test-org_github-api", + "request": { + "url": "/repos/hub4j-test-org/github-api", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_github-api-3.json", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 22 Jun 2022 13:18:15 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"cb99d6332ac5c8b2c09a1b93d8c078ce24f73cb0b79858a1516f6f939aae0a72\"", + "Last-Modified": "Mon, 23 May 2022 14:23:52 GMT", + "X-OAuth-Scopes": "admin:org, admin:repo_hook, gist, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2022-09-20 12:51:45 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4885", + "X-RateLimit-Reset": "1655906861", + "X-RateLimit-Used": "115", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CDCE:115D0:11EC0F1:1255378:62B31697" + } + }, + "uuid": "cb685d03-9994-419a-bba7-a43525aec7c5", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/repos_hub4j-test-org_github-api_collaborators-4.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/repos_hub4j-test-org_github-api_collaborators-4.json new file mode 100644 index 0000000000..9ff9256bb7 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/repos_hub4j-test-org_github-api_collaborators-4.json @@ -0,0 +1,48 @@ +{ + "id": "51d46529-a306-4d19-810c-92843fcd36b3", + "name": "repos_hub4j-test-org_github-api_collaborators", + "request": { + "url": "/repos/hub4j-test-org/github-api/collaborators", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_github-api_collaborators-4.json", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 22 Jun 2022 13:18:16 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"451021fe23138706be1e1e35f542497503828ad1ff3eaf82f8e8be7550eadcfe\"", + "X-OAuth-Scopes": "admin:org, admin:repo_hook, gist, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-20 12:51:45 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4884", + "X-RateLimit-Reset": "1655906861", + "X-RateLimit-Used": "116", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CDCF:11403:BF7787:C51875:62B31697", + "Link": "; rel=\"next\", ; rel=\"last\"" + } + }, + "uuid": "51d46529-a306-4d19-810c-92843fcd36b3", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/repos_hub4j-test-org_github-api_collaborators_vbehar-6.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/repos_hub4j-test-org_github-api_collaborators_vbehar-6.json new file mode 100644 index 0000000000..a9f25af5dd --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/repos_hub4j-test-org_github-api_collaborators_vbehar-6.json @@ -0,0 +1,40 @@ +{ + "id": "2ec707ff-894b-4e30-bab5-8b8ffc82adeb", + "name": "repos_hub4j-test-org_github-api_collaborators_vbehar", + "request": { + "url": "/repos/hub4j-test-org/github-api/collaborators/vbehar", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 204, + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 22 Jun 2022 13:18:16 GMT", + "X-OAuth-Scopes": "admin:org, admin:repo_hook, gist, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-20 12:51:45 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4882", + "X-RateLimit-Reset": "1655906861", + "X-RateLimit-Used": "118", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "Vary": "Accept-Encoding, Accept, X-Requested-With", + "X-GitHub-Request-Id": "CDD1:21ED:1404C81:146F821:62B31698" + } + }, + "uuid": "2ec707ff-894b-4e30-bab5-8b8ffc82adeb", + "persistent": true, + "insertionIndex": 6 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/repositories_206888201_collaborators-5.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/repositories_206888201_collaborators-5.json new file mode 100644 index 0000000000..3baf3d426e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/userIsCollaborator/mappings/repositories_206888201_collaborators-5.json @@ -0,0 +1,48 @@ +{ + "id": "2624a0c2-3bee-4d14-ad13-b0c96381ad90", + "name": "repositories_206888201_collaborators", + "request": { + "url": "/repositories/206888201/collaborators?page=2", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repositories_206888201_collaborators-5.json", + "headers": { + "Server": "GitHub.com", + "Date": "Wed, 22 Jun 2022 13:18:16 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"d53581f41f93b974f1e2c3f8c7d3f42343561163b0593865121640518d932cad\"", + "X-OAuth-Scopes": "admin:org, admin:repo_hook, gist, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2022-09-20 12:51:45 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4883", + "X-RateLimit-Reset": "1655906861", + "X-RateLimit-Used": "117", + "X-RateLimit-Resource": "core", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "CDD0:11400:57FAC0:5CF124:62B31698", + "Link": "; rel=\"prev\", ; rel=\"first\"" + } + }, + "uuid": "2624a0c2-3bee-4d14-ad13-b0c96381ad90", + "persistent": true, + "insertionIndex": 5 +} \ No newline at end of file From f3c56bf3ab5b18235dfdc40c39aaf129aaca64f6 Mon Sep 17 00:00:00 2001 From: acx Date: Thu, 23 Jun 2022 10:23:45 +0300 Subject: [PATCH 5/5] Improve javadoc, use complete parameter name --- src/main/java/org/kohsuke/github/GHRepository.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/kohsuke/github/GHRepository.java b/src/main/java/org/kohsuke/github/GHRepository.java index c31aeeaead..58ef89578b 100644 --- a/src/main/java/org/kohsuke/github/GHRepository.java +++ b/src/main/java/org/kohsuke/github/GHRepository.java @@ -1025,15 +1025,15 @@ public Set getCollaboratorNames(CollaboratorAffiliation affiliation) thr /** * Checks if the given user is a collaborator for this repository. * - * @param u - * the u - * @return the boolean + * @param user + * a {@link GHUser} + * @return true if the user is a collaborator for this repository * @throws IOException * the io exception */ - public boolean isCollaborator(GHUser u) throws IOException { + public boolean isCollaborator(GHUser user) throws IOException { return root().createRequest() - .withUrlPath(getApiTailUrl("collaborators/" + u.getLogin())) + .withUrlPath(getApiTailUrl("collaborators/" + user.getLogin())) .fetchHttpStatusCode() == 204; }