dependabot-docker 0.244.0 → 0.245.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c52ccd7109a9ba52a4721caab52dee265b8fbac58b014ef41f1764254d5b4ba6
4
- data.tar.gz: a1c7eacd01a34f18f018dc6e2f35b3709986bf32d304c22bf0325a31dafd9791
3
+ metadata.gz: 5e61c3b2e56f46e7c5f485f82de3aa732aa43acc26a101e5777cb0d225e51918
4
+ data.tar.gz: acbd873e9991535a7f767059e71600f4258e8622a7c6895bd94e969a6885d7ed
5
5
  SHA512:
6
- metadata.gz: 644b13f04cafb8cde3fafc549221b48acd25a536f9605a7762affa9ba6ce53c50f0151cc0aa1bb5293d4913ecc66dd074641179a4199bf60d45d45c605beeab8
7
- data.tar.gz: '0085584c58c0162fa0532362f6bcf9d0d0e076a11e4fee1c8c28422a7bad80fa363b006d3498f7f83d226c75e7238530a6be3db2e0ca0eee48b8366def1750db'
6
+ metadata.gz: 1a24c6f7cbeb5866d100b79782e85b61d8dfa6f4ddcec6989159061c7adf3ba869ba7dc4075ed6be720353a5cf2ef2f39038e95ea74e03a9ac3a05de828c3cc9
7
+ data.tar.gz: 32993a7f315727817fb7dbd9b7daea17cdbc7f347437382c5e16b2f6cdb8d7147cfcf826bcbbb1564ea676ec01c95d2ac14b32a7cc6b5e89564496a07d8339a7
@@ -4,12 +4,15 @@
4
4
  require "aws-sdk-ecr"
5
5
  require "base64"
6
6
 
7
+ require "dependabot/credential"
7
8
  require "dependabot/errors"
8
9
 
9
10
  module Dependabot
10
11
  module Docker
11
12
  module Utils
12
13
  class CredentialsFinder
14
+ extend T::Sig
15
+
13
16
  AWS_ECR_URL = /dkr\.ecr\.(?<region>[^.]+)\.amazonaws\.com/
14
17
  DEFAULT_DOCKER_HUB_REGISTRY = "registry.hub.docker.com"
15
18
 
@@ -17,6 +20,7 @@ module Dependabot
17
20
  @credentials = credentials
18
21
  end
19
22
 
23
+ sig { params(registry_hostname: String).returns(T.nilable(Dependabot::Credential)) }
20
24
  def credentials_for_registry(registry_hostname)
21
25
  registry_details =
22
26
  credentials
@@ -42,8 +46,10 @@ module Dependabot
42
46
 
43
47
  private
44
48
 
49
+ sig { returns(T::Array[Dependabot::Credential]) }
45
50
  attr_reader :credentials
46
51
 
52
+ sig { params(registry_details: Dependabot::Credential).returns(Dependabot::Credential) }
47
53
  def build_aws_credentials(registry_details)
48
54
  # If credentials have been generated from AWS we can just return them
49
55
  return registry_details if registry_details["username"] == "AWS"
@@ -75,7 +81,7 @@ module Dependabot
75
81
  ecr_client.get_authorization_token.authorization_data.first.authorization_token
76
82
  username, password =
77
83
  Base64.decode64(@authorization_tokens[registry_hostname]).split(":")
78
- registry_details.merge("username" => username, "password" => password)
84
+ registry_details.merge(Dependabot::Credential.new({ "username" => username, "password" => password }))
79
85
  rescue Aws::Errors::MissingCredentialsError,
80
86
  Aws::ECR::Errors::UnrecognizedClientException,
81
87
  Aws::ECR::Errors::InvalidSignatureException
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-docker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.244.0
4
+ version: 0.245.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-15 00:00:00.000000000 Z
11
+ date: 2024-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dependabot-common
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.244.0
19
+ version: 0.245.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.244.0
26
+ version: 0.245.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -244,7 +244,7 @@ licenses:
244
244
  - Nonstandard
245
245
  metadata:
246
246
  bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
247
- changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.244.0
247
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.245.0
248
248
  post_install_message:
249
249
  rdoc_options: []
250
250
  require_paths: