awssession 0.2.4 → 0.2.5

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: f316cc96a9097804b71ee9cef31eb0f52082d3e8
4
- data.tar.gz: c8db40ece18b3dbb95656c07fa2dbb676ae7b843
3
+ metadata.gz: 2467e70386d7bd3bd2edebe2f32682a025ff0377
4
+ data.tar.gz: 5ae201b950a16f0342e3b21625b32f15103bb932
5
5
  SHA512:
6
- metadata.gz: 1365e1522ef86acdb3765e6d7b7f536618f99c352c888b4df4ef4f4ba4f33f453901201d83ee8649657b1c9a67881a1c370a46e4c9650c3eba8628948c193512
7
- data.tar.gz: 44292abe10cba60c8f367022e8e29534e919e820587109089573ea5b3e6f97eda869ac07fe811190beb024c5271d7856d1be7624917867e557e12c765f5feee2
6
+ metadata.gz: 4c5c1024cb3cb4c100a83ebac1e23cd373b0645f61643a8dc52b023b4e36d3930cbcb2c3443bfb549187ff1f87dc1626e4d8482481d789f8fc40495a4a0c72b9
7
+ data.tar.gz: 85cb0a1aa277d5618718944437a17149bbdc6499754051fca13905ed822f43ac60b29f537ea2796fda2eee242ce8a7cd19dcf1053dd2301666232ce8ed9ab0f0
data/changelog.md ADDED
@@ -0,0 +1,18 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ ## [Unreleased]
5
+
6
+ ## [0.2.5] - 2017-10-06
7
+ ### Changed
8
+ - Cleanup + session naming improvement
9
+
10
+ ## [0.2.0] - 2017-10-04
11
+ ### Added
12
+ - ...
13
+
14
+ ### Changed
15
+ - ...
16
+
17
+ ### Removed
18
+ - ...
@@ -1,3 +1,3 @@
1
1
  class AwsSession
2
- VERSION = '0.2.4'.freeze
2
+ VERSION = '0.2.5'.freeze
3
3
  end
data/lib/awssession.rb CHANGED
@@ -3,6 +3,7 @@ require 'awssession/version'
3
3
  require 'aws-sdk-core'
4
4
  require 'yaml'
5
5
  require 'io/console'
6
+ require 'time'
6
7
 
7
8
  # AWS Session creation with profile
8
9
  # Structure of options[:profile]
@@ -44,8 +45,8 @@ class AwsSession
44
45
  puts 'Role session credentials expired. Removing obsolete role session file' if @debug > 0
45
46
  @role_session = nil
46
47
  File.delete("#{@session_save_path}/#{@role_filename}")
47
- else
48
- puts 'Found valid role session credentials.' if @debug > 0
48
+ elsif @debug > 0
49
+ puts 'Found valid role session credentials.'
49
50
  end
50
51
  end
51
52
 
@@ -56,8 +57,8 @@ class AwsSession
56
57
  puts 'STS session credentials expired. Removing obsolete sts session file' if @debug > 0
57
58
  @sts_session = nil
58
59
  File.delete("#{@session_save_path}/#{@sts_filename}")
59
- else
60
- puts 'Found valid sts session credentials.' if @debug > 0
60
+ elsif @debug > 0
61
+ puts 'Found valid sts session credentials.'
61
62
  end
62
63
  end
63
64
 
@@ -100,7 +101,7 @@ class AwsSession
100
101
  @role_session = sts_client.assume_role(
101
102
  duration_seconds: @role_lifetime,
102
103
  role_arn: @profile.role_arn,
103
- role_session_name: 'mysession'
104
+ role_session_name: "#{ENV['USER']}-#{Time.now.utc.iso8601.tr!('-:', '_')}"
104
105
  )
105
106
  end
106
107
 
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
4
+ version: 0.2.5
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-05 00:00:00.000000000 Z
11
+ date: 2017-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -111,6 +111,7 @@ files:
111
111
  - bin/awssession-use.rb
112
112
  - bin/console
113
113
  - bin/setup
114
+ - changelog.md
114
115
  - lib/awssession.rb
115
116
  - lib/awssession/version.rb
116
117
  - license.txt