feat: Allow for masking of attributes#1257
Conversation
🦋 Changeset detectedLatest commit: 7481949 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
1baa127 to
b9e2abe
Compare
This currently adds a new API, `maskAttributesFn: (key: string, value: string, element: HTMLElement) => string`, that is used as a callback in `transformAttribute`. I prefer this API as it gives more flexibility for users (though it may need to pass the el node for most flexibility), but it is inconsistent with `maskTextFn` and `maskInputFn`. other options: * Rename this to something else (open to ideas) * Change this to pass value, and dom element (similar to MaskInputFn) to customize masking instead of decision maker of when to mask and introduce a simpler declarative API for what attributes to mask * ???
b9e2abe to
7481949
Compare
Brings this library up to date w/ upstream. Includes additional commits for enhanced privacy and Sentry release workflows. Cherry picks include the following upstream PRs: * rrweb-io#1096 * rrweb-io#1155 * rrweb-io#1257 * rrweb-io#1262 Cherry picks from getsentry fork: * #70 * #103 * 064d8c4 * e274f88 * cffefa2 * #20 --------- Co-authored-by: Michael Dellanoce <mdellanoce@pendo.io> Co-authored-by: mdellanoce <mdellanoce@users.noreply.github.com> Co-authored-by: Yun Feng <yun.feng0817@gmail.com> Co-authored-by: Francesco Novy <francesco.novy@sentry.io> Co-authored-by: Lukas Stracke <lukas.stracke@sentry.io>
Brings this library up to date w/ upstream. Includes additional commits for enhanced privacy and Sentry release workflows. Cherry picks include the following upstream PRs: * rrweb-io#1096 * rrweb-io#1155 * rrweb-io#1257 * rrweb-io#1262 Cherry picks from getsentry fork: * #70 * #103 * 064d8c4 * e274f88 * cffefa2 * #20 --------- Co-authored-by: Michael Dellanoce <mdellanoce@pendo.io> Co-authored-by: mdellanoce <mdellanoce@users.noreply.github.com> Co-authored-by: Yun Feng <yun.feng0817@gmail.com> Co-authored-by: Francesco Novy <francesco.novy@sentry.io> Co-authored-by: Lukas Stracke <lukas.stracke@sentry.io>
|
Just wanted to say that it is awesome to see this, we were going to be bringing up attribute masking from Pendo pretty soon anyways 😅 So in your solution you opt for just always calling the Another thought would be if we don't want a list of attributes as an option would it instead be better to just call the |
Brings this library up to date w/ upstream. Includes additional commits for enhanced privacy and Sentry release workflows. Cherry picks include the following upstream PRs: * rrweb-io#1096 * rrweb-io#1155 * rrweb-io#1257 * rrweb-io#1262 Cherry picks from getsentry fork: * #70 * #103 * 064d8c4 * e274f88 * cffefa2 * #20 --------- Co-authored-by: Michael Dellanoce <mdellanoce@pendo.io> Co-authored-by: mdellanoce <mdellanoce@users.noreply.github.com> Co-authored-by: Yun Feng <yun.feng0817@gmail.com> Co-authored-by: Francesco Novy <francesco.novy@sentry.io> Co-authored-by: Lukas Stracke <lukas.stracke@sentry.io>
Note: this is more of an RFCIdeally this would allow users to be able to mask attributes of DOM nodes. An example of this is
placeholderwhich can be a bit suspicious to our users when our default state is that everything is masked.This currently adds a new API,
maskAttributesFn: (key: string, value: string, el: HTMLElement) => string, that is used as a callback intransformAttribute. I prefer this API as it gives more flexibility for users (though it may need to pass the el node for most flexibility), but it is a bit inconsistent withmaskTextFnandmaskInputFn.other options:
* Rename this to something else (open to ideas)* ???