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 +4 -4
- data/lib/awssession.rb +5 -4
- data/lib/awssession/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f316cc96a9097804b71ee9cef31eb0f52082d3e8
|
4
|
+
data.tar.gz: c8db40ece18b3dbb95656c07fa2dbb676ae7b843
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
data/lib/awssession/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2017-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|