lib/fullcontact/configuration.rb in fullcontact-0.14.0 vs lib/fullcontact/configuration.rb in fullcontact-0.15.0

- old
+ new

@@ -6,10 +6,11 @@ module Configuration # An array of valid keys in the options hash when configuring a {FullContact::API} VALID_OPTIONS_KEYS = [ :adapter, :api_key, + :auth_type, :endpoint, :format, :skip_rubyize, :include_headers_in_response, :gateway, @@ -25,10 +26,13 @@ DEFAULT_ADAPTER = Faraday.default_adapter # By default, don't set an application key DEFAULT_API_KEY = nil + # By default, use query parameters + DEFAULT_AUTH_TYPE = :query + # The endpoint that will be used to connect if none is set # DEFAULT_ENDPOINT = 'https://api.fullcontact.com/v2/'.freeze # The response format appended to the path and sent in the 'Accept' header if none is set @@ -48,10 +52,12 @@ # The user agent that will be sent to the API endpoint if none is set DEFAULT_USER_AGENT = "FullContact Ruby Client/#{FullContact::VERSION}".freeze DEFAULT_GATEWAY = nil + AUTH_HEADER_NAME = 'X-FullContact-APIKey'.freeze + # @private attr_accessor *VALID_OPTIONS_KEYS # When this module is extended, set all configuration options to their default values def self.extended(base) @@ -72,9 +78,10 @@ # Reset all configuration options to defaults def reset self.adapter = DEFAULT_ADAPTER self.api_key = DEFAULT_API_KEY + self.auth_type = DEFAULT_AUTH_TYPE self.endpoint = DEFAULT_ENDPOINT self.format = DEFAULT_FORMAT self.skip_rubyize = DEFAULT_SKIP_RUBYIZE self.include_headers_in_response = DEFAULT_INCLUDE_HEADERS_IN_RESPONSE self.proxy = DEFAULT_PROXY