Skip to content

Commit

Permalink
FLEX-9231: Add remote user IP option
Browse files Browse the repository at this point in the history
  • Loading branch information
hadleyn committed Jul 23, 2024
1 parent 097d805 commit f41c13f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/spark_api/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module Configuration
# valid configuration options
VALID_OPTION_KEYS = [:api_key, :api_secret, :api_user, :endpoint,
:user_agent, :version, :ssl, :ssl_verify, :oauth2_provider, :authentication_mode,
:auth_endpoint, :callback, :compress, :timeout, :middleware, :dictionary_version, :request_id_chain].freeze
:auth_endpoint, :callback, :compress, :timeout, :middleware, :dictionary_version, :request_id_chain, :user_ip_address].freeze
OAUTH2_KEYS = [:authorization_uri, :access_uri, :client_id, :client_secret,
# Requirements for authorization_code grant type
:redirect_uri,
Expand Down Expand Up @@ -46,8 +46,10 @@ module Configuration
DEFAULT_MIDDLEWARE = 'spark_api'
DEFAULT_DICTIONARY_VERSION = nil
DEFAULT_REQUEST_ID_CHAIN = nil
DEFAULT_USER_IP_ADDRESS = nil

X_SPARK_API_USER_AGENT = "X-SparkApi-User-Agent"
X_USER_IP_ADDRESS = "X-User-IP-Address"

attr_accessor *VALID_OPTION_KEYS
def configure
Expand Down Expand Up @@ -82,6 +84,7 @@ def reset_configuration
self.middleware = DEFAULT_MIDDLEWARE
self.dictionary_version = DEFAULT_DICTIONARY_VERSION
self.request_id_chain = DEFAULT_REQUEST_ID_CHAIN
self.user_ip_address = DEFAULT_USER_IP_ADDRESS
self
end
end
Expand Down

0 comments on commit f41c13f

Please sign in to comment.