-
-
Notifications
You must be signed in to change notification settings - Fork 385
Expand file tree
/
Copy pathSentryRedactOptions.swift
More file actions
56 lines (52 loc) · 2.99 KB
/
SentryRedactOptions.swift
File metadata and controls
56 lines (52 loc) · 2.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import Foundation
@objc
public protocol SentryRedactOptions {
var maskAllText: Bool { get }
var maskAllImages: Bool { get }
var maskedViewClasses: [AnyClass] { get }
var unmaskedViewClasses: [AnyClass] { get }
var excludedViewClasses: Set<String> { get }
var includedViewClasses: Set<String> { get }
}
@objcMembers
@_spi(Private) public final class SentryRedactDefaultOptions: NSObject, SentryRedactOptions {
public var maskAllText: Bool = true
public var maskAllImages: Bool = true
public var maskedViewClasses: [AnyClass] = []
public var unmaskedViewClasses: [AnyClass] = []
/**
* A set of view type identifier strings that should be excluded from subtree traversal.
*
* Views matching these types will have their subtrees skipped during redaction to avoid crashes
* caused by traversing problematic view hierarchies (e.g., views that activate internal CoreAnimation
* animations when their layers are accessed).
*
* Matching uses partial string containment: if a view's class name (from `type(of: view).description()`)
* contains any of these strings, the subtree will be ignored. For example, "MyView" will match
* "MyApp.MyView", "MyViewSubclass", "Some.MyView.Container", etc.
*
* - Note: The final set of excluded view types is computed by `SentryUIRedactBuilder` using the formula:
* **Default View Classes + Excluded View Classes - Included View Classes**
* Default view classes are defined in `SentryUIRedactBuilder` (e.g., `CameraUI.ChromeSwiftUIView` on iOS 26+).
*/
public var excludedViewClasses: Set<String> = []
/**
* A set of view type identifier strings that should be included in subtree traversal.
*
* View types exactly matching these strings will be removed from the excluded set, allowing their subtrees
* to be traversed even if they would otherwise be excluded by default or via `excludedViewClasses`.
*
* Matching uses exact string matching: the view's class name (from `type(of: view).description()`)
* must exactly equal one of these strings. For example, "MyApp.MyView" will only match exactly "MyApp.MyView",
* not "MyApp.MyViewSubclass".
*
* - Note: The final set of excluded view types is computed by `SentryUIRedactBuilder` using the formula:
* **Default View Classes + Excluded View Classes - Included View Classes**
* Default view classes are defined in `SentryUIRedactBuilder` (e.g., `CameraUI.ChromeSwiftUIView` on iOS 26+).
* For example, you can use this to re-enable traversal for `CameraUI.ChromeSwiftUIView` on iOS 26+.
* - Note: Included patterns use exact matching (not partial) to prevent accidental matches. For example,
* if "ChromeCameraUI" is excluded and "Camera" is included, "ChromeCameraUI" will still be excluded
* because "Camera" doesn't exactly match "ChromeCameraUI".
*/
public var includedViewClasses: Set<String> = []
}