Class: SwaggerPetstore::HttpBasic
- Inherits:
-
CoreLibrary::HeaderAuth
- Object
- CoreLibrary::HeaderAuth
- SwaggerPetstore::HttpBasic
- Includes:
- CoreLibrary
- Defined in:
- lib/swagger_petstore/http/auth/http_basic.rb
Overview
Utility class for basic authorization.
Instance Method Summary collapse
-
#error_message ⇒ Object
Display error message on occurrence of authentication failure.
-
#initialize(http_basic_credentials) ⇒ HttpBasic
constructor
Initialization constructor.
Constructor Details
#initialize(http_basic_credentials) ⇒ HttpBasic
Initialization constructor.
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/swagger_petstore/http/auth/http_basic.rb', line 17 def initialize(http_basic_credentials) auth_params = {} unless http_basic_credentials.nil? || http_basic_credentials.username.nil? || http_basic_credentials.passwprd.nil? auth_params['Authorization'] = "Basic #{AuthHelper.get_base64_encoded_value(http_basic_credentials.username, http_basic_credentials.passwprd)}" end super auth_params end |
Instance Method Details
#error_message ⇒ Object
Display error message on occurrence of authentication failure.
12 13 14 |
# File 'lib/swagger_petstore/http/auth/http_basic.rb', line 12 def 'HttpBasic: username or passwprd is undefined.' end |