octokit 4.21.0 → 4.22.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/lib/octokit/client/commits.rb +6 -1
- data/lib/octokit/client/organizations.rb +6 -6
- data/lib/octokit/client/pub_sub_hubbub.rb +2 -2
- data/lib/octokit/client/refs.rb +1 -1
- data/lib/octokit/client.rb +3 -3
- data/lib/octokit/connection.rb +5 -5
- data/lib/octokit/middleware/follow_redirects.rb +4 -1
- data/lib/octokit/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 072c9ec7fa2439cc75655ff5c925efeedc19fe386eae30a30be712524802b3ad
|
4
|
+
data.tar.gz: 177806faf28428ecd942d0159c268cae122e2ec7a88d4bc3e0b34e41a2b3409c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a087ec2c360f33db0cd6526ba76ae8762d57885a24577d36ada1baf1cf3019e93beeaa70455bb6cf08f64d9328e84112043d202526b42e94f8cb1bfb96faada
|
7
|
+
data.tar.gz: 8425341fe9135936b066de860c2722ad77b8a3c3ce2d8fe478a5420a3c911fc56a419ce4808a290f55199074bab94953500d3cdbc7345f9d9137d66cccb9de39
|
data/README.md
CHANGED
@@ -584,7 +584,9 @@ stack = Faraday::RackBuilder.new do |builder|
|
|
584
584
|
builder.use Octokit::Middleware::FollowRedirects
|
585
585
|
builder.use Octokit::Response::RaiseError
|
586
586
|
builder.use Octokit::Response::FeedParser
|
587
|
-
builder.response :logger
|
587
|
+
builder.response :logger do |logger|
|
588
|
+
logger.filter(/(Authorization: "(token|Bearer) )(\w+)/, '\1[REMOVED]')
|
589
|
+
end
|
588
590
|
builder.adapter Faraday.default_adapter
|
589
591
|
end
|
590
592
|
Octokit.middleware = stack
|
@@ -189,13 +189,18 @@ module Octokit
|
|
189
189
|
|
190
190
|
# Compare two commits
|
191
191
|
#
|
192
|
+
# When using auto_pagination, commits from all pages will be concatenated
|
193
|
+
# into the <tt>commits</tt> attribute of the first page's response.
|
194
|
+
#
|
192
195
|
# @param repo [Integer, String, Hash, Repository] A GitHub repository
|
193
196
|
# @param start [String] The sha of the starting commit
|
194
197
|
# @param endd [String] The sha of the ending commit
|
195
198
|
# @return [Sawyer::Resource] A hash representing the comparison
|
196
199
|
# @see https://developer.github.com/v3/repos/commits/#compare-two-commits
|
197
200
|
def compare(repo, start, endd, options = {})
|
198
|
-
|
201
|
+
paginate "#{Repository.path repo}/compare/#{start}...#{endd}", options do |data, last_response|
|
202
|
+
data.commits.concat last_response.data.commits
|
203
|
+
end
|
199
204
|
end
|
200
205
|
|
201
206
|
# Merge a branch or sha
|
@@ -731,7 +731,7 @@ module Octokit
|
|
731
731
|
# @return [Sawyer::Resource] Hash representing the new migration.
|
732
732
|
# @example
|
733
733
|
# @client.start_migration('github', ['github/dotfiles'])
|
734
|
-
# @see https://
|
734
|
+
# @see https://docs.github.com/en/rest/reference/migrations#start-an-organization-migration
|
735
735
|
def start_migration(org, repositories, options = {})
|
736
736
|
options = ensure_api_media_type(:migrations, options)
|
737
737
|
options[:repositories] = repositories
|
@@ -744,7 +744,7 @@ module Octokit
|
|
744
744
|
#
|
745
745
|
# @param org [String, Integer] Organization GitHub login or id.
|
746
746
|
# @return [Array<Sawyer::Resource>] Array of migration resources.
|
747
|
-
# @see https://
|
747
|
+
# @see https://docs.github.com/en/rest/reference/migrations#list-organization-migrations
|
748
748
|
def migrations(org, options = {})
|
749
749
|
options = ensure_api_media_type(:migrations, options)
|
750
750
|
paginate "#{Organization.path(org)}/migrations", options
|
@@ -756,7 +756,7 @@ module Octokit
|
|
756
756
|
#
|
757
757
|
# @param org [String, Integer] Organization GitHub login or id.
|
758
758
|
# @param id [Integer] ID number of the migration.
|
759
|
-
# @see https://
|
759
|
+
# @see https://docs.github.com/en/rest/reference/migrations#get-an-organization-migration-status
|
760
760
|
def migration_status(org, id, options = {})
|
761
761
|
options = ensure_api_media_type(:migrations, options)
|
762
762
|
get "#{Organization.path(org)}/migrations/#{id}", options
|
@@ -768,7 +768,7 @@ module Octokit
|
|
768
768
|
#
|
769
769
|
# @param org [String, Integer] Organization GitHub login or id.
|
770
770
|
# @param id [Integer] ID number of the migration.
|
771
|
-
# @see https://
|
771
|
+
# @see https://docs.github.com/en/rest/reference/migrations#download-an-organization-migration-archive
|
772
772
|
def migration_archive_url(org, id, options = {})
|
773
773
|
options = ensure_api_media_type(:migrations, options)
|
774
774
|
url = "#{Organization.path(org)}/migrations/#{id}/archive"
|
@@ -783,7 +783,7 @@ module Octokit
|
|
783
783
|
#
|
784
784
|
# @param org [String, Integer] Organization GitHub login or id.
|
785
785
|
# @param id [Integer] ID number of the migration.
|
786
|
-
# @see https://
|
786
|
+
# @see https://docs.github.com/en/rest/reference/migrations#delete-an-organization-migration-archive
|
787
787
|
def delete_migration_archive(org, id, options = {})
|
788
788
|
options = ensure_api_media_type(:migrations, options)
|
789
789
|
delete "#{Organization.path(org)}/migrations/#{id}/archive", options
|
@@ -796,7 +796,7 @@ module Octokit
|
|
796
796
|
# @param org [String, Integer] Organization GitHub login or id.
|
797
797
|
# @param id [Integer] ID number of the migration.
|
798
798
|
# @param repo [String] Name of the repository.
|
799
|
-
# @see https://
|
799
|
+
# @see https://docs.github.com/en/rest/reference/migrations#unlock-an-organization-repository
|
800
800
|
def unlock_repository(org, id, repo, options = {})
|
801
801
|
options = ensure_api_media_type(:migrations, options)
|
802
802
|
delete "#{Organization.path(org)}/migrations/#{id}/repos/#{repo}/lock", options
|
@@ -91,9 +91,9 @@ module Octokit
|
|
91
91
|
conn = Faraday.new(:url => @api_endpoint) do |http|
|
92
92
|
http.headers[:user_agent] = user_agent
|
93
93
|
if basic_authenticated?
|
94
|
-
http.basic_auth
|
94
|
+
http.request :basic_auth, @login, @password
|
95
95
|
elsif token_authenticated?
|
96
|
-
http.authorization 'token', @access_token
|
96
|
+
http.request :authorization, 'token', @access_token
|
97
97
|
end
|
98
98
|
http.request :url_encoded
|
99
99
|
http.use Octokit::Response::RaiseError
|
data/lib/octokit/client/refs.rb
CHANGED
@@ -58,7 +58,7 @@ module Octokit
|
|
58
58
|
# @example Create refs/heads/master for octocat/Hello-World with sha 827efc6d56897b048c772eb4087f854f46256132
|
59
59
|
# Octokit.create_ref("octocat/Hello-World", "heads/master", "827efc6d56897b048c772eb4087f854f46256132")
|
60
60
|
def create_ref(repo, ref, sha, options = {})
|
61
|
-
ref = "refs/#{ref}" unless ref =~ %r{
|
61
|
+
ref = "refs/#{ref}" unless ref =~ %r{\Arefs/}
|
62
62
|
parameters = {
|
63
63
|
:ref => ref,
|
64
64
|
:sha => sha
|
data/lib/octokit/client.rb
CHANGED
@@ -238,11 +238,11 @@ module Octokit
|
|
238
238
|
conn_opts[:ssl] = { :verify_mode => @ssl_verify_mode } if @ssl_verify_mode
|
239
239
|
conn = Faraday.new(conn_opts) do |http|
|
240
240
|
if basic_authenticated?
|
241
|
-
http.basic_auth
|
241
|
+
http.request :basic_auth, @login, @password
|
242
242
|
elsif token_authenticated?
|
243
|
-
http.authorization 'token', @access_token
|
243
|
+
http.request :authorization, 'token', @access_token
|
244
244
|
elsif bearer_authenticated?
|
245
|
-
http.authorization 'Bearer', @bearer_token
|
245
|
+
http.request :authorization, 'Bearer', @bearer_token
|
246
246
|
end
|
247
247
|
http.headers['accept'] = options[:accept] if options.key?(:accept)
|
248
248
|
end
|
data/lib/octokit/connection.rb
CHANGED
@@ -107,13 +107,13 @@ module Octokit
|
|
107
107
|
http.headers[:content_type] = "application/json"
|
108
108
|
http.headers[:user_agent] = user_agent
|
109
109
|
if basic_authenticated?
|
110
|
-
http.basic_auth
|
110
|
+
http.request :basic_auth, @login, @password
|
111
111
|
elsif token_authenticated?
|
112
|
-
http.authorization 'token', @access_token
|
112
|
+
http.request :authorization, 'token', @access_token
|
113
113
|
elsif bearer_authenticated?
|
114
|
-
http.authorization 'Bearer', @bearer_token
|
114
|
+
http.request :authorization, 'Bearer', @bearer_token
|
115
115
|
elsif application_authenticated?
|
116
|
-
http.basic_auth
|
116
|
+
http.request :basic_auth, @client_id, @client_secret
|
117
117
|
end
|
118
118
|
end
|
119
119
|
end
|
@@ -176,7 +176,7 @@ module Octokit
|
|
176
176
|
:links_parser => Sawyer::LinkParsers::Simple.new
|
177
177
|
}
|
178
178
|
conn_opts = @connection_options
|
179
|
-
conn_opts[:builder] = @middleware if @middleware
|
179
|
+
conn_opts[:builder] = @middleware.dup if @middleware
|
180
180
|
conn_opts[:proxy] = @proxy if @proxy
|
181
181
|
if conn_opts[:ssl].nil?
|
182
182
|
conn_opts[:ssl] = { :verify_mode => @ssl_verify_mode } if @ssl_verify_mode
|
@@ -86,7 +86,10 @@ module Octokit
|
|
86
86
|
original_url = env[:url]
|
87
87
|
env[:url] += safe_escape(response["location"])
|
88
88
|
unless same_host?(original_url, env[:url])
|
89
|
-
|
89
|
+
# HACK: Faraday’s Authorization middlewares don’t touch the request if the `Authorization` header is set.
|
90
|
+
# This is a workaround to drop authentication info.
|
91
|
+
# See https://github.com/octokit/octokit.rb/pull/1359#issuecomment-925609697
|
92
|
+
env[:request_headers]["Authorization"] = "dummy"
|
90
93
|
end
|
91
94
|
|
92
95
|
if convert_to_get?(response)
|
data/lib/octokit/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octokit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.22.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wynn Netherland
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2022-01-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -180,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
180
|
- !ruby/object:Gem::Version
|
181
181
|
version: 1.3.5
|
182
182
|
requirements: []
|
183
|
-
rubygems_version: 3.
|
183
|
+
rubygems_version: 3.1.2
|
184
184
|
signing_key:
|
185
185
|
specification_version: 4
|
186
186
|
summary: Ruby toolkit for working with the GitHub API
|