lib/safettp/http_options.rb in safettp-0.2.1 vs lib/safettp/http_options.rb in safettp-0.3.1
- old
+ new
@@ -1,7 +1,7 @@
class Safettp::HTTPOptions
- AUTHENTICATORS = {
+ AUTH_TYPES = {
none: Safettp::NoneAuthenticator,
basic: Safettp::BasicAuthenticator
}.freeze
DEFAULT_HEADERS = {
@@ -29,11 +29,11 @@
def body
options_hash.fetch(:body, "")
end
- def authorization
- authorization_options = options_hash.fetch(:authorization, { type: :none })
- AUTHENTICATORS.fetch(authorization_options[:type], Safettp::NoneAuthenticator)
- .new(authorization_options)
+ def auth
+ auth_options = options_hash.fetch(:auth, { type: :none })
+ AUTH_TYPES.fetch(auth_options[:type], Safettp::NoneAuthenticator)
+ .new(auth_options)
end
end