Class: Mashape::AuthenticationUtils
- Inherits:
-
Object
- Object
- Mashape::AuthenticationUtils
- Defined in:
- lib/authentication/authentication_utils.rb
Class Method Summary collapse
- .generateBasicAuthHeader(username, password) ⇒ Object
- .generateMashapeAuthHeader(mashape_key) ⇒ Object
Class Method Details
.generateBasicAuthHeader(username, password) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/authentication/authentication_utils.rb', line 12 def AuthenticationUtils.generateBasicAuthHeader(username, password) unless username.empty? || password.empty? auth = {"Authorization" => "Basic " + Base64.encode64(username + ":" + password).chomp.gsub(/\n/,'')} end return auth end |
.generateMashapeAuthHeader(mashape_key) ⇒ Object
8 9 10 |
# File 'lib/authentication/authentication_utils.rb', line 8 def AuthenticationUtils.generateMashapeAuthHeader(mashape_key) return {"X-Mashape-Authorization" => mashape_key} end |