awsecrets 1.12.1 → 1.13.0

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: 7590fbc66cd1ed0d697f330afd72ea3e8bd2c521
4
- data.tar.gz: b1165f8b3e9ea602b6ec77469131ca9fe1054725
3
+ metadata.gz: 8502b9ee75ac740ecdc77ba755789d48d53f85f4
4
+ data.tar.gz: b2c69e88b743afb44281aa3def9df1a134978ac8
5
5
  SHA512:
6
- metadata.gz: 545db08d83fad2cd75a49b64935189336cefa717e71ee53f03749435ce297e2397a6a2a3ca119cd3c0a8829fe65a347378a3df849ffdba6380d9f5d538b5d4c2
7
- data.tar.gz: a271787fd007ad1c76a4ef445464cb7bb770edf11316a6628d574c77ac67d3f8c9812365650567904cae475b5297f3fca03a4c83bf458124ffe161787ad185a0
6
+ metadata.gz: 6d5247906f68137ec2c7b8c4b811416335632bda0067b94f602c2d95b8fe7780ddfd6107416564694ce6c4128a136b9e2b670fe9d4e62ce92a93927990dfc87b
7
+ data.tar.gz: f4f346b1381789ea59f283dafee43e7d37fed1a11e7adcef3cc1af14ecb4ef0480e10de569efe03a68a2f5f27e532a03f42261bf77ed93324fa4f2d6c6c90558
data/README.md CHANGED
@@ -9,6 +9,7 @@ AWS credentials loader
9
9
  3. YAML file (secrets.yml)
10
10
  4. The AWS credentials file
11
11
  5. The CLI configuration file
12
+ 6. Instance profile credentials
12
13
 
13
14
  (See http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#config-settings-and-precedence)
14
15
 
@@ -103,6 +104,17 @@ And execute
103
104
  $ ec2sample i-1aa1aaaa
104
105
  ```
105
106
 
107
+ ### Disable load YAML(secrets.yml)
108
+
109
+ ```ruby
110
+ Awsecrets.load(disable_load_secrets:true)
111
+ ```
112
+
113
+ or
114
+
115
+ ```ruby
116
+ Awsecrets.load(secrets_path:false)
117
+ ```
106
118
 
107
119
  ## Contributing
108
120
 
data/lib/awsecrets.rb CHANGED
@@ -6,10 +6,12 @@ require 'net/http'
6
6
  require 'yaml'
7
7
 
8
8
  module Awsecrets
9
- def self.load(profile: nil, region: nil, secrets_path: nil)
9
+ def self.load(profile: nil, region: nil, secrets_path: nil, disable_load_secrets: false)
10
10
  @profile = profile
11
11
  @region = region
12
12
  @secrets_path = secrets_path
13
+ @disable_load_secrets = disable_load_secrets
14
+ @disable_load_secrets = true if secrets_path == false
13
15
  @credentials = @access_key_id = @secret_access_key = @session_token = @role_arn = @source_profile = nil
14
16
 
15
17
  # 1. Command Line Options
@@ -58,6 +60,7 @@ module Awsecrets
58
60
  end
59
61
 
60
62
  def self.load_yaml
63
+ return if @disable_load_secrets
61
64
  @secrets_path ||= 'secrets.yml'
62
65
  creds = YAML.load_file(@secrets_path) if File.exist?(File.expand_path(@secrets_path))
63
66
  @region ||= creds['region'] if creds && creds.include?('region')
@@ -1,3 +1,3 @@
1
1
  module Awsecrets
2
- VERSION = '1.12.1'
2
+ VERSION = '1.13.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awsecrets
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.1
4
+ version: 1.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - k1LoW
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-30 00:00:00.000000000 Z
11
+ date: 2017-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk