Module: SecretServer::Configuration
- Included in:
- SdkClient
- Defined in:
- lib/secret_server/configuration.rb
Overview
Helpers for working with the Secret Server configuration
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#path ⇒ Object
Returns the value of attribute path.
-
#rule ⇒ Object
Returns the value of attribute rule.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #configure {|_self| ... } ⇒ Object
- #env_configure ⇒ Object
- #tss ⇒ Object
- #valid_path? ⇒ Boolean
- #valid_url? ⇒ Boolean
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
4 5 6 |
# File 'lib/secret_server/configuration.rb', line 4 def key @key end |
#path ⇒ Object
Returns the value of attribute path.
4 5 6 |
# File 'lib/secret_server/configuration.rb', line 4 def path @path end |
#rule ⇒ Object
Returns the value of attribute rule.
4 5 6 |
# File 'lib/secret_server/configuration.rb', line 4 def rule @rule end |
#url ⇒ Object
Returns the value of attribute url.
4 5 6 |
# File 'lib/secret_server/configuration.rb', line 4 def url @url end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
6 7 8 |
# File 'lib/secret_server/configuration.rb', line 6 def configure yield self end |
#env_configure ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/secret_server/configuration.rb', line 10 def env_configure configure do |config| config.path = ENV['SDK_CLIENT_PATH'] || nil config.url = ENV['SECRET_SERVER_URL'] || nil config.rule = ENV['SDK_CLIENT_RULE'] || nil config.key = ENV['SDK_CLIENT_KEY'] || nil end end |
#tss ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/secret_server/configuration.rb', line 27 def tss return @tss if defined? @tss @tss = begin bin = File.join(path, 'tss.exe') bin = File.join(path, 'tss') unless File.exist? bin bin end end |
#valid_path? ⇒ Boolean
19 20 21 |
# File 'lib/secret_server/configuration.rb', line 19 def valid_path? File.exist? tss end |
#valid_url? ⇒ Boolean
23 24 25 |
# File 'lib/secret_server/configuration.rb', line 23 def valid_url? !url.nil? end |