diff --git a/lib/octokit/client/organizations.rb b/lib/octokit/client/organizations.rb index c0c0001bf..932e6bd41 100644 --- a/lib/octokit/client/organizations.rb +++ b/lib/octokit/client/organizations.rb @@ -31,6 +31,8 @@ def organization(org, options = {}) # @option values [String] :email Publicly visible email address. # @option values [String] :location Location of organization. # @option values [String] :name GitHub username for organization. + # @option values [String] :default_repository_permission The default permission members have on organization repositories. + # @option values [Boolean] :members_can_create_repositories Set true to allow members to create repositories on the organization. # @return [Sawyer::Resource] Hash representing GitHub organization. # @see https://developer.github.com/v3/orgs/#edit-an-organization # @example @@ -207,6 +209,69 @@ def organization_public_member?(org, user, options = {}) end alias :org_public_member? :organization_public_member? + # List pending organization invitations + # + # Requires authenticated organization member. + # + # @param org [String, Integer] Organization GitHub login or id. + # @return [Array] Array of hashes representing invitations. + # @see https://developer.github.com/v3/orgs/members/#list-pending-organization-invitations + # + # @example + # @client.organization_invitations('github') + def organization_invitations(org, options = {}) + options = ensure_api_media_type(:org_memberships, options) + get "#{Organization.path org}/invitations", options + end + alias :org_invitations :organization_invitations + + # List outside collaborators for an organization + # + # Requires authenticated organization members. + # + # @param org [String, Integer] Organization GitHub login or id. + # @return [Array] Array of hashes representing users. + # @see https://developer.github.com/v3/orgs/outside-collaborators/#list-outside-collaborators + # + # @example + # @client.outside_collaborators('github') + def outside_collaborators(org, options={}) + options = ensure_api_media_type(:org_memberships, options) + get "#{Organization.path org}/outside_collaborators", options + end + + # Remove outside collaborator from an organization + # + # Requires authenticated organization members. + # + # @param org [String, Integer] Organization GitHub login or id. + # @param user [String] GitHub username to be removed as outside collaborator + # @return [Boolean] Return true if outside collaborator removed from organization, false otherwise. + # @see https://developer.github.com/v3/orgs/outside-collaborators/#remove-outside-collaborator + # + # @example + # @client.remove_outside_collaborator('github', 'lizzhale') + def remove_outside_collaborator(org, user, options={}) + options = ensure_api_media_type(:org_memberships, options) + boolean_from_response :delete, "#{Organization.path org}/outside_collaborators/#{user}", options + end + + # Converts an organization member to an outside collaborator + # + # Requires authenticated organization members. + # + # @param org [String, Integer] Organization GitHub login or id. + # @param user [String] GitHub username to be removed as outside collaborator + # @return [Boolean] Return true if outside collaborator removed from organization, false otherwise. + # @see https://developer.github.com/v3/orgs/outside-collaborators/#convert-member-to-outside-collaborator + # + # @example + # @client.convert_to_outside_collaborator('github', 'lizzhale') + def convert_to_outside_collaborator(org, user, options={}) + options = ensure_api_media_type(:org_memberships, options) + boolean_from_response :put, "#{Organization.path org}/outside_collaborators/#{user}", options + end + # List teams # # Requires authenticated organization member. @@ -230,6 +295,7 @@ def organization_teams(org, options = {}) # @param org [String, Integer] Organization GitHub login or id. # @option options [String] :name Team name. # @option options [Array] :repo_names Repositories for the team. + # @option options [Array] :maintainers Maintainers for the team. # @return [Sawyer::Resource] Hash representing new team. # @see https://developer.github.com/v3/orgs/teams/#create-team # @example @@ -367,6 +433,21 @@ def team_member?(team_id, user, options = {}) boolean_from_response :get, "teams/#{team_id}/members/#{user}", options end + # List pending team invitations + # + # Requires authenticated organization member. + # + # @param team_id [Integer] Team id. + # @return [Array] Array of hashes representing invitations. + # @see https://developer.github.com/v3/orgs/teams/#list-pending-team-invitations + # + # @example + # @client.team_invitations('github') + def team_invitations(team_id, options = {}) + options = ensure_api_media_type(:org_memberships, options) + get "teams/#{team_id}/invitations", options + end + # List team repositories # # Requires authenticated organization member. diff --git a/lib/octokit/client/repositories.rb b/lib/octokit/client/repositories.rb index 1e084ad90..5964f69e4 100644 --- a/lib/octokit/client/repositories.rb +++ b/lib/octokit/client/repositories.rb @@ -277,6 +277,9 @@ def remove_deploy_key(repo, id, options = {}) # Requires authenticated client for private repos. # # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @option options [String] :affiliation Filters the return array by affiliation. + # Can be one of: outside or all. + # If not specified, defaults to all # @return [Array] Array of hashes representing collaborating users. # @see https://developer.github.com/v3/repos/collaborators/#list-collaborators # @example @@ -346,6 +349,19 @@ def collaborator?(repo, collaborator, options={}) boolean_from_response :get, "#{Repository.path repo}/collaborators/#{collaborator}", options end + # Get a user's permission level for a repo. + # + # Requires authenticated client + # + # @return [Sawyer::Resource] Hash representing the user's permission level for the given repository + # @see https://developer.github.com/v3/repos/collaborators/#review-a-users-permission-level + # @example + # @client.permission_level('octokit/octokit.rb', 'lizzhale') + def permission_level(repo, collaborator, options={}) + options = ensure_api_media_type(:org_memberships, options) + get "#{Repository.path repo}/collaborators/#{collaborator}/permission", options + end + # List teams for a repo # # Requires authenticated client that is an owner or collaborator of the repo. diff --git a/lib/octokit/preview.rb b/lib/octokit/preview.rb index 33efc6f5d..b4746e816 100644 --- a/lib/octokit/preview.rb +++ b/lib/octokit/preview.rb @@ -13,7 +13,8 @@ module Preview :issue_timelines => 'application/vnd.github.mockingbird-preview+json'.freeze, :pages => 'application/vnd.github.mister-fantastic-preview+json'.freeze, :projects => 'application/vnd.github.inertia-preview+json'.freeze, - :traffic => 'application/vnd.github.spiderman-preview'.freeze + :traffic => 'application/vnd.github.spiderman-preview'.freeze, + :org_membership => 'application/vnd.github.korra-preview'.freeze } def ensure_api_media_type(type, options) diff --git a/spec/cassettes/Octokit_Client_Organizations/_organization_invitations/lists_pending_organization_invitations.json b/spec/cassettes/Octokit_Client_Organizations/_organization_invitations/lists_pending_organization_invitations.json new file mode 100644 index 000000000..5dd4d9d97 --- /dev/null +++ b/spec/cassettes/Octokit_Client_Organizations/_organization_invitations/lists_pending_organization_invitations.json @@ -0,0 +1 @@ +{"http_interactions":[{"request":{"method":"get","uri":"https://api.github.com/orgs//invitations","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"Accept":["application/vnd.github.korra-preview+json"],"User-Agent":["Octokit Ruby Gem 4.6.0"],"Content-Type":["application/json"],"Authorization":["token <>"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Server":["GitHub.com"],"Date":["Fri, 18 Nov 2016 03:57:21 GMT"],"Content-Type":["application/json; charset=utf-8"],"Content-Length":["2"],"Status":["200 OK"],"X-Ratelimit-Limit":["5000"],"X-Ratelimit-Remaining":["3785"],"X-Ratelimit-Reset":["1479443057"],"Cache-Control":["private, max-age=60, s-maxage=60"],"Vary":["Accept, Authorization, Cookie, X-GitHub-OTP","Accept-Encoding"],"Etag":["\"74981bad1a2cd19e46517a1fba85716c\""],"X-Oauth-Scopes":["admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user"],"X-Accepted-Oauth-Scopes":["admin:org, repo"],"X-Github-Media-Type":["github.korra-preview; format=json"],"Access-Control-Expose-Headers":["ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval"],"Access-Control-Allow-Origin":["*"],"Content-Security-Policy":["default-src 'none'"],"Strict-Transport-Security":["max-age=31536000; includeSubdomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Frame-Options":["deny"],"X-Xss-Protection":["1; mode=block"],"X-Served-By":["2c18a09f3ac5e4dd1e004af7c5a94769"],"X-Github-Request-Id":["32B88C12:14AE7:BB5088B:582E7C20"]},"body":{"encoding":"UTF-8","base64_string":"W10=\n"},"http_version":null},"recorded_at":"Fri, 18 Nov 2016 03:57:21 GMT"}],"recorded_with":"VCR 2.9.3"} \ No newline at end of file diff --git a/spec/cassettes/Octokit_Client_Organizations/_outside_collaborators/lists_outside_collaborators_for_an_organization.json b/spec/cassettes/Octokit_Client_Organizations/_outside_collaborators/lists_outside_collaborators_for_an_organization.json new file mode 100644 index 000000000..7a9abae64 --- /dev/null +++ b/spec/cassettes/Octokit_Client_Organizations/_outside_collaborators/lists_outside_collaborators_for_an_organization.json @@ -0,0 +1 @@ +{"http_interactions":[{"request":{"method":"get","uri":"https://api.github.com/orgs//outside_collaborators","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"Accept":["application/vnd.github.korra-preview+json"],"User-Agent":["Octokit Ruby Gem 4.6.0"],"Content-Type":["application/json"],"Authorization":["token <>"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Server":["GitHub.com"],"Date":["Fri, 18 Nov 2016 03:57:22 GMT"],"Content-Type":["application/json; charset=utf-8"],"Content-Length":["2"],"Status":["200 OK"],"X-Ratelimit-Limit":["5000"],"X-Ratelimit-Remaining":["3784"],"X-Ratelimit-Reset":["1479443057"],"Cache-Control":["private, max-age=60, s-maxage=60"],"Vary":["Accept, Authorization, Cookie, X-GitHub-OTP","Accept-Encoding"],"Etag":["\"74981bad1a2cd19e46517a1fba85716c\""],"X-Oauth-Scopes":["admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user"],"X-Accepted-Oauth-Scopes":["admin:org, read:org, repo, write:org"],"X-Github-Media-Type":["github.korra-preview; format=json"],"Access-Control-Expose-Headers":["ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval"],"Access-Control-Allow-Origin":["*"],"Content-Security-Policy":["default-src 'none'"],"Strict-Transport-Security":["max-age=31536000; includeSubdomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Frame-Options":["deny"],"X-Xss-Protection":["1; mode=block"],"X-Served-By":["7f48e2f7761567e923121f17538d7a6d"],"X-Github-Request-Id":["32B88C12:14AE5:B454A61:582E7C22"]},"body":{"encoding":"UTF-8","base64_string":"W10=\n"},"http_version":null},"recorded_at":"Fri, 18 Nov 2016 03:57:22 GMT"}],"recorded_with":"VCR 2.9.3"} \ No newline at end of file diff --git a/spec/cassettes/Octokit_Client_Organizations/with_team/_team_invitations/lists_pending_team_invitations.json b/spec/cassettes/Octokit_Client_Organizations/with_team/_team_invitations/lists_pending_team_invitations.json new file mode 100644 index 000000000..eecf49fe3 --- /dev/null +++ b/spec/cassettes/Octokit_Client_Organizations/with_team/_team_invitations/lists_pending_team_invitations.json @@ -0,0 +1 @@ +{"http_interactions":[{"request":{"method":"post","uri":"https://api.github.com/orgs//teams","body":{"encoding":"UTF-8","base64_string":"eyJuYW1lIjoiVGVzdCBUZWFtIDE0Nzk0NDE0MzYifQ==\n"},"headers":{"Accept":["application/vnd.github.v3+json"],"User-Agent":["Octokit Ruby Gem 4.6.0"],"Content-Type":["application/json"],"Authorization":["token <>"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"]}},"response":{"status":{"code":201,"message":"Created"},"headers":{"Server":["GitHub.com"],"Date":["Fri, 18 Nov 2016 03:57:17 GMT"],"Content-Type":["application/json; charset=utf-8"],"Content-Length":["1101"],"Status":["201 Created"],"X-Ratelimit-Limit":["5000"],"X-Ratelimit-Remaining":["3788"],"X-Ratelimit-Reset":["1479443057"],"Cache-Control":["private, max-age=60, s-maxage=60"],"Vary":["Accept, Authorization, Cookie, X-GitHub-OTP","Accept-Encoding"],"Etag":["\"f97162330b62476fd43359411401426c\""],"X-Oauth-Scopes":["admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user"],"X-Accepted-Oauth-Scopes":["admin:org, repo"],"Location":["https://api.github.com/teams/"],"X-Github-Media-Type":["github.v3; format=json"],"Access-Control-Expose-Headers":["ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval"],"Access-Control-Allow-Origin":["*"],"Content-Security-Policy":["default-src 'none'"],"Strict-Transport-Security":["max-age=31536000; includeSubdomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Frame-Options":["deny"],"X-Xss-Protection":["1; mode=block"],"X-Served-By":["d256f86292c6dde5d09d15d926ec67a3"],"X-Github-Request-Id":["32B88C12:14AE5:B454791:582E7C1D"]},"body":{"encoding":"UTF-8","base64_string":"eyJuYW1lIjoiV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naXRodWIuY29t\nL29yZ3MvPEdJVEhVQl9URVNUX09SR0FOSVpBVElPTj4vaXNzdWVzIiwibWVt\nYmVyc191cmwiOiJodHRwczovL2FwaS5naXRodWIuY29tL29yZ3MvPEdJVEhV\nQl9URVNUX09SR0FOSVpBVElPTj4vbWVtYmVyc3svbWVtYmVyfSIsInB1Ymxp\nY19tZW1iZXJzX3VybCI6Imh0dHBzOi8vYXBpLmdpdGh1Yi5jb20vb3Jncy88\nR0lUSFVCX1RFU1RfT1JHQU5JWkFUSU9OPi9wdWJsaWNfbWVtYmVyc3svbWVt\nYmVyfSIsImF2YXRhcl91cmwiOiJodHRwczovL2F2YXRhcnMuZ2l0aHVidXNl\ncmNvbnRlbnQuY29tL3UvMjM1NDYyNjA/dj0zIiwiZGVzY3JpcHRpb24iOm51\nbGwsInB1YmxpY19yZXBvcyI6MCwicHVibGljX2dpc3RzIjowLCJmb2xsb3dl\ncnMiOjAsImZvbGxvd2luZyI6MCwiaHRtbF91cmwiOiJodHRwczovL2dpdGh1\nYi5jb20vPEdJVEhVQl9URVNUX09SR0FOSVpBVElPTj4iLCJjcmVhdGVkX2F0\nIjoiMjAxNi0xMS0xOFQwMzo1NDo1OFoiLCJ1cGRhdGVkX2F0IjoiMjAxNi0x\nMS0xOFQwMzo1NDo1OFoiLCJ0eXBlIjoiT3JnYW5pemF0aW9uIn19\n"},"http_version":null},"recorded_at":"Fri, 18 Nov 2016 03:57:17 GMT"},{"request":{"method":"get","uri":"https://api.github.com/teams//invitations","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"Accept":["application/vnd.github.korra-preview+json"],"User-Agent":["Octokit Ruby Gem 4.6.0"],"Content-Type":["application/json"],"Authorization":["token <>"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Server":["GitHub.com"],"Date":["Fri, 18 Nov 2016 03:57:17 GMT"],"Content-Type":["application/json; charset=utf-8"],"Content-Length":["2"],"Status":["200 OK"],"X-Ratelimit-Limit":["5000"],"X-Ratelimit-Remaining":["3787"],"X-Ratelimit-Reset":["1479443057"],"Cache-Control":["private, max-age=60, s-maxage=60"],"Vary":["Accept, Authorization, Cookie, X-GitHub-OTP","Accept-Encoding"],"Etag":["\"74981bad1a2cd19e46517a1fba85716c\""],"X-Oauth-Scopes":["admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user"],"X-Accepted-Oauth-Scopes":["admin:org, repo"],"X-Github-Media-Type":["github.korra-preview; format=json"],"Access-Control-Expose-Headers":["ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval"],"Access-Control-Allow-Origin":["*"],"Content-Security-Policy":["default-src 'none'"],"Strict-Transport-Security":["max-age=31536000; includeSubdomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Frame-Options":["deny"],"X-Xss-Protection":["1; mode=block"],"X-Served-By":["a241e1a8264a6ace03db946c85b92db3"],"X-Github-Request-Id":["32B88C12:14AE7:BB5071E:582E7C1D"]},"body":{"encoding":"UTF-8","base64_string":"W10=\n"},"http_version":null},"recorded_at":"Fri, 18 Nov 2016 03:57:18 GMT"},{"request":{"method":"delete","uri":"https://api.github.com/teams/","body":{"encoding":"UTF-8","base64_string":"e30=\n"},"headers":{"Accept":["application/vnd.github.v3+json"],"User-Agent":["Octokit Ruby Gem 4.6.0"],"Content-Type":["application/json"],"Authorization":["token <>"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"]}},"response":{"status":{"code":204,"message":"No Content"},"headers":{"Server":["GitHub.com"],"Date":["Fri, 18 Nov 2016 03:57:18 GMT"],"Status":["204 No Content"],"X-Ratelimit-Limit":["5000"],"X-Ratelimit-Remaining":["3786"],"X-Ratelimit-Reset":["1479443057"],"X-Oauth-Scopes":["admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user"],"X-Accepted-Oauth-Scopes":["admin:org, repo"],"X-Github-Media-Type":["github.v3; format=json"],"Access-Control-Expose-Headers":["ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval"],"Access-Control-Allow-Origin":["*"],"Content-Security-Policy":["default-src 'none'"],"Strict-Transport-Security":["max-age=31536000; includeSubdomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Frame-Options":["deny"],"X-Xss-Protection":["1; mode=block"],"Vary":["Accept-Encoding"],"X-Served-By":["76d9828c7e4f1d910f7ba069e90ce976"],"X-Github-Request-Id":["32B88C12:14AE5:B454800:582E7C1E"]},"body":{"encoding":"UTF-8","base64_string":""},"http_version":null},"recorded_at":"Fri, 18 Nov 2016 03:57:18 GMT"}],"recorded_with":"VCR 2.9.3"} \ No newline at end of file diff --git a/spec/cassettes/Octokit_Client_Repositories/with_repository/_permission_level/returns_the_permission_level_a_user_has_on_a_repository.json b/spec/cassettes/Octokit_Client_Repositories/with_repository/_permission_level/returns_the_permission_level_a_user_has_on_a_repository.json new file mode 100644 index 000000000..63ae7b2fd --- /dev/null +++ b/spec/cassettes/Octokit_Client_Repositories/with_repository/_permission_level/returns_the_permission_level_a_user_has_on_a_repository.json @@ -0,0 +1 @@ +{"http_interactions":[{"request":{"method":"post","uri":"https://api.github.com/user/repos","body":{"encoding":"UTF-8","base64_string":"eyJhdXRvX2luaXQiOnRydWUsIm5hbWUiOiJhbi1yZXBvIn0=\n"},"headers":{"Accept":["application/vnd.github.v3+json"],"User-Agent":["Octokit Ruby Gem 4.6.0"],"Content-Type":["application/json"],"Authorization":["token <>"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"]}},"response":{"status":{"code":201,"message":"Created"},"headers":{"Server":["GitHub.com"],"Date":["Sat, 19 Nov 2016 01:16:21 GMT"],"Content-Type":["application/json; charset=utf-8"],"Content-Length":["4490"],"Status":["201 Created"],"X-Ratelimit-Limit":["5000"],"X-Ratelimit-Remaining":["4533"],"X-Ratelimit-Reset":["1479519258"],"Cache-Control":["private, max-age=60, s-maxage=60"],"Vary":["Accept, Authorization, Cookie, X-GitHub-OTP","Accept-Encoding"],"Etag":["\"49eb1dc636a878c287603922c938abd1\""],"X-Oauth-Scopes":["admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user"],"X-Accepted-Oauth-Scopes":["public_repo, repo"],"Location":["https://api.github.com/repos//an-repo"],"X-Github-Media-Type":["github.v3; format=json"],"Access-Control-Expose-Headers":["ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval"],"Access-Control-Allow-Origin":["*"],"Content-Security-Policy":["default-src 'none'"],"Strict-Transport-Security":["max-age=31536000; includeSubdomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Frame-Options":["deny"],"X-Xss-Protection":["1; mode=block"],"X-Served-By":["e724c57ebb9961c772a91e2dd7421c8d"],"X-Github-Request-Id":["32B88C12:14AE7:C757D03:582FA7E4"]},"body":{"encoding":"UTF-8","base64_string":"eyJpZCI6NzQxNzg5NjIsIm5hbWUiOiJhbi1yZXBvIiwiZnVsbF9uYW1lIjoi\nPEdJVEhVQl9MT0dJTj4vYW4tcmVwbyIsIm93bmVyIjp7ImxvZ2luIjoiPEdJ\nVEhVQl9MT0dJTj4iLCJpZCI6MTg2MzE5NTksImF2YXRhcl91cmwiOiJodHRw\nczovL2F2YXRhcnMuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3UvMTg2MzE5NTk/\ndj0zIiwiZ3JhdmF0YXJfaWQiOiIiLCJ1cmwiOiJodHRwczovL2FwaS5naXRo\ndWIuY29tL3VzZXJzLzxHSVRIVUJfTE9HSU4+IiwiaHRtbF91cm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1YnNjcmliZXJzX2NvdW50IjoxfQ==\n"},"http_version":null},"recorded_at":"Sat, 19 Nov 2016 01:16:21 GMT"},{"request":{"method":"get","uri":"https://api.github.com/repos//an-repo/collaborators/lizzhale/permission","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"Accept":["application/vnd.github.korra-preview+json"],"User-Agent":["Octokit Ruby Gem 4.6.0"],"Content-Type":["application/json"],"Authorization":["token <>"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Server":["GitHub.com"],"Date":["Sat, 19 Nov 2016 01:16:21 GMT"],"Content-Type":["application/json; charset=utf-8"],"Transfer-Encoding":["chunked"],"Status":["200 OK"],"X-Ratelimit-Limit":["5000"],"X-Ratelimit-Remaining":["4532"],"X-Ratelimit-Reset":["1479519258"],"Cache-Control":["private, max-age=60, s-maxage=60"],"Vary":["Accept, Authorization, Cookie, X-GitHub-OTP","Accept-Encoding"],"Etag":["W/\"9eec53f904a6fbf087ac9ef7c8f4a71b\""],"X-Oauth-Scopes":["admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user"],"X-Accepted-Oauth-Scopes":[""],"X-Github-Media-Type":["github.korra-preview; format=json"],"Access-Control-Expose-Headers":["ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval"],"Access-Control-Allow-Origin":["*"],"Content-Security-Policy":["default-src 'none'"],"Strict-Transport-Security":["max-age=31536000; includeSubdomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Frame-Options":["deny"],"X-Xss-Protection":["1; mode=block"],"X-Served-By":["ef96c2e493b28ffea49b891b085ed2dd"],"X-Github-Request-Id":["32B88C12:14AE7:C757D4F:582FA7E5"]},"body":{"encoding":"ASCII-8BIT","base64_string":"eyJwZXJtaXNzaW9uIjoicmVhZC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kX2V2ZW50c191cmwi\nOiJodHRwczovL2FwaS5naXRodWIuY29tL3VzZXJzL0xpenpIYWxlL3JlY2Vp\ndmVkX2V2ZW50cyIsInR5cGUiOiJVc2VyIiwic2l0ZV9hZG1pbiI6dHJ1ZX19\n"},"http_version":null},"recorded_at":"Sat, 19 Nov 2016 01:16:21 GMT"},{"request":{"method":"delete","uri":"https://api.github.com/repos//an-repo","body":{"encoding":"UTF-8","base64_string":"e30=\n"},"headers":{"Accept":["application/vnd.github.v3+json"],"User-Agent":["Octokit Ruby Gem 4.6.0"],"Content-Type":["application/json"],"Authorization":["token <>"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"]}},"response":{"status":{"code":204,"message":"No Content"},"headers":{"Server":["GitHub.com"],"Date":["Sat, 19 Nov 2016 01:16:21 GMT"],"Status":["204 No Content"],"X-Ratelimit-Limit":["5000"],"X-Ratelimit-Remaining":["4531"],"X-Ratelimit-Reset":["1479519258"],"X-Oauth-Scopes":["admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user"],"X-Accepted-Oauth-Scopes":["delete_repo"],"X-Github-Media-Type":["github.v3; format=json"],"Access-Control-Expose-Headers":["ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval"],"Access-Control-Allow-Origin":["*"],"Content-Security-Policy":["default-src 'none'"],"Strict-Transport-Security":["max-age=31536000; includeSubdomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Frame-Options":["deny"],"X-Xss-Protection":["1; mode=block"],"Vary":["Accept-Encoding"],"X-Served-By":["2c18a09f3ac5e4dd1e004af7c5a94769"],"X-Github-Request-Id":["32B88C12:14AE7:C757D87:582FA7E5"]},"body":{"encoding":"UTF-8","base64_string":""},"http_version":null},"recorded_at":"Sat, 19 Nov 2016 01:16:21 GMT"}],"recorded_with":"VCR 2.9.3"} \ No newline at end of file diff --git a/spec/octokit/client/organizations_spec.rb b/spec/octokit/client/organizations_spec.rb index bd439cbfe..53f775509 100644 --- a/spec/octokit/client/organizations_spec.rb +++ b/spec/octokit/client/organizations_spec.rb @@ -84,6 +84,36 @@ end end # .organization_public_member? + describe ".organization_invitations", :vcr do + it "lists pending organization invitations" do + @client.organization_invitations(test_github_org, :accept => 'application/vnd.github.korra-preview+json') + assert_requested :get, github_url("/orgs/#{test_github_org}/invitations") + end + end # .organization_invitations + + describe ".outside_collaborators", :vcr do + it "lists outside collaborators for an organization" do + @client.outside_collaborators(test_github_org, :accept => 'application/vnd.github.korra-preview+json') + assert_requested :get, github_url("/orgs/#{test_github_org}/outside_collaborators") + end + end # .outside_collaborators + + describe ".remove_outside_collaborator", :vcr do + it "removes the outside collaborator from an organization" do + stub_delete github_url("/orgs/#{test_github_org}/outside_collaborators/lizzhale") + @client.remove_outside_collaborator(test_github_org, 'lizzhale', :accept => 'application/vnd.github.korra-preview+json') + assert_requested :delete, github_url("/orgs/#{test_github_org}/outside_collaborators/lizzhale") + end + end # .remove_outside_collaborator + + describe ".convert_to_outside_collaborator", :vcr do + it "converts an organization member to an outside collaborator" do + stub_put github_url("orgs/#{test_github_org}/outside_collaborators/lizzhale") + @client.convert_to_outside_collaborator(test_github_org, 'lizzhale', :accept => 'application/vnd.github.korra-preview+json') + assert_requested :put, github_url("orgs/#{test_github_org}/outside_collaborators/lizzhale") + end + end # .convert_to_outside_collaborator + describe ".organization_teams", :vcr do it "returns all teams for an organization" do teams = @client.organization_teams(test_github_org) @@ -153,6 +183,13 @@ end end # .team_member? + describe ".team_invitations", :vcr do + it "lists pending team invitations" do + @client.team_invitations(@team.id, :accept => 'application/vnd.github.korra-preview+json') + assert_requested :get, github_url("/teams/#{@team.id}/invitations") + end + end # .team_invitations + describe ".team_repositories", :vcr do it "returns team repositories" do repositories = @client.team_repositories(@team.id) diff --git a/spec/octokit/client/repositories_spec.rb b/spec/octokit/client/repositories_spec.rb index 5d57eb539..ca9a54828 100644 --- a/spec/octokit/client/repositories_spec.rb +++ b/spec/octokit/client/repositories_spec.rb @@ -346,6 +346,13 @@ end end + describe ".permission_level", :vcr do + it "returns the permission level a user has on a repository" do + @client.permission_level(@repo.full_name, "lizzhale", :accept => 'application/vnd.github.korra-preview+json') + assert_requested :get, github_url("/repos/#{@repo.full_name}/collaborators/lizzhale/permission") + end + end # .permission_level + describe ".protect_branch", :vcr do it "protects a single branch" do branch = @client.protect_branch(@repo.full_name, "master")