Class: Splunker::Auth::SplunkAuth
- Inherits:
-
Object
- Object
- Splunker::Auth::SplunkAuth
- Includes:
- Request
- Defined in:
- lib/splunker/auth/splunk_auth.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#configured ⇒ Object
readonly
Returns the value of attribute configured.
Instance Method Summary collapse
-
#configuration ⇒ Object
A helper method to access the client’s configuration.
-
#configuration_valid? ⇒ Boolean
By default, always returns true Child classes must implement their own logic to determine when the client’s configuration is invalid for its needs.
-
#configured? ⇒ Boolean
Child classes must implement their own logic to determine when.
-
#initialize(client) ⇒ SplunkAuth
constructor
Parameters: * client => An instance of Splunker::Client.
- #reset ⇒ Object
-
#verify_configuration! ⇒ Object
Raises Splunker::Errors::ConfigurationError if configuration_valid? returns false.
Methods included from Request
#assemble_path, #authenticate, #authenticate_connection, #authenticated?, #get, included, #post, #request, #resource_builder
Constructor Details
#initialize(client) ⇒ SplunkAuth
Parameters:
-
client => An instance of Splunker::Client
11 12 13 |
# File 'lib/splunker/auth/splunk_auth.rb', line 11 def initialize(client) self.client = client end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
6 7 8 |
# File 'lib/splunker/auth/splunk_auth.rb', line 6 def client @client end |
#configured ⇒ Object (readonly)
Returns the value of attribute configured.
7 8 9 |
# File 'lib/splunker/auth/splunk_auth.rb', line 7 def configured @configured end |
Instance Method Details
#configuration ⇒ Object
A helper method to access the client’s configuration. Returns:
-
A Hash of the client’s current configuration settings.
18 19 20 |
# File 'lib/splunker/auth/splunk_auth.rb', line 18 def configuration self.client.configuration end |
#configuration_valid? ⇒ Boolean
By default, always returns true Child classes must implement their own logic to determine when the client’s configuration is invalid for its needs.
39 40 41 |
# File 'lib/splunker/auth/splunk_auth.rb', line 39 def configuration_valid? true end |
#configured? ⇒ Boolean
Child classes must implement their own logic to determine when
24 25 26 |
# File 'lib/splunker/auth/splunk_auth.rb', line 24 def configured? @configured == true end |
#reset ⇒ Object
43 44 45 |
# File 'lib/splunker/auth/splunk_auth.rb', line 43 def reset @configured = false end |
#verify_configuration! ⇒ Object
Raises Splunker::Errors::ConfigurationError if configuration_valid? returns false.
30 31 32 33 34 |
# File 'lib/splunker/auth/splunk_auth.rb', line 30 def verify_configuration! unless configuration_valid? raise Splunker::Errors::ConfigurationError end end |