dependabot-hex 0.367.0 → 0.368.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d496793073bfe45c28f11a88096553dcd32d74027b3fb8303a013d3ffe574b7e
4
- data.tar.gz: cd2f09b2377fd0bddfc01290edbbd23c58e0deafba2fadaa53ad8d79aa0ba57c
3
+ metadata.gz: fef15c4c0ef2af7e208cd26ad8e43bab2e0e685af628c119bd4c8dc619dc1191
4
+ data.tar.gz: 05a29f5880ac5109faf59287e70e13e31ca14ddf60ee6a7f63566ec9b9d605b1
5
5
  SHA512:
6
- metadata.gz: d5caf9181ccdc354fa365217bcf07eb50518e943bd5e07ab5a554b3f99ba0f75e8de57f4b76b9032ea511a167f4ef69e95c393f47353a0265c2fb5e43f9e29f4
7
- data.tar.gz: 6ac2e8ab8594c8d200e75bd44bd07534f9e8c08d4e5c8ac9879956eaaaef71675c7720b766f1a0399e1fc49be094addd9e541bde22190d081718493a4121d9d9
6
+ metadata.gz: fa878ff298775c6ce1f425fc706a02758e9b752f0d608ae1e52db3a133635e8e15433b824858d2d55442dba67828efc259b3f4d4cef0026c4e56b9b2b0bbd67b
7
+ data.tar.gz: 294dc65e3324b6050f6eaf1370e209e5e36365129106bdf87742545d09a53ea5d419da22a2d9a1bcd133dec46d27e0c4aa5a8439e5b795942c3efdbc594d2bda
data/helpers/lib/run.exs CHANGED
@@ -123,10 +123,17 @@ defmodule DependencyHelper do
123
123
  defp fetch_public_key(repo, repo_url, auth_key, fingerprint) do
124
124
  case Hex.Repo.get_public_key(%{trusted: true, url: repo_url, auth_key: auth_key}) do
125
125
  {:ok, {200, _headers, key}} ->
126
- if public_key_matches?(key, fingerprint) do
127
- {:ok, key}
128
- else
129
- {:error, "Public key fingerprint mismatch for repo \"#{repo}\""}
126
+ try do
127
+ if public_key_matches?(key, fingerprint) do
128
+ {:ok, key}
129
+ else
130
+ {:error, "Public key fingerprint mismatch for repo \"#{repo}\""}
131
+ end
132
+ rescue
133
+ e in FunctionClauseError ->
134
+ {:error,
135
+ "Failed to decode public key for repo \"#{repo}\": " <>
136
+ "#{Exception.message(e)} (#{inspect(e.__struct__)})"}
130
137
  end
131
138
 
132
139
  {:ok, {code, _headers, _body}} ->
@@ -86,7 +86,7 @@ module Dependabot
86
86
  match = error.message.match(/No authenticated organization found for (?<repo>[a-z_]+)\./)
87
87
  match ||= error.message.match(/Public key fingerprint mismatch for repo "(?<repo>[a-z_]+)"/)
88
88
  match ||= error.message.match(/Missing credentials for "(?<repo>[a-z_]+)"/)
89
- match ||= error.message.match(/Downloading public key for repo "(?<repo>[a-z_]+)"/)
89
+ match ||= error.message.match(/(?:Downloading|Failed to decode) public key for repo "(?<repo>[a-z_]+)"/)
90
90
  match ||= error.message.match(/Failed to fetch record for (?<repo>[a-z_]+)(?::(?<org>[a-z_]+))?/)
91
91
 
92
92
  if match
@@ -109,6 +109,10 @@ module Dependabot
109
109
  raise Dependabot::PrivateSourceAuthenticationFailure, match[:repo]
110
110
  end
111
111
 
112
+ if (match = error.message.match(/Failed to decode public key for repo "(?<repo>[a-z_]+)"/))
113
+ raise Dependabot::PrivateSourceAuthenticationFailure, match[:repo]
114
+ end
115
+
112
116
  if (match = error.message.match(/Failed to fetch record for (?<repo>[a-z_]+)(?::(?<org>[a-z_]+))?/))
113
117
  name = match[:org] || match[:repo]
114
118
  raise Dependabot::PrivateSourceAuthenticationFailure, name
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-hex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.367.0
4
+ version: 0.368.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 0.367.0
18
+ version: 0.368.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - '='
24
24
  - !ruby/object:Gem::Version
25
- version: 0.367.0
25
+ version: 0.368.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: debug
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -274,7 +274,7 @@ licenses:
274
274
  - MIT
275
275
  metadata:
276
276
  bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
277
- changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.367.0
277
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.368.0
278
278
  rdoc_options: []
279
279
  require_paths:
280
280
  - lib