Module: Occi::Api::Client::Base::ProtectedStubs
- Included in:
- ClientBase
- Defined in:
- lib/occi/api/client/base/protected_stubs.rb
Instance Method Summary collapse
-
#configure_connection(options) ⇒ Object
Sets global connection options before the first call to a remote server is made.
-
#get_auth(auth_options, fallback = false) ⇒ Hash
Sets auth method and appropriate httparty attributes.
-
#get_media_type(force_type = nil) ⇒ String
Sets media type.
-
#preauthenticate ⇒ Object
Attempts to establish a preliminary connection with the server to verify provided credentials and perform fallback authN if necessary.
Instance Method Details
#configure_connection(options) ⇒ Object
Sets global connection options before the first call to a remote server is made. For example, this allows the configuration of a global connection timeout, including pre-authentication and authentication calls.
15 16 17 |
# File 'lib/occi/api/client/base/protected_stubs.rb', line 15 def configure_connection() raise Occi::Api::Client::Errors::NotImplementedError, "#{__method__} is just a stub!" end |
#get_auth(auth_options, fallback = false) ⇒ Hash
Sets auth method and appropriate httparty attributes. Supported auth methods are: ["basic", "digest", "x509", "none"]
32 33 34 |
# File 'lib/occi/api/client/base/protected_stubs.rb', line 32 def get_auth(, fallback = false) raise Occi::Api::Client::Errors::NotImplementedError, "#{__method__} is just a stub!" end |
#get_media_type(force_type = nil) ⇒ String
Sets media type. Will choose either application/occi+json or text/plain based on the formats supported by the server.
51 52 53 |
# File 'lib/occi/api/client/base/protected_stubs.rb', line 51 def get_media_type(force_type = nil) raise Occi::Api::Client::Errors::NotImplementedError, "#{__method__} is just a stub!" end |
#preauthenticate ⇒ Object
Attempts to establish a preliminary connection with the server to verify provided credentials and perform fallback authN if necessary. Has to be invoked after @auth_options have been set.
39 40 41 |
# File 'lib/occi/api/client/base/protected_stubs.rb', line 39 def preauthenticate raise Occi::Api::Client::Errors::NotImplementedError, "#{__method__} is just a stub!" end |