-
Notifications
You must be signed in to change notification settings - Fork 148
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
✨[REPLAY-336] Privacy by Default #951
Conversation
…ase doc serialized`
Squashing IE11 test fixes
Codecov Report
@@ Coverage Diff @@
## main #951 +/- ##
========================================
Coverage 89.08% 89.09%
========================================
Files 83 84 +1
Lines 3868 4026 +158
Branches 857 925 +68
========================================
+ Hits 3446 3587 +141
- Misses 422 439 +17
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests shouldn't be in a separate file, but should be integrated in existing test files instead.
233a0e4
to
e28af83
Compare
f83811b
to
7aa72ed
Compare
8c39340
to
a35f742
Compare
73efb85
to
24bdd7a
Compare
24bdd7a
to
65329d9
Compare
76ee67e
to
23fce4c
Compare
|
||
const makeHtmlDoc = (htmlContent: string, privacyTag: string) => { | ||
try { | ||
// Karma doesn't seem to support `document.documentElement.outerHTML` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Karma has nothing to do with outerHTML... probably something else
Maybe use
const htmlString = "<strong>Beware of the leopard</strong>";
const doc3 = new DOMParser().parseFromString(htmlString, "text/html");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
Motivation
Implements "Privacy by Default" (REPLAY-336).
Note to public. We are undergoing internal "dogfooding" of this Privacy API because we anticipate product related changes as we utilize this API internally at Datadog- without yet committing to a stable Privacy API. Internal docs are currently being reviewed and validated.
PR Navigation Notes:
input-masked
+input-ignored
to now both bemask-forms-only
. This changes behaviour a bit, generally improving privacy.mask-forms-only
is basicallymask
but only for forms like elements (see internal spec)attributes
handling both HTML attributes and JS element state, with (theoretical though unlikely) lossy serialization. In the future we should split to handle a newstate
property, and perhaps ameta
property for internal props like rrweb.Brief Spec Change Overview:
***
mask
mode now also censors<a>.href
,<img>.src
,data-*
attributes etc.hidden
elements is now the bare minimum (no id, class attributes etc anymore)Future Considerations:
<select>
multiselect
not reviewed<video>
+ elements don't havecurrentTime
serialised or observed.<foo:bar.ßaK>hello world</foo:bar.ßaK>
)input[type=text]
.value doesn't work since no attribute is created (and we treat state as an attribute)<script>
,<meta>
) but still record them so they don't introduce CSS styling side effects (script#widget + div
or:nth-child(x)
)serialize.ts
serializationUtils
,privacy.ts
parentNodePrivacyLevel
is passed in. To fix, we should uncache these values after using them.Changes
Largely isolated to 3 files:
packages/rum-recorder/src/domain/record/serialize.ts
packages/rum-recorder/src/domain/record/privacy.ts
packages/rum-recorder/src/constants.ts
Testing
packages/rum-recorder/src/domain/record/privacyByDefault.spec.ts
I have gone over the contributing documentation.