aws-session-credentials 1.0.5 → 1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: a3d180792c3fdbef43d68d288ef91e7092f1bc4a
4
- data.tar.gz: 31b213057b5dfb22fc417ce29e38345da7253e8c
2
+ SHA256:
3
+ metadata.gz: bf8adc8d0f24b82f7d1aece5ea9bc3540abe8037a6356967242045c023df3220
4
+ data.tar.gz: f4ae28f816b10222dd9d5cb85c06ef8289c4c38832e63ce0096e860b5745950c
5
5
  SHA512:
6
- metadata.gz: 9496a56ee86bc21c3c3bd60f1f19958664132f1698d0e7ebba9d55060e149d2d6725086ba14372f34c1721a41b362b91e4d24178c11dc87de7ea5d09013c929f
7
- data.tar.gz: 104b703dfb434d54c9d0579b0be4a677571c16b59d343b72c1a14f99466a925609d931a4ea3e95341ddd9374e659c75041f50666be634307d68dfcb7db7762e5
6
+ metadata.gz: dda1add1dd900c86e9f0bea0a86f7b62b40ecd9850811a274f87ef8f00ef06306b17142107b62872ab04a9262ca0a8c497d45fcd66842bd04660e878e942fda2
7
+ data.tar.gz: 0223408cdda6238ccc2e81dd031c9afba574730745e13604cb050c729afeb9180b06700dc3aa28fdd53cae03c2c9d4e16cf95a6060163935389068595fb957ad
data/README.md CHANGED
@@ -105,6 +105,16 @@ OATH credential name: user.name@example.com@accountalias
105
105
  See `aws-session --help configure` for more info. By default, the configuration
106
106
  is stored in `~/.aws/aws-session-config.yml`.
107
107
 
108
+ ### Shell environment variables
109
+
110
+ Credentials can be set as environment variables in your current shell by running something like the following example. Consider generating new session credentials or assuming a role before running this command.
111
+
112
+ ```
113
+ eval "$(aws-session shell-env bash)"
114
+ ```
115
+
116
+ Currently only _bash_ is supported.
117
+
108
118
  ## Contributing
109
119
 
110
120
  Bug reports and pull requests are welcome on GitHub at https://github.com/zl4bv/aws-session-credentials. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
@@ -294,6 +294,28 @@ module Aws
294
294
  store.print_profiles(self)
295
295
  end
296
296
 
297
+ method_option 'profile',
298
+ type: :string,
299
+ desc: 'Profile that will used when print environment variables',
300
+ default: 'default'
301
+
302
+ desc 'shell-env', 'Prints shell commands to set environment variables containing AWS credentials'
303
+ def shell_env(shell_name = '')
304
+ prof = CredentialFile.new.profile(options['profile'])
305
+ case shell_name
306
+ when 'bash'
307
+ puts <<-EOF
308
+ export AWS_ACCESS_KEY_ID="#{prof.aws_access_key_id}"
309
+ export AWS_SECRET_ACCESS_KEY="#{prof.aws_secret_access_key}"
310
+ export AWS_SESSION_TOKEN="#{prof.aws_session_token}"
311
+ EOF
312
+ when ''
313
+ raise "Please specify a shell. Currently supported shells are: bash"
314
+ else
315
+ raise "Unsupported shell '#{shell_name}'"
316
+ end
317
+ end
318
+
297
319
  desc 'version', 'Prints the current version'
298
320
  def version
299
321
  puts "aws-session-credentials #{Aws::Session::Credentials::VERSION}"
@@ -1,7 +1,7 @@
1
1
  module Aws
2
2
  module Session
3
3
  module Credentials
4
- VERSION = '1.0.5'
4
+ VERSION = '1.1.0'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-session-credentials
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Vidulich
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-30 00:00:00.000000000 Z
11
+ date: 2018-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -249,7 +249,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
249
249
  version: '0'
250
250
  requirements: []
251
251
  rubyforge_project:
252
- rubygems_version: 2.6.6
252
+ rubygems_version: 2.7.4
253
253
  signing_key:
254
254
  specification_version: 4
255
255
  summary: Command-line tool to generate AWS session credentials.