dependabot-common 0.120.1 → 0.120.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of dependabot-common might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/dependabot/clients/azure.rb +10 -8
- data/lib/dependabot/git_metadata_fetcher.rb +1 -1
- data/lib/dependabot/shared_helpers.rb +16 -3
- data/lib/dependabot/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83263fa7e5a3d1dbd38624d9476cab98b226ef442af42cd6e9324dcb61226476
|
4
|
+
data.tar.gz: a47175b2fb55cb804e95a1f438f21de893f73b3921b319bcb296e3ff7f0397da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c04da188b4d2914b86db40c0640074d45010ce6f0834117b3b6b9faf6371893af47bafd643b4d905a5db2f853c21e3c6cc8c40df38659b93281299820fb6b812
|
7
|
+
data.tar.gz: f6e8639ddfc7ffdd50926c3f32e1087076f3e66ad915eb074663669537b37b993df346dda6fc35144e0fd02aedba423b609e5d6eb596d35ecc67cace0c2c12f7
|
@@ -184,11 +184,12 @@ module Dependabot
|
|
184
184
|
def get(url)
|
185
185
|
response = Excon.get(
|
186
186
|
url,
|
187
|
-
headers: auth_header,
|
188
187
|
user: credentials&.fetch("username", nil),
|
189
188
|
password: credentials&.fetch("password", nil),
|
190
189
|
idempotent: true,
|
191
|
-
**SharedHelpers.excon_defaults
|
190
|
+
**SharedHelpers.excon_defaults(
|
191
|
+
headers: auth_header
|
192
|
+
)
|
192
193
|
)
|
193
194
|
raise NotFound if response.status == 404
|
194
195
|
|
@@ -198,16 +199,17 @@ module Dependabot
|
|
198
199
|
def post(url, json)
|
199
200
|
response = Excon.post(
|
200
201
|
url,
|
201
|
-
headers: auth_header.merge(
|
202
|
-
{
|
203
|
-
"Content-Type" => "application/json"
|
204
|
-
}
|
205
|
-
),
|
206
202
|
body: json,
|
207
203
|
user: credentials&.fetch("username", nil),
|
208
204
|
password: credentials&.fetch("password", nil),
|
209
205
|
idempotent: true,
|
210
|
-
**SharedHelpers.excon_defaults
|
206
|
+
**SharedHelpers.excon_defaults(
|
207
|
+
headers: auth_header.merge(
|
208
|
+
{
|
209
|
+
"Content-Type" => "application/json"
|
210
|
+
}
|
211
|
+
)
|
212
|
+
)
|
211
213
|
)
|
212
214
|
raise NotFound if response.status == 404
|
213
215
|
|
@@ -13,6 +13,10 @@ module Dependabot
|
|
13
13
|
BUMP_TMP_FILE_PREFIX = "dependabot_"
|
14
14
|
BUMP_TMP_DIR_PATH = "tmp"
|
15
15
|
GIT_CONFIG_GLOBAL_PATH = File.expand_path("~/.gitconfig")
|
16
|
+
USER_AGENT = "dependabot-core/#{Dependabot::VERSION} "\
|
17
|
+
"#{Excon::USER_AGENT} ruby/#{RUBY_VERSION} "\
|
18
|
+
"(#{RUBY_PLATFORM}) "\
|
19
|
+
"(+https://github.com/dependabot/dependabot-core)"
|
16
20
|
|
17
21
|
class ChildProcessFailed < StandardError
|
18
22
|
attr_reader :error_class, :error_message, :error_backtrace
|
@@ -138,14 +142,23 @@ module Dependabot
|
|
138
142
|
[Excon::Middleware::RedirectFollower]
|
139
143
|
end
|
140
144
|
|
141
|
-
def self.
|
145
|
+
def self.excon_headers(headers = nil)
|
146
|
+
headers ||= {}
|
147
|
+
{
|
148
|
+
"User-Agent" => USER_AGENT
|
149
|
+
}.merge(headers)
|
150
|
+
end
|
151
|
+
|
152
|
+
def self.excon_defaults(options = nil)
|
153
|
+
options ||= {}
|
142
154
|
{
|
143
155
|
connect_timeout: 5,
|
144
156
|
write_timeout: 5,
|
145
157
|
read_timeout: 20,
|
146
158
|
omit_default_port: true,
|
147
|
-
middlewares: excon_middleware
|
148
|
-
|
159
|
+
middlewares: excon_middleware,
|
160
|
+
headers: excon_headers(options[:headers])
|
161
|
+
}.merge(options)
|
149
162
|
end
|
150
163
|
|
151
164
|
def self.with_git_configured(credentials:)
|
data/lib/dependabot/version.rb
CHANGED