Module: VaultPlugin::Authentication
- Included in:
- VaultPlugin::API::Backend, Endpoint
- Defined in:
- lib/smart_proxy_vault/authentication.rb,
lib/smart_proxy_vault/authentication/chef.rb
Defined Under Namespace
Modules: Chef
Instance Method Summary collapse
- #auth_backend ⇒ Object
- #auth_module ⇒ Object
- #authorized? ⇒ Boolean
-
#create_setting_accessors ⇒ Object
Creates convenient accessor methods for all keys underneath auth_backend.
-
#vault_client ⇒ Object
Returns the human-readable identity for the requesting client Optionally used in a token’s metadata & display-name.
Instance Method Details
#auth_backend ⇒ Object
5 6 7 |
# File 'lib/smart_proxy_vault/authentication.rb', line 5 def auth_backend ::VaultPlugin::Plugin.settings.auth_backend.to_sym end |
#auth_module ⇒ Object
9 10 11 |
# File 'lib/smart_proxy_vault/authentication.rb', line 9 def auth_module Object.const_get('::VaultPlugin::Authentication::' + auth_backend.capitalize.to_s) end |
#authorized? ⇒ Boolean
20 21 22 23 24 |
# File 'lib/smart_proxy_vault/authentication.rb', line 20 def create_setting_accessors extend auth_module end |
#create_setting_accessors ⇒ Object
Creates convenient accessor methods for all keys underneath auth_backend
14 15 16 17 18 |
# File 'lib/smart_proxy_vault/authentication.rb', line 14 def create_setting_accessors ::VaultPlugin::Plugin.settings[auth_backend].each do |key,value| define_singleton_method(key.to_sym) { value } end end |
#vault_client ⇒ Object
Returns the human-readable identity for the requesting client Optionally used in a token’s metadata & display-name
28 29 30 31 |
# File 'lib/smart_proxy_vault/authentication.rb', line 28 def vault_client extend auth_module vault_client end |