Skip to content

Commit c3dd355

Browse files
billyvgLms24
andauthored
feat(replay): Add back deprecated maskInputOptions (#6981)
This was unintentionally removed in #6645 - it is still deprecated and will be removed at a later date. Co-authored-by: Lukas Stracke <[email protected]>
1 parent 3f8dd42 commit c3dd355

File tree

5 files changed

+17
-5
lines changed

5 files changed

+17
-5
lines changed

packages/replay/src/integration.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ export class Replay implements Integration {
6969
// eslint-disable-next-line deprecation/deprecation
7070
blockSelector,
7171
// eslint-disable-next-line deprecation/deprecation
72+
maskInputOptions,
73+
// eslint-disable-next-line deprecation/deprecation
7274
maskTextClass,
7375
// eslint-disable-next-line deprecation/deprecation
7476
maskTextSelector,
@@ -77,6 +79,7 @@ export class Replay implements Integration {
7779
}: ReplayConfiguration = {}) {
7880
this._recordingOptions = {
7981
maskAllInputs,
82+
maskInputOptions: { ...(maskInputOptions || {}), password: true },
8083
maskTextFn: maskFn,
8184
maskInputFn: maskFn,
8285

packages/replay/src/types.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,14 @@ export interface DeprecatedPrivacyOptions {
158158
* @deprecated Use `block` which accepts an array of CSS selectors
159159
*/
160160
blockClass?: RecordingOptions['blockClass'];
161+
/**
162+
* @deprecated Use `ignore` which accepts an array of CSS selectors
163+
*/
164+
ignoreClass?: RecordingOptions['ignoreClass'];
165+
/**
166+
* @deprecated Use `mask` which accepts an array of CSS selectors
167+
*/
168+
maskInputOptions?: RecordingOptions['maskInputOptions'];
161169
/**
162170
* @deprecated Use `mask` which accepts an array of CSS selectors
163171
*/
@@ -166,10 +174,6 @@ export interface DeprecatedPrivacyOptions {
166174
* @deprecated Use `mask` which accepts an array of CSS selectors
167175
*/
168176
maskTextSelector?: RecordingOptions['maskTextSelector'];
169-
/**
170-
* @deprecated Use `ignore` which accepts an array of CSS selectors
171-
*/
172-
ignoreClass?: RecordingOptions['ignoreClass'];
173177
}
174178

175179
export interface ReplayConfiguration

packages/replay/src/types/rrweb.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,5 @@ export type recordOptions = {
3636
maskTextClass?: maskTextClass;
3737
maskTextSelector?: string;
3838
blockSelector?: string;
39+
maskInputOptions?: Record<string, boolean>;
3940
} & Record<string, unknown>;

packages/replay/src/util/getPrivacyOptions.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { DeprecatedPrivacyOptions, ReplayIntegrationPrivacyOptions } from '../types';
22

3-
type GetPrivacyOptions = Required<Omit<ReplayIntegrationPrivacyOptions, 'maskFn'>> & DeprecatedPrivacyOptions;
3+
type GetPrivacyOptions = Required<Omit<ReplayIntegrationPrivacyOptions, 'maskFn'>> &
4+
Omit<DeprecatedPrivacyOptions, 'maskInputOptions'>;
45
interface GetPrivacyReturn {
56
maskTextSelector: string;
67
unmaskTextSelector: string;

packages/replay/test/integration/rrweb.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ describe('Integration | rrweb', () => {
2525
"inlineStylesheet": true,
2626
"maskAllInputs": true,
2727
"maskInputFn": undefined,
28+
"maskInputOptions": Object {
29+
"password": true,
30+
},
2831
"maskInputSelector": ".sentry-mask,[data-sentry-mask]",
2932
"maskTextFn": undefined,
3033
"maskTextSelector": "body *:not(style), body *:not(script)",

0 commit comments

Comments
 (0)