rubygems-credential_store-backends-codeartifact 0.1.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 +7 -0
- data/CHANGELOG.md +5 -0
- data/LICENSE.txt +21 -0
- data/README.md +100 -0
- data/Rakefile +13 -0
- data/lib/rubygems/credential_store/backends/codeartifact/backend.rb +74 -0
- data/lib/rubygems/credential_store/backends/codeartifact/config.rb +70 -0
- data/lib/rubygems/credential_store/backends/codeartifact/endpoint.rb +55 -0
- data/lib/rubygems/credential_store/backends/codeartifact/error.rb +11 -0
- data/lib/rubygems/credential_store/backends/codeartifact/token_fetcher.rb +55 -0
- data/lib/rubygems/credential_store/backends/codeartifact/version.rb +11 -0
- data/lib/rubygems/credential_store/backends/codeartifact.rb +7 -0
- data/release/Gemfile +9 -0
- data/release/Gemfile.lock +62 -0
- metadata +59 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 742d3a3721b4b8f9c38653e20839da8c61e562bd67af26ff027b9d71404a99e4
|
|
4
|
+
data.tar.gz: 3ad2dfe77161a007fb9071df8a1101d50b0e52ebaf1ae1e64a7bd9edda685477
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: cf4b3a8dda175ddb7413107ae09f9589c79beceae58b952de3f040218027a747222f31f32f1ebb9cc54b4691c3bbf8eed58370f9d266104ed845434fd08b68b9
|
|
7
|
+
data.tar.gz: 2beee81a4a86bbc876502e0030092e8be5b28990d90d4c8ae7942008df837a6321845562034eadbfed0f950479df118d1a5deb0e6cdd036f66a54757bef78971
|
data/CHANGELOG.md
ADDED
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Takuma Ishikawa
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# rubygems-credential_store-backends-codeartifact
|
|
2
|
+
|
|
3
|
+
A [credential store](https://github.com/ruby/rubygems/pull/9671) backend for RubyGems and Bundler that gets [AWS CodeArtifact](https://docs.aws.amazon.com/codeartifact/latest/ug/using-ruby.html) authorization tokens on demand.
|
|
4
|
+
|
|
5
|
+
Instead of preparing a CodeArtifact token yourself, the backend runs `aws codeartifact get-authorization-token` whenever RubyGems or Bundler needs a credential for a CodeArtifact repository. Tokens are never written anywhere. They live only in the memory of the process that asked for them.
|
|
6
|
+
|
|
7
|
+
## Requirements
|
|
8
|
+
|
|
9
|
+
- RubyGems 4.1.0 or later
|
|
10
|
+
- [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
gem install rubygems-credential_store-backends-codeartifact
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
### Bundler
|
|
21
|
+
|
|
22
|
+
Select the backend for the CodeArtifact host only, so that other hosts keep using whatever store they use now:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
bundle config set --global credential_store.my-domain-111122223333.d.codeartifact.us-east-1.amazonaws.com codeartifact
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
You might also need to enable the credential store:
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
bundle config set credential_store true
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Then use the repository as a source in the Gemfile:
|
|
35
|
+
|
|
36
|
+
```ruby
|
|
37
|
+
source "https://my-domain-111122223333.d.codeartifact.us-east-1.amazonaws.com/my_domain/ruby/" do
|
|
38
|
+
gem "example"
|
|
39
|
+
end
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### gem push
|
|
43
|
+
|
|
44
|
+
Select the backend in `~/.gemrc`, or for a single command with `RUBYGEMS_CREDENTIAL_STORE`:
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
RUBYGEMS_CREDENTIAL_STORE=codeartifact gem push --host https://my-domain-111122223333.d.codeartifact.us-east-1.amazonaws.com/my_domain/ruby my_gem-0.1.0.gem
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Configuration
|
|
51
|
+
|
|
52
|
+
You can switch AWS profile per CodeArtifact domain. By default the AWS CLI picks the profile as usual (`AWS_PROFILE`, then the `default` profile and the rest of its credential chain). To use a specific profile, create `$XDG_CONFIG_HOME/rubygems-credential_store-backends-codeartifact/config.yml` (or `~/.config/...` when `XDG_CONFIG_HOME` is unset):
|
|
53
|
+
|
|
54
|
+
```yaml
|
|
55
|
+
profile: dev-sso # Default profile; used for every domain without its own entry
|
|
56
|
+
domains:
|
|
57
|
+
"arn:aws:codeartifact:us-east-1:111122223333:domain/my-domain":
|
|
58
|
+
profile: shared-artifacts
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The profile is chosen in this order:
|
|
62
|
+
|
|
63
|
+
1. The entry for the domain under `domains`
|
|
64
|
+
2. The top-level `profile`
|
|
65
|
+
3. None, leaving the choice to the AWS CLI
|
|
66
|
+
|
|
67
|
+
The configuration belongs to the user rather than to a project, because AWS profile names are personal.
|
|
68
|
+
|
|
69
|
+
## Limitations
|
|
70
|
+
|
|
71
|
+
The backend does not work while Bundler installs gems into a custom path, such as with `bundle config set path vendor/bundle` or `BUNDLE_PATH`. In that case Bundler hides the system gems, including this one, so it warns that the `codeartifact` backend is not installed and falls back to the credentials in its config files.
|
|
72
|
+
|
|
73
|
+
## Alternatives
|
|
74
|
+
|
|
75
|
+
Even without using this credential store, you can write and use a wrapper command that stores CodeArtifact credentials in environment variables.
|
|
76
|
+
|
|
77
|
+
For example, you can write the following script as `auth-codeartifact-ruby` and use it like `auth-codeartifact-ruby bundle install`.
|
|
78
|
+
|
|
79
|
+
```sh
|
|
80
|
+
#!/bin/bash
|
|
81
|
+
set -eu
|
|
82
|
+
|
|
83
|
+
token=$(aws codeartifact get-authorization-token --region us-east-1 --domain ruby --query authorizationToken --output text)
|
|
84
|
+
export BUNDLE_RUBY___111122223333__D__CODEARTIFACT__US___EAST___1__AMAZONAWS__COM="aws:$token"
|
|
85
|
+
exec "$@"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
When using a credential store, there is a difference in that you no longer have to think about whether a wrapper command is necessary every time. On the other hand, it also has the downside of making it harder to track where permissions were used.
|
|
89
|
+
|
|
90
|
+
## Development
|
|
91
|
+
|
|
92
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rake spec` to run the tests.
|
|
93
|
+
|
|
94
|
+
## Contributing
|
|
95
|
+
|
|
96
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/nekketsuuu/rubygems-credential_store-backends-codeartifact.
|
|
97
|
+
|
|
98
|
+
## License
|
|
99
|
+
|
|
100
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'bundler/gem_tasks'
|
|
4
|
+
|
|
5
|
+
unless ENV['RELEASE_TASKS_ONLY']
|
|
6
|
+
require 'rspec/core/rake_task'
|
|
7
|
+
RSpec::Core::RakeTask.new(:spec)
|
|
8
|
+
|
|
9
|
+
require 'rubocop/rake_task'
|
|
10
|
+
RuboCop::RakeTask.new
|
|
11
|
+
|
|
12
|
+
task default: %i[spec rubocop]
|
|
13
|
+
end
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'config'
|
|
4
|
+
require_relative 'endpoint'
|
|
5
|
+
require_relative 'token_fetcher'
|
|
6
|
+
|
|
7
|
+
module Rubygems
|
|
8
|
+
module CredentialStore
|
|
9
|
+
module Backends
|
|
10
|
+
module CodeArtifact
|
|
11
|
+
# The Gem::CredentialStore backend that answers CodeArtifact hosts with a freshly fetched token.
|
|
12
|
+
class Backend
|
|
13
|
+
SECRET_FORMATS = {
|
|
14
|
+
'bundler' => 'aws:%s',
|
|
15
|
+
'rubygems' => 'Bearer %s'
|
|
16
|
+
}.freeze
|
|
17
|
+
|
|
18
|
+
USAGE_HINTS = {
|
|
19
|
+
'bundler' => 'The codeartifact credential store backend only handles CodeArtifact hosts. ' \
|
|
20
|
+
'Select it per host with `bundle config set credential_store.<host> codeartifact` ' \
|
|
21
|
+
'so that other hosts can keep using another credential store.',
|
|
22
|
+
'rubygems' => 'The codeartifact credential store backend only handles CodeArtifact hosts. ' \
|
|
23
|
+
'Select it only when pushing to CodeArtifact, ' \
|
|
24
|
+
'for example with RUBYGEMS_CREDENTIAL_STORE=codeartifact gem push.'
|
|
25
|
+
}.freeze
|
|
26
|
+
|
|
27
|
+
def initialize(config_loader: -> { Config.load }, fetcher: TokenFetcher.new)
|
|
28
|
+
@config_loader = config_loader
|
|
29
|
+
@fetcher = fetcher
|
|
30
|
+
@tokens = {}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def get(service, account)
|
|
34
|
+
endpoint = Endpoint.from_account(service, account)
|
|
35
|
+
return nil unless endpoint
|
|
36
|
+
|
|
37
|
+
format(SECRET_FORMATS.fetch(service), token_for(endpoint))
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# rubocop:disable-next Naming/PredicateMethod -- To match the Gem::CredentialStore backend interface
|
|
41
|
+
def set(service, account, _secret)
|
|
42
|
+
unless Endpoint.from_account(service, account)
|
|
43
|
+
Gem::CredentialStore.warn_once(USAGE_HINTS[service]) if USAGE_HINTS.key?(service)
|
|
44
|
+
return false
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Returning false would make Bundler write the given token to its config file in plain text.
|
|
48
|
+
Gem::CredentialStore.warn_once 'The codeartifact credential store backend gets a CodeArtifact ' \
|
|
49
|
+
'authorization token on demand, so the given credential was not stored.'
|
|
50
|
+
true
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# rubocop:disable-next Naming/PredicateMethod -- To match the Gem::CredentialStore backend interface
|
|
54
|
+
def delete(_service, _account)
|
|
55
|
+
true
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# rubocop:disable-next Naming/PredicateMethod -- To match the Gem::CredentialStore backend interface
|
|
59
|
+
def delete_all(_service)
|
|
60
|
+
true
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
private def token_for(endpoint)
|
|
64
|
+
@tokens[endpoint] ||= @fetcher.fetch(endpoint, profile: config.profile_for(endpoint))
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
private def config
|
|
68
|
+
@config ||= @config_loader.call
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'endpoint'
|
|
4
|
+
require_relative 'error'
|
|
5
|
+
|
|
6
|
+
module Rubygems
|
|
7
|
+
module CredentialStore
|
|
8
|
+
module Backends
|
|
9
|
+
module CodeArtifact
|
|
10
|
+
# Chooses the AWS profile for each domain from the user's config file.
|
|
11
|
+
class Config
|
|
12
|
+
class << self
|
|
13
|
+
def default_path
|
|
14
|
+
File.join(Gem.config_home, 'rubygems-credential_store-backends-codeartifact', 'config.yml')
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def load(path = default_path)
|
|
18
|
+
return new unless File.exist?(path)
|
|
19
|
+
|
|
20
|
+
parse(read(path), path: path)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def parse(yaml, path:)
|
|
24
|
+
data = deserialize(yaml, path) || {}
|
|
25
|
+
raise Error, "#{path} must contain a mapping" unless data.is_a?(Hash)
|
|
26
|
+
|
|
27
|
+
domains = data['domains'] || {}
|
|
28
|
+
unless domains.is_a?(Hash) && domains.values.all?(Hash)
|
|
29
|
+
raise Error, "domains in #{path} must be a mapping of mappings"
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
domain_profiles = domains.to_h do |arn, entry|
|
|
33
|
+
endpoint = Endpoint.from_arn(arn.to_s)
|
|
34
|
+
raise Error, "#{arn.inspect} in #{path} is not a CodeArtifact domain ARN" unless endpoint
|
|
35
|
+
|
|
36
|
+
[endpoint, entry['profile']]
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
new(default_profile: data['profile'], domain_profiles: domain_profiles)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
private def read(path)
|
|
43
|
+
File.read(path)
|
|
44
|
+
rescue SystemCallError => e
|
|
45
|
+
raise Error, "Failed to load #{path}: #{e.message}"
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
private def deserialize(yaml, path)
|
|
49
|
+
# Do not use gems so as to avoid conflicts with the version in Gemfile.lock.
|
|
50
|
+
require 'rubygems/yaml_serializer'
|
|
51
|
+
|
|
52
|
+
Gem::YAMLSerializer.load(yaml)
|
|
53
|
+
rescue StandardError => e
|
|
54
|
+
raise Error, "Failed to parse #{path}: #{e.message}"
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def initialize(default_profile: nil, domain_profiles: {})
|
|
59
|
+
@default_profile = default_profile
|
|
60
|
+
@domain_profiles = domain_profiles
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def profile_for(endpoint)
|
|
64
|
+
[@domain_profiles[endpoint], @default_profile].map(&:to_s).find { |profile| !profile.empty? }
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Rubygems
|
|
4
|
+
module CredentialStore
|
|
5
|
+
module Backends
|
|
6
|
+
module CodeArtifact
|
|
7
|
+
Endpoint = Data.define(:domain, :owner, :region)
|
|
8
|
+
|
|
9
|
+
# A CodeArtifact domain, identified from the account a credential store is asked about.
|
|
10
|
+
class Endpoint
|
|
11
|
+
DOMAIN = /[a-z][a-z0-9-]{0,48}[a-z0-9]/
|
|
12
|
+
OWNER = /[0-9]{12}/
|
|
13
|
+
REGION = /[a-z0-9-]+/
|
|
14
|
+
HOST = /\A(?<domain>#{DOMAIN})-(?<owner>#{OWNER})
|
|
15
|
+
\.d\.codeartifact\.(?<region>#{REGION})\.(?:amazonaws\.com|on\.aws)\z/x
|
|
16
|
+
ARN = %r{\Aarn:[a-z-]+:codeartifact:(?<region>#{REGION}):(?<owner>#{OWNER}):domain/(?<domain>#{DOMAIN})\z}
|
|
17
|
+
|
|
18
|
+
class << self
|
|
19
|
+
def from_arn(arn)
|
|
20
|
+
match = ARN.match(arn)
|
|
21
|
+
return nil unless match
|
|
22
|
+
|
|
23
|
+
new(domain: match[:domain], owner: match[:owner], region: match[:region])
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def from_account(service, account)
|
|
27
|
+
url_or_host =
|
|
28
|
+
case service
|
|
29
|
+
when 'bundler' then decode_bundler_key(account)
|
|
30
|
+
when 'rubygems' then account
|
|
31
|
+
end
|
|
32
|
+
# A token sent to a plain http:// source would cross the network unencrypted.
|
|
33
|
+
return nil if url_or_host.nil? || url_or_host.match?(%r{\Ahttp://}i)
|
|
34
|
+
|
|
35
|
+
match = HOST.match(host_of(url_or_host))
|
|
36
|
+
return nil unless match
|
|
37
|
+
|
|
38
|
+
new(domain: match[:domain], owner: match[:owner], region: match[:region])
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
private def decode_bundler_key(key)
|
|
42
|
+
return nil unless key.start_with?('BUNDLE_')
|
|
43
|
+
|
|
44
|
+
key.delete_prefix('BUNDLE_').gsub('___', '-').gsub('__', '.').downcase
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
private def host_of(url_or_host)
|
|
48
|
+
url_or_host.sub(%r{\Ahttps://}i, '')[%r{\A[^/:?#]*}].downcase
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'open3'
|
|
4
|
+
require_relative 'error'
|
|
5
|
+
|
|
6
|
+
module Rubygems
|
|
7
|
+
module CredentialStore
|
|
8
|
+
module Backends
|
|
9
|
+
module CodeArtifact
|
|
10
|
+
# Gets a CodeArtifact authorization token by running the aws command.
|
|
11
|
+
class TokenFetcher
|
|
12
|
+
COMMAND = 'aws'
|
|
13
|
+
|
|
14
|
+
def fetch(endpoint, profile:)
|
|
15
|
+
# Not aws-sdk gems, as its gems could conflict with the versions in Gemfile.lock.
|
|
16
|
+
args = arguments(endpoint, profile)
|
|
17
|
+
token, status = Open3.capture2({ 'AWS_PAGER' => '' }, COMMAND, *args, stdin_data: '')
|
|
18
|
+
raise Error, failure_message(endpoint, exit_reason(status)) unless status.success?
|
|
19
|
+
|
|
20
|
+
token.strip
|
|
21
|
+
rescue SystemCallError => e
|
|
22
|
+
raise Error, failure_message(endpoint, e.message)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
private def arguments(endpoint, profile)
|
|
26
|
+
options = {
|
|
27
|
+
'domain' => endpoint.domain,
|
|
28
|
+
'domain-owner' => endpoint.owner,
|
|
29
|
+
'region' => endpoint.region,
|
|
30
|
+
'query' => 'authorizationToken',
|
|
31
|
+
'output' => 'text'
|
|
32
|
+
}
|
|
33
|
+
options['profile'] = profile if profile
|
|
34
|
+
|
|
35
|
+
['codeartifact', 'get-authorization-token', *options.map { |name, value| "--#{name}=#{value}" }]
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
private def exit_reason(status)
|
|
39
|
+
if status.signaled?
|
|
40
|
+
"#{COMMAND} was terminated by SIG#{Signal.signame(status.termsig)}"
|
|
41
|
+
else
|
|
42
|
+
"#{COMMAND} exited with status #{status.exitstatus}"
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
private def failure_message(endpoint, reason)
|
|
47
|
+
"Failed to get a CodeArtifact authorization token for domain #{endpoint.domain} " \
|
|
48
|
+
"(owner #{endpoint.owner}, region #{endpoint.region}) (#{reason}). " \
|
|
49
|
+
"The #{COMMAND} command may not be installed, or AWS authentication may have failed."
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'rubygems/credential_store'
|
|
4
|
+
require_relative 'codeartifact/version'
|
|
5
|
+
require_relative 'codeartifact/backend'
|
|
6
|
+
|
|
7
|
+
Gem::CredentialStore.register_backend('codeartifact', Rubygems::CredentialStore::Backends::CodeArtifact::Backend.new)
|
data/release/Gemfile
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
source 'https://rubygems.org', cooldown: 7
|
|
4
|
+
|
|
5
|
+
# Not using `gemspec` here: it would put this gem's own version into release/Gemfile.lock,
|
|
6
|
+
# which would then go stale on every version bump. `rake release` reads the gemspec directly.
|
|
7
|
+
|
|
8
|
+
gem 'rake', '>= 13.4'
|
|
9
|
+
gem 'sigstore-cli'
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
GEM
|
|
2
|
+
remote: https://rubygems.org/
|
|
3
|
+
specs:
|
|
4
|
+
logger (1.7.0)
|
|
5
|
+
net-http (0.10.0)
|
|
6
|
+
net-protocol (>= 0.3.0)
|
|
7
|
+
uri (>= 0.11.1)
|
|
8
|
+
net-protocol (0.4.0)
|
|
9
|
+
timeout
|
|
10
|
+
protobug (0.2.0)
|
|
11
|
+
protobug_googleapis_field_behavior_protos (0.2.0)
|
|
12
|
+
protobug (= 0.2.0)
|
|
13
|
+
protobug_well_known_protos (= 0.2.0)
|
|
14
|
+
protobug_in_toto_attestation_protos (0.2.0)
|
|
15
|
+
protobug (= 0.2.0)
|
|
16
|
+
protobug_well_known_protos (= 0.2.0)
|
|
17
|
+
protobug_sigstore_protos (0.2.0)
|
|
18
|
+
protobug (= 0.2.0)
|
|
19
|
+
protobug_googleapis_field_behavior_protos (= 0.2.0)
|
|
20
|
+
protobug_well_known_protos (= 0.2.0)
|
|
21
|
+
protobug_well_known_protos (0.2.0)
|
|
22
|
+
protobug (= 0.2.0)
|
|
23
|
+
rake (13.4.2)
|
|
24
|
+
sigstore (0.3.0)
|
|
25
|
+
logger
|
|
26
|
+
net-http
|
|
27
|
+
protobug_in_toto_attestation_protos (~> 0.2.0)
|
|
28
|
+
protobug_sigstore_protos (~> 0.2.0)
|
|
29
|
+
uri
|
|
30
|
+
sigstore-cli (0.3.0)
|
|
31
|
+
sigstore (= 0.3.0)
|
|
32
|
+
thor
|
|
33
|
+
thor (1.5.0)
|
|
34
|
+
timeout (0.6.1)
|
|
35
|
+
uri (1.1.2)
|
|
36
|
+
|
|
37
|
+
PLATFORMS
|
|
38
|
+
ruby
|
|
39
|
+
|
|
40
|
+
DEPENDENCIES
|
|
41
|
+
rake (>= 13.4)
|
|
42
|
+
sigstore-cli
|
|
43
|
+
|
|
44
|
+
CHECKSUMS
|
|
45
|
+
bundler (4.1.0) sha256=d7b7a797b988e544a0677a9c6ed78146f2f63d05ae1af8bc7d9426cf88b46377
|
|
46
|
+
logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
|
|
47
|
+
net-http (0.10.0) sha256=1a2ff6e37a05724973c43f2bf7bf105f59c36a4cd0a7e9b1c021a0a566987c27
|
|
48
|
+
net-protocol (0.4.0) sha256=f9f90c8c6f64794a45160bf422177a336db12809de3beeeaa26b88fcd2e8c853
|
|
49
|
+
protobug (0.2.0) sha256=eb154bdbe2a3afe796711e0c16e89b2ed59efee0f172a10b634400471299b3f2
|
|
50
|
+
protobug_googleapis_field_behavior_protos (0.2.0) sha256=5d4ddcdcfd8616a74ac100de893e3768feee631579a777e23498d3a0ba45b893
|
|
51
|
+
protobug_in_toto_attestation_protos (0.2.0) sha256=64317c2bb5efe8494ecd0da6990f3c027e7af58bf12c34d6dbd1aa43fd87f731
|
|
52
|
+
protobug_sigstore_protos (0.2.0) sha256=b094cbb2ceadc9ffe6e34ec217613dd7a8e78b6411bf4404bd686f7343514e25
|
|
53
|
+
protobug_well_known_protos (0.2.0) sha256=89dd4965ed80ed9355b575e9243e7762487de581a8e2b34a97af6bef60fe3b3f
|
|
54
|
+
rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701
|
|
55
|
+
sigstore (0.3.0) sha256=a6a25add5220283ed583011392f2952abc2125505ef08a52178fdb86ea67ca56
|
|
56
|
+
sigstore-cli (0.3.0) sha256=8dd883d7e036bcb51e1a63ead5479c29a818442f5d2b39289033f433401a301c
|
|
57
|
+
thor (1.5.0) sha256=e3a9e55fe857e44859ce104a84675ab6e8cd59c650a49106a05f55f136425e73
|
|
58
|
+
timeout (0.6.1) sha256=78f57368a7e7bbadec56971f78a3f5ecbcfb59b7fcbb0a3ed6ddc08a5094accb
|
|
59
|
+
uri (1.1.2) sha256=89292e98eabbef6248b0a0ed5e7e398e152f83f17560023a6d94a7f492b169fb
|
|
60
|
+
|
|
61
|
+
BUNDLED WITH
|
|
62
|
+
4.1.0
|
metadata
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: rubygems-credential_store-backends-codeartifact
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Takuma Ishikawa
|
|
8
|
+
bindir: exe
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies: []
|
|
12
|
+
description: Gets AWS CodeArtifact authorization tokens on demand for RubyGems and Bundler.
|
|
13
|
+
email:
|
|
14
|
+
- nekketsuuu@users.noreply.github.com
|
|
15
|
+
executables: []
|
|
16
|
+
extensions: []
|
|
17
|
+
extra_rdoc_files: []
|
|
18
|
+
files:
|
|
19
|
+
- CHANGELOG.md
|
|
20
|
+
- LICENSE.txt
|
|
21
|
+
- README.md
|
|
22
|
+
- Rakefile
|
|
23
|
+
- lib/rubygems/credential_store/backends/codeartifact.rb
|
|
24
|
+
- lib/rubygems/credential_store/backends/codeartifact/backend.rb
|
|
25
|
+
- lib/rubygems/credential_store/backends/codeartifact/config.rb
|
|
26
|
+
- lib/rubygems/credential_store/backends/codeartifact/endpoint.rb
|
|
27
|
+
- lib/rubygems/credential_store/backends/codeartifact/error.rb
|
|
28
|
+
- lib/rubygems/credential_store/backends/codeartifact/token_fetcher.rb
|
|
29
|
+
- lib/rubygems/credential_store/backends/codeartifact/version.rb
|
|
30
|
+
- release/Gemfile
|
|
31
|
+
- release/Gemfile.lock
|
|
32
|
+
homepage: "https://github.com/nekketsuuu/rubygems-credential_store-backends-codeartifact"
|
|
33
|
+
licenses:
|
|
34
|
+
- MIT
|
|
35
|
+
metadata:
|
|
36
|
+
allowed_push_host: "https://rubygems.org"
|
|
37
|
+
homepage_uri: "https://github.com/nekketsuuu/rubygems-credential_store-backends-codeartifact"
|
|
38
|
+
changelog_uri: "https://github.com/nekketsuuu/rubygems-credential_store-backends-codeartifact/blob/main/CHANGELOG.md"
|
|
39
|
+
rubygems_mfa_required: "true"
|
|
40
|
+
rdoc_options: []
|
|
41
|
+
require_paths:
|
|
42
|
+
- lib
|
|
43
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
-
|
|
46
|
+
- ">="
|
|
47
|
+
- !ruby/object:Gem::Version
|
|
48
|
+
version: 3.3.0
|
|
49
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
-
|
|
52
|
+
- ">="
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: 4.1.0
|
|
55
|
+
requirements: []
|
|
56
|
+
rubygems_version: 4.1.0
|
|
57
|
+
specification_version: 4
|
|
58
|
+
summary: A RubyGems and Bundler credential store backend for AWS CodeArtifact.
|
|
59
|
+
test_files: []
|