Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions flutter/lib/src/sentry_privacy_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@ class SentryPrivacyOptions {
mask: false,
name: 'SentryUnmask',
));
// TODO: check for Flutter version and make this testable
rules.add(SentryMaskingCustomRule<Widget>(
callback: (Element element, Widget widget) {
dynamic dynWidget = widget;
try {
final sensitivity = dynWidget.sensitivity;
assert(sensitivity is Enum);
return SentryMaskingDecision.mask;
} catch (e) {
return SentryMaskingDecision.continueProcessing;
}
},
name: 'SensitiveContent',
description: 'Mask SensitiveContent'));

// Then, we apply apply rules based on the configuration.
if (maskAllImages) {
Expand Down Expand Up @@ -75,11 +89,6 @@ class SentryPrivacyOptions {
));
}

rules.add(const SentryMaskingConstantRule<SensitiveContent>(
mask: true,
name: 'SensitiveContent',
));

// In Debug mode, check if users explicitly mask (or unmask) widgets that
// look like they should be masked, e.g. Videos, WebViews, etc.
if (runtimeChecker.isDebugMode()) {
Expand Down
Loading