-
Notifications
You must be signed in to change notification settings - Fork 162
🐛 [RUM-12503] Add mask-unless-allowlisted privacy level support for standard attr #3907
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -128,13 +128,16 @@ export function getNodeSelfPrivacyLevel(node: Node): NodePrivacyLevel | undefine | |
| * Other `shouldMaskNode` cases are edge cases that should not matter too much (ex: should we mask a | ||
| * node if it is ignored or hidden? it doesn't matter since it won't be serialized). | ||
| */ | ||
| export function shouldMaskNode(node: Node, privacyLevel: NodePrivacyLevel) { | ||
| export function shouldMaskNode(node: Node, privacyLevel: NodePrivacyLevel, isTextContent: boolean = true) { | ||
|
||
| switch (privacyLevel) { | ||
| case NodePrivacyLevel.MASK: | ||
| case NodePrivacyLevel.HIDDEN: | ||
| case NodePrivacyLevel.IGNORE: | ||
| return true | ||
| case NodePrivacyLevel.MASK_UNLESS_ALLOWLISTED: | ||
| if (!isTextContent) { | ||
| return true | ||
| } | ||
| if (isTextNode(node)) { | ||
| // Always return true if our parent is a form element, like MASK_USER_INPUT. | ||
| // Otherwise, decide whether to mask based on the allowlist. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.