awssession 0.2.2 → 0.2.4

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
  SHA1:
3
- metadata.gz: dab171f5b2ecda218cdc7d93eb6ac5bd010767a9
4
- data.tar.gz: e9466e55dfbdc883b0bfed4ca351957ce70f0218
3
+ metadata.gz: f316cc96a9097804b71ee9cef31eb0f52082d3e8
4
+ data.tar.gz: c8db40ece18b3dbb95656c07fa2dbb676ae7b843
5
5
  SHA512:
6
- metadata.gz: bf1932933c14d9ed913b0d84648dbe3b64961ab4931872867401d27db8aeec7a69399a22a28a878db93198b5cdda58d1958ffa6cd23382025524042dd16cc26b
7
- data.tar.gz: 0a582d90f283408e52d6f2f07abe846a1db867050c2ac3ab5abe78e06f879be3c919692dcef5bc20041ff1e355e1374299f2e3446950bade0e646ee3d84db2fc
6
+ metadata.gz: 1365e1522ef86acdb3765e6d7b7f536618f99c352c888b4df4ef4f4ba4f33f453901201d83ee8649657b1c9a67881a1c370a46e4c9650c3eba8628948c193512
7
+ data.tar.gz: 44292abe10cba60c8f367022e8e29534e919e820587109089573ea5b3e6f97eda869ac07fe811190beb024c5271d7856d1be7624917867e557e12c765f5feee2
data/lib/awssession.rb CHANGED
@@ -24,6 +24,7 @@ class AwsSession
24
24
  @role_lifetime = options[:role_lifetime] || 3_600
25
25
  @role_filename = options[:role_filename] || "#{@profile.name}_aws-role-session.yaml"
26
26
  @session_save_path = options[:session_save_path] || "#{Dir.home}/.aws/cache"
27
+ @debug = options[:debug] || 0
27
28
  end
28
29
 
29
30
  def start
@@ -40,11 +41,11 @@ class AwsSession
40
41
  @role_session = YAML.load_file("#{@session_save_path}/#{@role_filename}") # Load
41
42
  if Time.now > @role_session.credentials.expiration
42
43
  # or soooooooon !
43
- puts 'Role session credentials expired. Removing obsolete role session file'
44
+ puts 'Role session credentials expired. Removing obsolete role session file' if @debug > 0
44
45
  @role_session = nil
45
46
  File.delete("#{@session_save_path}/#{@role_filename}")
46
47
  else
47
- puts 'Found valid role session credentials.'
48
+ puts 'Found valid role session credentials.' if @debug > 0
48
49
  end
49
50
  end
50
51
 
@@ -52,11 +53,11 @@ class AwsSession
52
53
  @sts_session = YAML.load_file("#{@session_save_path}/#{@sts_filename}") # Load
53
54
  if Time.now > @sts_session.credentials.expiration
54
55
  # or soooooooon !
55
- puts 'STS session credentials expired. Removing obsolete sts session file'
56
+ puts 'STS session credentials expired. Removing obsolete sts session file' if @debug > 0
56
57
  @sts_session = nil
57
58
  File.delete("#{@session_save_path}/#{@sts_filename}")
58
59
  else
59
- puts 'Found valid sts session credentials.'
60
+ puts 'Found valid sts session credentials.' if @debug > 0
60
61
  end
61
62
  end
62
63
 
@@ -1,3 +1,3 @@
1
1
  class AwsSession
2
- VERSION = '0.2.2'.freeze
2
+ VERSION = '0.2.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awssession
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan - Zipkid - Goethals
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-04 00:00:00.000000000 Z
11
+ date: 2017-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler