prx-ruby-aws-creds 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/prx-ruby-aws-creds.rb +21 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ed94648d600229b366a248af0a7d0c82dcca1817c5db84cdc3f5cd72e871d32f
4
- data.tar.gz: 0b5b0dd0f266e0698d64717cbaf2d5abf900994619956eb4ce2c0ad36340dde3
3
+ metadata.gz: 8e03288063d2999775ce03029bcbf2e3be1ff12095d90812dd22127058b1c7b2
4
+ data.tar.gz: d919adc2def0ebfe1469d3d1a58bb8d7b4fdb4227969a8cc03bd4d2f2e3b20dc
5
5
  SHA512:
6
- metadata.gz: fdeba274d5fdf1c7f2adeafe3ef60b8db6c6e2e0e3383b8ced727ca08f2c620e399e3a482b3a388d7bf34d391370a082c0c2e5238a0474018a820ab3bcc52d0e
7
- data.tar.gz: a790aa26d3d5f536c901266683739390a55f64904ed11b4c2d34a27617423aa3a1e8f984f9e2ab8e63c5985cdb7cce1584ce052315007f8ba2387ca4f84c1a1e
6
+ metadata.gz: abe3afa00b828ad17696254c05ba83ca446de9bb2679fd5aa57544b31fd17705f3b190688b4ee3ef46302b5d3f1e4617343cd4c1b5daf13c34cd56784bf63335
7
+ data.tar.gz: 4c173dbbfaeef9dc4e240418f327325335a8130000c425aef3bd261f7bb9e71a892f5af6661210b57b7ac8548a0a7e83295c2dfc3548ce92ecb37e00a4d98748
@@ -11,6 +11,27 @@ require "aws-sdk-sso"
11
11
  CACHE_DIRECTORY = "#{Dir.home}/.aws/ruby/cache"
12
12
  AWS_CONFIG_FILE = ENV["AWS_CONFIG_FILE"] || "#{Dir.home}/.aws/config"
13
13
 
14
+ # Normally IniFile tries to be clever about detecting number values in the file
15
+ # and casting them to Integers and Floats. This breaks on a value like
16
+ # 048723829744, becuase Integer() tries to treat that as an octal, but fails
17
+ # since it includes 8s and 9s, but Float(048723829744) treats it like a decimal
18
+ # and returns 48723829744.0. Even if Integer() didn't fail it would drop the
19
+ # leading zero. We need to just treat these values as strings, so this gets
20
+ # rid of the fancy typecasting.
21
+ class IniFile
22
+ class Parser
23
+ def typecast( value )
24
+ case value
25
+ when %r/\Atrue\z/i; true
26
+ when %r/\Afalse\z/i; false
27
+ when %r/\A\s*\z/i; nil
28
+ else
29
+ unescape_value(value)
30
+ end
31
+ end
32
+ end
33
+ end
34
+
14
35
  class PrxRubyAwsCreds
15
36
  class << self
16
37
  # The cache key is based on the parameters used to request temporary
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prx-ruby-aws-creds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Kalafarski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-14 00:00:00.000000000 Z
11
+ date: 2023-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inifile