Class: PiiScrubber::Integrations::FaradayMiddleware
- Inherits:
-
Object
- Object
- PiiScrubber::Integrations::FaradayMiddleware
- Defined in:
- lib/pii_scrubber/integrations/faraday_middleware.rb
Constant Summary collapse
- SENSITIVE_HEADERS =
%w[authorization cookie x-api-key x-auth-token set-cookie].freeze
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ FaradayMiddleware
constructor
A new instance of FaradayMiddleware.
Constructor Details
#initialize(app, options = {}) ⇒ FaradayMiddleware
Returns a new instance of FaradayMiddleware.
10 11 12 13 |
# File 'lib/pii_scrubber/integrations/faraday_middleware.rb', line 10 def initialize(app, = {}) @app = app @options = end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
8 9 10 |
# File 'lib/pii_scrubber/integrations/faraday_middleware.rb', line 8 def app @app end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
8 9 10 |
# File 'lib/pii_scrubber/integrations/faraday_middleware.rb', line 8 def @options end |
Instance Method Details
#call(env) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/pii_scrubber/integrations/faraday_middleware.rb', line 15 def call(env) sanitize_request(env) @app.call(env).on_complete do |response_env| sanitize_response(response_env) end end |