Class: Sentiero::Configuration
- Inherits:
-
Object
- Object
- Sentiero::Configuration
- Defined in:
- lib/sentiero/configuration.rb
Constant Summary collapse
- ENFORCED_PRIVACY =
{ maskInputOptions: {password: true} }.freeze
- DEFAULT_SESSION_IDLE_TIMEOUT =
Replay sessions follow a user journey, so the idle boundary is generous (a lunch break shouldn't split a journey); max age is the hard cap that keeps the identifier from living forever on never-idle tabs.
6 * 60 * 60
- DEFAULT_SESSION_MAX_AGE =
7 * 24 * 60 * 60
- DEFAULT_MAX_BODY_SIZE =
512 KB
524_288
Instance Attribute Summary collapse
-
#allow_insecure_dashboard ⇒ Object
Returns the value of attribute allow_insecure_dashboard.
-
#analytics_max_scan_sessions ⇒ Object
Returns the value of attribute analytics_max_scan_sessions.
-
#anonymize_ip ⇒ Object
Returns the value of attribute anonymize_ip.
-
#audit_log ⇒ Object
Returns the value of attribute audit_log.
-
#auth_callback ⇒ Object
Returns the value of attribute auth_callback.
-
#basic_auth ⇒ Object
Returns the value of attribute basic_auth.
-
#block_selector ⇒ Object
Returns the value of attribute block_selector.
-
#capture_clicks ⇒ Object
Returns the value of attribute capture_clicks.
-
#capture_errors ⇒ Object
Returns the value of attribute capture_errors.
-
#capture_metadata ⇒ Object
Returns the value of attribute capture_metadata.
-
#capture_web_vitals ⇒ Object
Returns the value of attribute capture_web_vitals.
-
#checkout_every_n_ms ⇒ Object
Returns the value of attribute checkout_every_n_ms.
-
#cors_origins ⇒ Object
Returns the value of attribute cors_origins.
-
#cross_tab_sessions ⇒ Object
Returns the value of attribute cross_tab_sessions.
-
#fingerprint ⇒ Object
readonly
Reader-only: mutate via #register / #default_platform=, not by replacing the whole object.
-
#flush_event_threshold ⇒ Object
Returns the value of attribute flush_event_threshold.
-
#flush_interval_ms ⇒ Object
Returns the value of attribute flush_interval_ms.
-
#geo_source ⇒ Object
Geo headers are trivially spoofable unless actually behind the CDN, so trusting them is an explicit opt-in.
-
#ignore_selector ⇒ Object
Returns the value of attribute ignore_selector.
-
#ingest_keys ⇒ Object
Returns the value of attribute ingest_keys.
-
#inline_stylesheet ⇒ Object
Returns the value of attribute inline_stylesheet.
-
#mask_all_inputs ⇒ Object
Returns the value of attribute mask_all_inputs.
-
#mask_input_options ⇒ Object
Returns the value of attribute mask_input_options.
-
#mask_text_selector ⇒ Object
Returns the value of attribute mask_text_selector.
-
#max_body_size ⇒ Object
Returns the value of attribute max_body_size.
-
#max_events_per_page ⇒ Object
Returns the value of attribute max_events_per_page.
-
#max_events_per_request ⇒ Object
Returns the value of attribute max_events_per_request.
-
#max_events_per_session ⇒ Object
Returns the value of attribute max_events_per_session.
-
#max_problems ⇒ Object
Returns the value of attribute max_problems.
-
#max_server_events ⇒ Object
Returns the value of attribute max_server_events.
-
#max_sessions ⇒ Object
Returns the value of attribute max_sessions.
-
#opt_out_cookie_name ⇒ Object
Returns the value of attribute opt_out_cookie_name.
-
#recorder_options ⇒ Object
Returns the value of attribute recorder_options.
-
#redaction ⇒ Object
Returns the value of attribute redaction.
-
#respect_gpc ⇒ Object
Returns the value of attribute respect_gpc.
-
#retention_period ⇒ Object
Returns the value of attribute retention_period.
-
#sampling ⇒ Object
Returns the value of attribute sampling.
-
#session_idle_timeout ⇒ Object
session_idle_timeout / session_max_age have validating writers below (a bad value here is serialized straight into client-side session-rotation logic), so they're declared separately from the plain attr_accessor list.
-
#session_max_age ⇒ Object
session_idle_timeout / session_max_age have validating writers below (a bad value here is serialized straight into client-side session-rotation logic), so they're declared separately from the plain attr_accessor list.
-
#shareable_replays ⇒ Object
Returns the value of attribute shareable_replays.
-
#store ⇒ Object
Returns the value of attribute store.
-
#track_custom_events ⇒ Object
Returns the value of attribute track_custom_events.
-
#track_forms ⇒ Object
Returns the value of attribute track_forms.
-
#track_navigation ⇒ Object
Returns the value of attribute track_navigation.
-
#user_opt_out ⇒ Object
Returns the value of attribute user_opt_out.
Instance Method Summary collapse
- #effective_recorder_options ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #rails ⇒ Object
-
#reporter ⇒ Object
Reach the Rails / Reporter config from the one core object, e.g.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
# File 'lib/sentiero/configuration.rb', line 137 def initialize @store = nil @cors_origins = [] @auth_callback = nil @flush_interval_ms = 10_000 @flush_event_threshold = 50 @max_events_per_page = 1_000 @max_body_size = DEFAULT_MAX_BODY_SIZE @max_problems = 5_000 @max_server_events = 50_000 @ingest_keys = {} @cross_tab_sessions = true @capture_metadata = false @capture_errors = false @track_navigation = false @track_custom_events = false @capture_clicks = false @track_forms = false @mask_all_inputs = true @mask_input_options = {} @block_selector = "[data-rr-block]" @mask_text_selector = "[data-rr-mask]" @ignore_selector = "[data-rr-ignore]" @sampling = {scroll: 150, input: "last"} @inline_stylesheet = nil @checkout_every_n_ms = nil @recorder_options = {} @capture_web_vitals = false @analytics_max_scan_sessions = 5000 @user_opt_out = false @opt_out_cookie_name = "sentiero_optout" @respect_gpc = true @retention_period = nil @session_idle_timeout = DEFAULT_SESSION_IDLE_TIMEOUT @session_max_age = DEFAULT_SESSION_MAX_AGE @redaction = Sentiero::Redaction::Config.new @fingerprint = Sentiero::Fingerprint::Config.new @anonymize_ip = true @geo_source = nil @audit_log = nil # Opt-in: a share file is a full session dump leaving the operator's # infrastructure, so export/import routes 404 until explicitly enabled. @shareable_replays = false @basic_auth = nil # The dashboard exposes recordings/analytics, so with neither basic_auth nor # auth_callback set it fails closed (403). Set true to opt into serving it # unauthenticated (e.g. behind a trusted proxy or in local dev). @allow_insecure_dashboard = false end |
Instance Attribute Details
#allow_insecure_dashboard ⇒ Object
Returns the value of attribute allow_insecure_dashboard.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def allow_insecure_dashboard @allow_insecure_dashboard end |
#analytics_max_scan_sessions ⇒ Object
Returns the value of attribute analytics_max_scan_sessions.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def analytics_max_scan_sessions @analytics_max_scan_sessions end |
#anonymize_ip ⇒ Object
Returns the value of attribute anonymize_ip.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def anonymize_ip @anonymize_ip end |
#audit_log ⇒ Object
Returns the value of attribute audit_log.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def audit_log @audit_log end |
#auth_callback ⇒ Object
Returns the value of attribute auth_callback.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def auth_callback @auth_callback end |
#basic_auth ⇒ Object
Returns the value of attribute basic_auth.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def basic_auth @basic_auth end |
#block_selector ⇒ Object
Returns the value of attribute block_selector.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def block_selector @block_selector end |
#capture_clicks ⇒ Object
Returns the value of attribute capture_clicks.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def capture_clicks @capture_clicks end |
#capture_errors ⇒ Object
Returns the value of attribute capture_errors.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def capture_errors @capture_errors end |
#capture_metadata ⇒ Object
Returns the value of attribute capture_metadata.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def @capture_metadata end |
#capture_web_vitals ⇒ Object
Returns the value of attribute capture_web_vitals.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def capture_web_vitals @capture_web_vitals end |
#checkout_every_n_ms ⇒ Object
Returns the value of attribute checkout_every_n_ms.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def checkout_every_n_ms @checkout_every_n_ms end |
#cors_origins ⇒ Object
Returns the value of attribute cors_origins.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def cors_origins @cors_origins end |
#cross_tab_sessions ⇒ Object
Returns the value of attribute cross_tab_sessions.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def cross_tab_sessions @cross_tab_sessions end |
#fingerprint ⇒ Object (readonly)
Reader-only: mutate via #register / #default_platform=, not by replacing the whole object.
9 10 11 |
# File 'lib/sentiero/configuration.rb', line 9 def fingerprint @fingerprint end |
#flush_event_threshold ⇒ Object
Returns the value of attribute flush_event_threshold.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def flush_event_threshold @flush_event_threshold end |
#flush_interval_ms ⇒ Object
Returns the value of attribute flush_interval_ms.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def flush_interval_ms @flush_interval_ms end |
#geo_source ⇒ Object
Geo headers are trivially spoofable unless actually behind the CDN, so trusting them is an explicit opt-in.
65 66 67 |
# File 'lib/sentiero/configuration.rb', line 65 def geo_source @geo_source end |
#ignore_selector ⇒ Object
Returns the value of attribute ignore_selector.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def ignore_selector @ignore_selector end |
#ingest_keys ⇒ Object
Returns the value of attribute ingest_keys.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def ingest_keys @ingest_keys end |
#inline_stylesheet ⇒ Object
Returns the value of attribute inline_stylesheet.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def inline_stylesheet @inline_stylesheet end |
#mask_all_inputs ⇒ Object
Returns the value of attribute mask_all_inputs.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def mask_all_inputs @mask_all_inputs end |
#mask_input_options ⇒ Object
Returns the value of attribute mask_input_options.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def @mask_input_options end |
#mask_text_selector ⇒ Object
Returns the value of attribute mask_text_selector.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def mask_text_selector @mask_text_selector end |
#max_body_size ⇒ Object
Returns the value of attribute max_body_size.
61 62 63 |
# File 'lib/sentiero/configuration.rb', line 61 def max_body_size @max_body_size end |
#max_events_per_page ⇒ Object
Returns the value of attribute max_events_per_page.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def max_events_per_page @max_events_per_page end |
#max_events_per_request ⇒ Object
Returns the value of attribute max_events_per_request.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def max_events_per_request @max_events_per_request end |
#max_events_per_session ⇒ Object
Returns the value of attribute max_events_per_session.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def max_events_per_session @max_events_per_session end |
#max_problems ⇒ Object
Returns the value of attribute max_problems.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def max_problems @max_problems end |
#max_server_events ⇒ Object
Returns the value of attribute max_server_events.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def max_server_events @max_server_events end |
#max_sessions ⇒ Object
Returns the value of attribute max_sessions.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def max_sessions @max_sessions end |
#opt_out_cookie_name ⇒ Object
Returns the value of attribute opt_out_cookie_name.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def @opt_out_cookie_name end |
#recorder_options ⇒ Object
Returns the value of attribute recorder_options.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def @recorder_options end |
#redaction ⇒ Object
Returns the value of attribute redaction.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def redaction @redaction end |
#respect_gpc ⇒ Object
Returns the value of attribute respect_gpc.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def respect_gpc @respect_gpc end |
#retention_period ⇒ Object
Returns the value of attribute retention_period.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def retention_period @retention_period end |
#sampling ⇒ Object
Returns the value of attribute sampling.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def sampling @sampling end |
#session_idle_timeout ⇒ Object
session_idle_timeout / session_max_age have validating writers below (a bad value here is serialized straight into client-side session-rotation logic), so they're declared separately from the plain attr_accessor list.
59 60 61 |
# File 'lib/sentiero/configuration.rb', line 59 def session_idle_timeout @session_idle_timeout end |
#session_max_age ⇒ Object
session_idle_timeout / session_max_age have validating writers below (a bad value here is serialized straight into client-side session-rotation logic), so they're declared separately from the plain attr_accessor list.
59 60 61 |
# File 'lib/sentiero/configuration.rb', line 59 def session_max_age @session_max_age end |
#shareable_replays ⇒ Object
Returns the value of attribute shareable_replays.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def shareable_replays @shareable_replays end |
#store ⇒ Object
Returns the value of attribute store.
5 6 7 |
# File 'lib/sentiero/configuration.rb', line 5 def store @store end |
#track_custom_events ⇒ Object
Returns the value of attribute track_custom_events.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def track_custom_events @track_custom_events end |
#track_forms ⇒ Object
Returns the value of attribute track_forms.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def track_forms @track_forms end |
#track_navigation ⇒ Object
Returns the value of attribute track_navigation.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def @track_navigation end |
#user_opt_out ⇒ Object
Returns the value of attribute user_opt_out.
11 12 13 |
# File 'lib/sentiero/configuration.rb', line 11 def user_opt_out @user_opt_out end |
Instance Method Details
#effective_recorder_options ⇒ Object
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/sentiero/configuration.rb', line 189 def first_class = { maskAllInputs: mask_all_inputs, maskInputOptions: , blockSelector: block_selector, maskTextSelector: mask_text_selector, ignoreSelector: ignore_selector, sampling: sampling } first_class[:inlineStylesheet] = inline_stylesheet unless inline_stylesheet.nil? first_class[:checkoutEveryNms] = checkout_every_n_ms unless checkout_every_n_ms.nil? .merge(first_class) .merge(ENFORCED_PRIVACY) { |_key, existing, enforced| if enforced.is_a?(Hash) (existing.is_a?(Hash) ? existing : {}).merge(enforced) else enforced end } end |
#rails ⇒ Object
95 96 97 98 |
# File 'lib/sentiero/configuration.rb', line 95 def rails require_subsystem!("Sentiero::Rails", "the sentiero-rails gem") Rails.configuration end |
#reporter ⇒ Object
Reach the Rails / Reporter config from the one core object, e.g. Sentiero.configure { |c| c.reporter.endpoint = "..." }. They remain separate instances so the reporter stays usable as a standalone client.
90 91 92 93 |
# File 'lib/sentiero/configuration.rb', line 90 def reporter require_subsystem!("Sentiero::Reporter", 'require "sentiero/reporter"') Reporter.configuration end |