URL masking
URL masking
The SDK masks the values of sensitive parameters in the URLs it reports, such as token,
password, code and state, in both the query and the fragment. A request to
https://example.com/callback?code=abc#access_token=xyz is reported as
https://example.com/callback?code=[REDACTED]#access_token=[REDACTED]. This applies to network
requests, view names and URLs inside error messages, and you cannot turn it off.
Starting with version 0.22.0, set urlMasking to mask more parameters or to change how URLs are
reported:
import 'package:cx_flutter_plugin/cx_domain.dart';
import 'package:cx_flutter_plugin/cx_exporter_options.dart';
import 'package:cx_flutter_plugin/cx_url_masking.dart';
var options = CXExporterOptions(
coralogixDomain: CXDomain.eu2,
environment: 'production',
application: 'my-app',
version: '1.0.0',
publicKey: '<PublicKey>',
enableSwizzling: true,
urlMasking: const CxUrlMaskingOptions(
params: ['tenant_id'],
paramPatterns: [r'^x-internal-'],
mode: CxUrlMaskingMode.mask,
),
);
| Field | Type | Description |
|---|---|---|
params | List<String> | More parameter names to mask. A name matches as a whole, ignoring case and every non-alphanumeric character, so tenant_id also masks TenantId and tenant-id. |
paramPatterns | List<String> | Regular expressions tested against each parameter name. iOS compiles them as ICU and Android as Java regular expressions, so keep to syntax both support. A pattern that does not compile is ignored on that platform, with a warning in the native log. |
mode | CxUrlMaskingMode | mask (default) masks sensitive values only, maskAll masks every parameter value and keeps the names, and dropQuery reports URLs without their query and fragment. |
These options add to the built-in rules; they never remove one.
Warning
URL masking does not touch headers. A header is captured only when you list it in
networkCaptureConfig, and it is captured as-is, Authorization included.
Last updated on