Module: EndPointBlank::Writers::Shared
- Included in:
- ExceptionWriter, LogWriter, RequestWriter, ResponseWriter
- Defined in:
- lib/end_point_blank/writers/shared.rb
Instance Attribute Summary collapse
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #app_name ⇒ Object
- #apply_masking(payload, record_type) ⇒ Object
- #configuration ⇒ Object
- #env ⇒ Object
- #env_name ⇒ Object
-
#request_uuid(env) ⇒ Object
Rails' ActionDispatch::Request#uuid simply reads this same Rack env key, so this is behavior-preserving when running under Rails, and gracefully returns nil when it isn't (plain Rack / Sinatra), instead of requiring actionpack's ActionDispatch::Request to be loaded.
- #source_application_environment_id ⇒ Object
Instance Attribute Details
#url ⇒ Object
Returns the value of attribute url.
4 5 6 |
# File 'lib/end_point_blank/writers/shared.rb', line 4 def url @url end |
Instance Method Details
#app_name ⇒ Object
10 11 12 |
# File 'lib/end_point_blank/writers/shared.rb', line 10 def app_name configuration.app_name end |
#apply_masking(payload, record_type) ⇒ Object
34 35 36 |
# File 'lib/end_point_blank/writers/shared.rb', line 34 def apply_masking(payload, record_type) EndPointBlank::Masking.apply(payload, record_type, configuration.masking_rules, configuration.mask_hook) end |
#configuration ⇒ Object
6 7 8 |
# File 'lib/end_point_blank/writers/shared.rb', line 6 def configuration Configuration.instance end |
#env ⇒ Object
18 19 20 |
# File 'lib/end_point_blank/writers/shared.rb', line 18 def env ::EndPointBlank::Rack::EnvStore.get end |
#env_name ⇒ Object
14 15 16 |
# File 'lib/end_point_blank/writers/shared.rb', line 14 def env_name SessionConfiguration.env_name end |
#request_uuid(env) ⇒ Object
Rails' ActionDispatch::Request#uuid simply reads this same Rack env key, so this is behavior-preserving when running under Rails, and gracefully returns nil when it isn't (plain Rack / Sinatra), instead of requiring actionpack's ActionDispatch::Request to be loaded.
30 31 32 |
# File 'lib/end_point_blank/writers/shared.rb', line 30 def request_uuid(env) env && env["action_dispatch.request_id"] end |
#source_application_environment_id ⇒ Object
22 23 24 |
# File 'lib/end_point_blank/writers/shared.rb', line 22 def source_application_environment_id ::EndPointBlank::Rack::EnvStore.source_application_environment_id end |