Module: SentryControllerLogging
- Extended by:
- ActiveSupport::Concern
- Included in:
- ApplicationController, SignIn::ApplicationController, SignIn::ServiceAccountApplicationController
- Defined in:
- app/controllers/concerns/sentry_controller_logging.rb
Instance Method Summary collapse
- #set_tags_and_extra_context ⇒ Object private
- #tags_context ⇒ Object private
- #user_context ⇒ Object private
Instance Method Details
#set_tags_and_extra_context ⇒ Object (private)
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/controllers/concerns/sentry_controller_logging.rb', line 10 def RequestStore.store['request_id'] = request.uuid RequestStore.store['additional_request_attributes'] = { 'remote_ip' => request.remote_ip, 'user_agent' => request.user_agent, 'user_uuid' => current_user&.uuid, 'source' => request.headers['Source-App-Name'] } Sentry.set_extras(request_uuid: request.uuid) Sentry.set_user(user_context) if current_user Sentry.() end |
#tags_context ⇒ Object (private)
32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'app/controllers/concerns/sentry_controller_logging.rb', line 32 def { controller_name: }.tap do || if current_user.present? sign_in = current_user.respond_to?(:identity) ? current_user.identity.sign_in : current_user.sign_in [:sign_in_method] = sign_in[:service_name] # account_type is filtered by sentry, becasue in other contexts it refers to a bank account type [:sign_in_acct_type] = sign_in[:account_type] else [:sign_in_method] = 'not-signed-in' end [:source] = request.headers['Source-App-Name'] if request.headers['Source-App-Name'] end end |
#user_context ⇒ Object (private)
23 24 25 26 27 28 29 30 |
# File 'app/controllers/concerns/sentry_controller_logging.rb', line 23 def user_context { id: current_user&.uuid, authn_context: current_user&.authn_context, loa: current_user&.loa, mhv_icn: current_user&.mhv_icn } end |