@datadog/mobile-react-native 3.11.0 → 3.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DatadogSDKReactNative.podspec +357 -14
- package/README.md +5 -3
- package/android/build.gradle +23 -14
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfiguration.kt +27 -2
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkConfigurationExt.kt +27 -2
- package/android/src/main/kotlin/com/datadog/reactnative/DdSdkNativeInitialization.kt +25 -0
- package/android/src/main/kotlin/com/datadog/reactnative/SdkVersion.kt +1 -1
- package/android/src/test/kotlin/com/datadog/reactnative/DdSdkNativeInitializationTest.kt +4 -0
- package/android/src/test/kotlin/com/datadog/reactnative/DdSdkTest.kt +104 -0
- package/android/src/test/kotlin/com/datadog/tools/unit/DdSdkConfigurationExt.kt +8 -0
- package/android/src/test/resources/input/complete-configuration.json +5 -0
- package/datadog-configuration.gradle +59 -18
- package/datadog-configuration.schema.json +140 -0
- package/ios/Sources/DdFlagsImplementation.swift +3 -0
- package/ios/Sources/DdSdkConfiguration.swift +11 -1
- package/ios/Sources/DdSdkNativeInitialization.swift +24 -2
- package/ios/Sources/RNDdSdkConfiguration.swift +14 -2
- package/ios/Sources/SdkVersion.swift +1 -1
- package/lib/commonjs/DdSdkReactNative.js +6 -1
- package/lib/commonjs/DdSdkReactNative.js.map +1 -1
- package/lib/commonjs/config/FileBasedConfiguration.js +4 -1
- package/lib/commonjs/config/FileBasedConfiguration.js.map +1 -1
- package/lib/commonjs/config/async/AutoInstrumentationConfiguration.js +3 -1
- package/lib/commonjs/config/async/AutoInstrumentationConfiguration.js.map +1 -1
- package/lib/commonjs/config/features/RumConfiguration.js +8 -0
- package/lib/commonjs/config/features/RumConfiguration.js.map +1 -1
- package/lib/commonjs/config/features/RumConfigurationNative.js +4 -0
- package/lib/commonjs/config/types/TimeseriesConfiguration.js +25 -0
- package/lib/commonjs/config/types/TimeseriesConfiguration.js.map +1 -0
- package/lib/commonjs/config/types/index.js +7 -0
- package/lib/commonjs/config/types/index.js.map +1 -1
- package/lib/commonjs/flags/DdFlags.js +4 -2
- package/lib/commonjs/flags/DdFlags.js.map +1 -1
- package/lib/commonjs/flags/FlagsClient.js +4 -2
- package/lib/commonjs/flags/FlagsClient.js.map +1 -1
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/internal.js +97 -0
- package/lib/commonjs/internal.js.map +1 -0
- package/lib/commonjs/logs/DdLogs.js +4 -2
- package/lib/commonjs/logs/DdLogs.js.map +1 -1
- package/lib/commonjs/rum/DdRum.js +4 -2
- package/lib/commonjs/rum/DdRum.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js +20 -15
- package/lib/commonjs/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/DdRumResourceTracking.js +5 -2
- package/lib/commonjs/rum/instrumentation/resourceTracking/DdRumResourceTracking.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js +2 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/README.md +142 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/captureHeaders.js +308 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/captureHeaders.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/compileHeaderConfig.js +275 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/compileHeaderConfig.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/enforceSizeLimits.js +167 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/enforceSizeLimits.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/isHeaderAllowed.js +36 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/isHeaderAllowed.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/normalizeUrlForMatching.js +158 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/normalizeUrlForMatching.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/parseResponseHeaders.js +58 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/parseResponseHeaders.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/sensitiveHeaderBlocklist.js +39 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/sensitiveHeaderBlocklist.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/tracingHeaderExclusion.js +38 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/tracingHeaderExclusion.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/types.js +2 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/types.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/FetchProxy/FetchProxy.js +17 -2
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/FetchProxy/FetchProxy.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js +25 -3
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js +2 -35
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/common/RequestContext.js +3 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/common/RequestContext.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/common/ResourceReporter.js +8 -2
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/common/ResourceReporter.js.map +1 -1
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/common/headerCapture.js +88 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/common/headerCapture.js.map +1 -0
- package/lib/commonjs/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.js.map +1 -1
- package/lib/commonjs/sdk/DatadogEventEmitter/DatadogDefaultEventEmitter.js +2 -3
- package/lib/commonjs/sdk/DatadogEventEmitter/DatadogDefaultEventEmitter.js.map +1 -1
- package/lib/commonjs/sdk/DdSdkInternal.js +27 -22
- package/lib/commonjs/sdk/DdSdkInternal.js.map +1 -1
- package/lib/commonjs/specs/NativeDdFlags.js +19 -3
- package/lib/commonjs/specs/NativeDdFlags.js.map +1 -1
- package/lib/commonjs/specs/NativeDdLogs.js +19 -3
- package/lib/commonjs/specs/NativeDdLogs.js.map +1 -1
- package/lib/commonjs/specs/NativeDdRum.js +19 -3
- package/lib/commonjs/specs/NativeDdRum.js.map +1 -1
- package/lib/commonjs/specs/NativeDdSdk.js +19 -3
- package/lib/commonjs/specs/NativeDdSdk.js.map +1 -1
- package/lib/commonjs/specs/NativeDdTrace.js +19 -3
- package/lib/commonjs/specs/NativeDdTrace.js.map +1 -1
- package/lib/commonjs/trace/DdTrace.js +4 -2
- package/lib/commonjs/trace/DdTrace.js.map +1 -1
- package/lib/commonjs/utils/stringUtils.js +48 -0
- package/lib/commonjs/utils/stringUtils.js.map +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/module/DdSdkReactNative.js +6 -1
- package/lib/module/DdSdkReactNative.js.map +1 -1
- package/lib/module/config/FileBasedConfiguration.js +4 -1
- package/lib/module/config/FileBasedConfiguration.js.map +1 -1
- package/lib/module/config/async/AutoInstrumentationConfiguration.js +3 -1
- package/lib/module/config/async/AutoInstrumentationConfiguration.js.map +1 -1
- package/lib/module/config/features/RumConfiguration.js +8 -0
- package/lib/module/config/features/RumConfiguration.js.map +1 -1
- package/lib/module/config/features/RumConfigurationNative.js +1 -1
- package/lib/module/config/types/TimeseriesConfiguration.js +19 -0
- package/lib/module/config/types/TimeseriesConfiguration.js.map +1 -0
- package/lib/module/config/types/index.js +1 -0
- package/lib/module/config/types/index.js.map +1 -1
- package/lib/module/flags/DdFlags.js +4 -2
- package/lib/module/flags/DdFlags.js.map +1 -1
- package/lib/module/flags/FlagsClient.js +5 -2
- package/lib/module/flags/FlagsClient.js.map +1 -1
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/internal.js +27 -0
- package/lib/module/internal.js.map +1 -0
- package/lib/module/logs/DdLogs.js +4 -2
- package/lib/module/logs/DdLogs.js.map +1 -1
- package/lib/module/rum/DdRum.js +4 -2
- package/lib/module/rum/DdRum.js.map +1 -1
- package/lib/module/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js +20 -14
- package/lib/module/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/DdRumResourceTracking.js +5 -2
- package/lib/module/rum/instrumentation/resourceTracking/DdRumResourceTracking.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/README.md +142 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/captureHeaders.js +298 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/captureHeaders.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/compileHeaderConfig.js +268 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/compileHeaderConfig.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/enforceSizeLimits.js +160 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/enforceSizeLimits.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/isHeaderAllowed.js +30 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/isHeaderAllowed.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/normalizeUrlForMatching.js +150 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/normalizeUrlForMatching.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/parseResponseHeaders.js +51 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/parseResponseHeaders.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/sensitiveHeaderBlocklist.js +32 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/sensitiveHeaderBlocklist.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/tracingHeaderExclusion.js +32 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/tracingHeaderExclusion.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/types.js +2 -0
- package/lib/module/rum/instrumentation/resourceTracking/headerCapture/types.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/FetchProxy/FetchProxy.js +17 -2
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/FetchProxy/FetchProxy.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js +25 -3
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js +1 -34
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/common/RequestContext.js +3 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/common/RequestContext.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/common/ResourceReporter.js +8 -2
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/common/ResourceReporter.js.map +1 -1
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/common/headerCapture.js +79 -0
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/common/headerCapture.js.map +1 -0
- package/lib/module/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.js.map +1 -1
- package/lib/module/sdk/DatadogEventEmitter/DatadogDefaultEventEmitter.js +2 -3
- package/lib/module/sdk/DatadogEventEmitter/DatadogDefaultEventEmitter.js.map +1 -1
- package/lib/module/sdk/DdSdkInternal.js +27 -22
- package/lib/module/sdk/DdSdkInternal.js.map +1 -1
- package/lib/module/specs/NativeDdFlags.js +14 -2
- package/lib/module/specs/NativeDdFlags.js.map +1 -1
- package/lib/module/specs/NativeDdLogs.js +14 -2
- package/lib/module/specs/NativeDdLogs.js.map +1 -1
- package/lib/module/specs/NativeDdRum.js +14 -2
- package/lib/module/specs/NativeDdRum.js.map +1 -1
- package/lib/module/specs/NativeDdSdk.js +14 -2
- package/lib/module/specs/NativeDdSdk.js.map +1 -1
- package/lib/module/specs/NativeDdTrace.js +14 -2
- package/lib/module/specs/NativeDdTrace.js.map +1 -1
- package/lib/module/trace/DdTrace.js +4 -2
- package/lib/module/trace/DdTrace.js.map +1 -1
- package/lib/module/utils/stringUtils.js +42 -0
- package/lib/module/utils/stringUtils.js.map +1 -0
- package/lib/module/version.js +1 -1
- package/lib/typescript/DdSdkReactNative.d.ts.map +1 -1
- package/lib/typescript/config/FileBasedConfiguration.d.ts.map +1 -1
- package/lib/typescript/config/FileBasedConfiguration.type.d.ts +4 -1
- package/lib/typescript/config/FileBasedConfiguration.type.d.ts.map +1 -1
- package/lib/typescript/config/async/AutoInstrumentationConfiguration.d.ts +6 -0
- package/lib/typescript/config/async/AutoInstrumentationConfiguration.d.ts.map +1 -1
- package/lib/typescript/config/async/PartialInitializationConfiguration.d.ts +2 -1
- package/lib/typescript/config/async/PartialInitializationConfiguration.d.ts.map +1 -1
- package/lib/typescript/config/features/RumConfiguration.d.ts +6 -1
- package/lib/typescript/config/features/RumConfiguration.d.ts.map +1 -1
- package/lib/typescript/config/features/RumConfiguration.type.d.ts +116 -1
- package/lib/typescript/config/features/RumConfiguration.type.d.ts.map +1 -1
- package/lib/typescript/config/features/RumConfigurationNative.d.ts +2 -0
- package/lib/typescript/config/features/RumConfigurationNative.d.ts.map +1 -1
- package/lib/typescript/config/types/TimeseriesConfiguration.d.ts +19 -0
- package/lib/typescript/config/types/TimeseriesConfiguration.d.ts.map +1 -0
- package/lib/typescript/config/types/index.d.ts +2 -0
- package/lib/typescript/config/types/index.d.ts.map +1 -1
- package/lib/typescript/flags/DdFlags.d.ts.map +1 -1
- package/lib/typescript/flags/FlagsClient.d.ts +1 -1
- package/lib/typescript/flags/FlagsClient.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +5 -2
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/internal.d.ts +26 -0
- package/lib/typescript/internal.d.ts.map +1 -0
- package/lib/typescript/logs/DdLogs.d.ts +1 -1
- package/lib/typescript/logs/DdLogs.d.ts.map +1 -1
- package/lib/typescript/rum/DdRum.d.ts +1 -1
- package/lib/typescript/rum/DdRum.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts +3 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/DdRumResourceTracking.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.d.ts +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/captureHeaders.d.ts +85 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/captureHeaders.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/compileHeaderConfig.d.ts +18 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/compileHeaderConfig.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/enforceSizeLimits.d.ts +24 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/enforceSizeLimits.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/isHeaderAllowed.d.ts +12 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/isHeaderAllowed.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/normalizeUrlForMatching.d.ts +28 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/normalizeUrlForMatching.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/parseResponseHeaders.d.ts +16 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/parseResponseHeaders.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/sensitiveHeaderBlocklist.d.ts +13 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/sensitiveHeaderBlocklist.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/tracingHeaderExclusion.d.ts +13 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/tracingHeaderExclusion.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/types.d.ts +27 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/headerCapture/types.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/FetchProxy/FetchProxy.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/common/RequestContext.d.ts +2 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/common/RequestContext.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/common/headerCapture.d.ts +43 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/common/headerCapture.d.ts.map +1 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.d.ts +2 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.d.ts.map +1 -1
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts +2 -0
- package/lib/typescript/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.d.ts.map +1 -1
- package/lib/typescript/sdk/DatadogEventEmitter/DatadogDefaultEventEmitter.d.ts.map +1 -1
- package/lib/typescript/sdk/DdSdkInternal.d.ts +1 -0
- package/lib/typescript/sdk/DdSdkInternal.d.ts.map +1 -1
- package/lib/typescript/specs/NativeDdFlags.d.ts +7 -2
- package/lib/typescript/specs/NativeDdFlags.d.ts.map +1 -1
- package/lib/typescript/specs/NativeDdLogs.d.ts +7 -2
- package/lib/typescript/specs/NativeDdLogs.d.ts.map +1 -1
- package/lib/typescript/specs/NativeDdRum.d.ts +7 -2
- package/lib/typescript/specs/NativeDdRum.d.ts.map +1 -1
- package/lib/typescript/specs/NativeDdSdk.d.ts +7 -2
- package/lib/typescript/specs/NativeDdSdk.d.ts.map +1 -1
- package/lib/typescript/specs/NativeDdTrace.d.ts +7 -2
- package/lib/typescript/specs/NativeDdTrace.d.ts.map +1 -1
- package/lib/typescript/trace/DdTrace.d.ts.map +1 -1
- package/lib/typescript/utils/stringUtils.d.ts +12 -0
- package/lib/typescript/utils/stringUtils.d.ts.map +1 -0
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +8 -3
- package/src/DdSdkReactNative.tsx +11 -1
- package/src/__tests__/DdSdkReactNative.test.tsx +145 -20
- package/src/__tests__/DdSdkReactNativeConfiguration.test.ts +6 -0
- package/src/__tests__/internalEntry.test.ts +26 -0
- package/src/__tests__/mock.test.ts +1 -3
- package/src/__tests__/nativeSpecGetters.test.ts +102 -0
- package/src/__tests__/rum/instrumentation/DdRumUserInteractionTracking.test.tsx +3 -3
- package/src/__tests__/wrapperImportSafety.test.ts +129 -0
- package/src/config/FileBasedConfiguration.ts +6 -1
- package/src/config/FileBasedConfiguration.type.ts +4 -0
- package/src/config/__tests__/FileBasedConfiguration.test.ts +73 -0
- package/src/config/__tests__/__fixtures__/configuration-all-fields.json +14 -1
- package/src/config/async/AutoInstrumentationConfiguration.ts +9 -1
- package/src/config/async/PartialInitializationConfiguration.ts +2 -0
- package/src/config/features/RumConfiguration.ts +15 -0
- package/src/config/features/RumConfiguration.type.ts +128 -1
- package/src/config/features/RumConfigurationNative.ts +3 -0
- package/src/config/types/TimeseriesConfiguration.ts +26 -0
- package/src/config/types/index.ts +5 -0
- package/src/flags/DdFlags.ts +4 -3
- package/src/flags/FlagsClient.ts +4 -3
- package/src/index.tsx +15 -0
- package/src/internal.ts +32 -0
- package/src/logs/DdLogs.ts +4 -3
- package/src/rum/DdRum.ts +4 -3
- package/src/rum/__tests__/DdRum.test.ts +4 -4
- package/src/rum/instrumentation/interactionTracking/DdBabelInteractionTracking.ts +33 -26
- package/src/rum/instrumentation/interactionTracking/__tests__/BabelOptionalHandlers.test.ts +120 -0
- package/src/rum/instrumentation/interactionTracking/__tests__/DdBabelInteractionTracking.test.ts +82 -2
- package/src/rum/instrumentation/resourceTracking/DdRumResourceTracking.tsx +7 -2
- package/src/rum/instrumentation/resourceTracking/__tests__/DdRumResourceTracking.test.ts +46 -0
- package/src/rum/instrumentation/resourceTracking/__tests__/__utils__/XMLHttpRequestMock.ts +1 -1
- package/src/rum/instrumentation/resourceTracking/distributedTracing/firstPartyHosts.ts +1 -1
- package/src/rum/instrumentation/resourceTracking/headerCapture/README.md +142 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/__tests__/captureHeaders.test.ts +853 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/__tests__/compileHeaderConfig.test.ts +697 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/__tests__/enforceSizeLimits.integration.test.ts +183 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/__tests__/enforceSizeLimits.test.ts +337 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/__tests__/isHeaderAllowed.test.ts +35 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/__tests__/normalizeUrlForMatching.test.ts +176 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/__tests__/parseResponseHeaders.test.ts +114 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/__tests__/sensitiveHeaderBlocklist.test.ts +112 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/__tests__/tracingHeaderExclusion.test.ts +59 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/captureHeaders.ts +437 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/compileHeaderConfig.ts +339 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/enforceSizeLimits.ts +208 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/isHeaderAllowed.ts +29 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/normalizeUrlForMatching.ts +181 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/parseResponseHeaders.ts +59 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/sensitiveHeaderBlocklist.ts +31 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/tracingHeaderExclusion.ts +61 -0
- package/src/rum/instrumentation/resourceTracking/headerCapture/types.ts +33 -0
- package/src/rum/instrumentation/resourceTracking/requestProxy/FetchProxy/FetchProxy.ts +21 -2
- package/src/rum/instrumentation/resourceTracking/requestProxy/FetchProxy/__tests__/FetchProxy.test.ts +274 -0
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/DatadogRumResource/__tests__/ResourceReporter.test.ts +120 -0
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/XHRProxy.ts +34 -3
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/__tests__/XHRProxy.test.ts +624 -2
- package/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy/baggageHeaderUtils.ts +1 -34
- package/src/rum/instrumentation/resourceTracking/requestProxy/common/RequestContext.ts +6 -1
- package/src/rum/instrumentation/resourceTracking/requestProxy/common/ResourceReporter.ts +16 -2
- package/src/rum/instrumentation/resourceTracking/requestProxy/common/__tests__/headerCapture.test.ts +164 -0
- package/src/rum/instrumentation/resourceTracking/requestProxy/common/headerCapture.ts +119 -0
- package/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RequestProxy.ts +2 -0
- package/src/rum/instrumentation/resourceTracking/requestProxy/interfaces/RumResource.ts +2 -0
- package/src/sdk/DatadogEventEmitter/DatadogDefaultEventEmitter.tsx +3 -4
- package/src/sdk/DatadogInternalBridge/__tests__/DdSdkNativeBridge.test.tsx +35 -2
- package/src/sdk/DatadogProvider/Buffer/__tests__/BoundedBuffer.test.ts +5 -5
- package/src/sdk/DatadogProvider/__tests__/initialization.test.tsx +54 -1
- package/src/sdk/DdSdkInternal.ts +27 -24
- package/src/sdk/EventMappers/__tests__/EventMapper.test.ts +2 -2
- package/src/specs/NativeDdFlags.ts +14 -2
- package/src/specs/NativeDdLogs.ts +14 -2
- package/src/specs/NativeDdRum.ts +14 -2
- package/src/specs/NativeDdSdk.ts +14 -2
- package/src/specs/NativeDdTrace.ts +14 -2
- package/src/trace/DdTrace.ts +4 -3
- package/src/utils/__tests__/stringUtils.test.ts +90 -0
- package/src/utils/stringUtils.ts +41 -0
- package/src/version.ts +1 -1
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.filterResponseHeaders = exports.filterRequestHeadersByMode = exports.captureResponseHeaders = exports.accumulateRequestHeader = exports.DEFAULT_RESPONSE_HEADERS = exports.DEFAULT_REQUEST_HEADERS = exports.CANONICAL_RESPONSE_HEADERS = exports.CANONICAL_REQUEST_HEADERS = void 0;
|
|
7
|
+
var _InternalLog = require("../../../../InternalLog");
|
|
8
|
+
var _types = require("../../../../config/types");
|
|
9
|
+
var _isHeaderAllowed = require("./isHeaderAllowed");
|
|
10
|
+
var _normalizeUrlForMatching = require("./normalizeUrlForMatching");
|
|
11
|
+
var _parseResponseHeaders = require("./parseResponseHeaders");
|
|
12
|
+
/*
|
|
13
|
+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
14
|
+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
15
|
+
* Copyright 2016-Present Datadog, Inc.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const TAG = '[DatadogRUM][HeaderCapture]';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Default response header names captured in 'defaults' mode.
|
|
22
|
+
* Lowercased for direct comparison with parseResponseHeaders output.
|
|
23
|
+
*/
|
|
24
|
+
const DEFAULT_RESPONSE_HEADERS = exports.DEFAULT_RESPONSE_HEADERS = new Set(['cache-control', 'etag', 'age', 'expires', 'content-type', 'content-encoding', 'content-length', 'vary', 'server-timing', 'x-cache']);
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Default request header names captured in 'defaults' mode.
|
|
28
|
+
* Lowercased for direct comparison with accumulated header names.
|
|
29
|
+
*/
|
|
30
|
+
const DEFAULT_REQUEST_HEADERS = exports.DEFAULT_REQUEST_HEADERS = new Set(['cache-control', 'content-type']);
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Canonical RFC Title-Case casing for default response headers.
|
|
34
|
+
* Static map -- explicit lookup, no auto-capitalization.
|
|
35
|
+
* Key: lowercased name, Value: Title-Case name.
|
|
36
|
+
*/
|
|
37
|
+
const CANONICAL_RESPONSE_HEADERS = exports.CANONICAL_RESPONSE_HEADERS = new Map([['cache-control', 'Cache-Control'], ['etag', 'ETag'], ['age', 'Age'], ['expires', 'Expires'], ['content-type', 'Content-Type'], ['content-encoding', 'Content-Encoding'], ['content-length', 'Content-Length'], ['vary', 'Vary'], ['server-timing', 'Server-Timing'], ['x-cache', 'X-Cache']]);
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Canonical RFC Title-Case casing for default request headers.
|
|
41
|
+
* Key: lowercased name, Value: Title-Case name.
|
|
42
|
+
*/
|
|
43
|
+
const CANONICAL_REQUEST_HEADERS = exports.CANONICAL_REQUEST_HEADERS = new Map([['cache-control', 'Cache-Control'], ['content-type', 'Content-Type']]);
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Filters a header record to only entries in the allowed set, applying
|
|
47
|
+
* casing from the provided casing map.
|
|
48
|
+
*
|
|
49
|
+
* Output key resolution:
|
|
50
|
+
* - If the input key has non-lowered casing (e.g. from setRequestHeader), use it as-is
|
|
51
|
+
* - Otherwise, look up the casing map for config-provided casing
|
|
52
|
+
* - Falls back to lowered name if neither provides casing
|
|
53
|
+
*
|
|
54
|
+
* This handles both directions:
|
|
55
|
+
* - Response headers: input keys are lowered (from parseResponseHeaders), so casing map provides output casing
|
|
56
|
+
* - Request headers: input keys preserve setRequestHeader casing, which takes priority
|
|
57
|
+
*
|
|
58
|
+
* Returns undefined if no entries survive filtering (locked decision: no empty objects).
|
|
59
|
+
*
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
const filterWithCasing = (headers, allowedSet, casingMap) => {
|
|
63
|
+
const filtered = {};
|
|
64
|
+
let hasEntries = false;
|
|
65
|
+
for (const [name, value] of Object.entries(headers)) {
|
|
66
|
+
const lowered = name.toLowerCase();
|
|
67
|
+
if (allowedSet.has(lowered)) {
|
|
68
|
+
// Use original key casing if different from lowered (request headers),
|
|
69
|
+
// otherwise fall back to casing map, otherwise use lowered
|
|
70
|
+
const outputKey = name !== lowered ? name // original casing from accumulator
|
|
71
|
+
: casingMap.get(lowered) ?? lowered;
|
|
72
|
+
filtered[outputKey] = value;
|
|
73
|
+
hasEntries = true;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return hasEntries ? filtered : undefined;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Loops over compiled rules, finds all that match the given URL,
|
|
81
|
+
* and merges their header name sets additively (union).
|
|
82
|
+
*
|
|
83
|
+
* Scoped-replaces-catch-all: if any rule with isScoped=true matches
|
|
84
|
+
* the URL, all catch-all (isScoped=false) rules are ignored.
|
|
85
|
+
* Multiple scoped rules matching the same URL merge additively.
|
|
86
|
+
*
|
|
87
|
+
* @param rules - The compiled rule array.
|
|
88
|
+
* @param url - The request URL to match against.
|
|
89
|
+
* @param field - Which header set to merge ('requestHeaderNames' or 'responseHeaderNames').
|
|
90
|
+
* @returns The merged Set of header names, or an empty Set if no rules match.
|
|
91
|
+
*/
|
|
92
|
+
const mergeMatchingHeaderNames = (rules, url, field) => {
|
|
93
|
+
const scopedMatches = new Set();
|
|
94
|
+
const catchAllMatches = new Set();
|
|
95
|
+
let hasScopedMatch = false;
|
|
96
|
+
for (const rule of rules) {
|
|
97
|
+
if (rule.urlRegex.test(url)) {
|
|
98
|
+
if (rule.isScoped) {
|
|
99
|
+
hasScopedMatch = true;
|
|
100
|
+
for (const name of rule[field]) {
|
|
101
|
+
scopedMatches.add(name);
|
|
102
|
+
}
|
|
103
|
+
} else {
|
|
104
|
+
for (const name of rule[field]) {
|
|
105
|
+
catchAllMatches.add(name);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return hasScopedMatch ? scopedMatches : catchAllMatches;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Merges casing maps from all matching rules into a single Map.
|
|
115
|
+
* Uses the same scoped-replaces-catch-all logic as mergeMatchingHeaderNames.
|
|
116
|
+
*
|
|
117
|
+
* Casing precedence:
|
|
118
|
+
* - Scoped rules: first-declared wins (among custom rules, first casing is kept)
|
|
119
|
+
* - Catch-all rules: last-declared wins (custom rules override defaults' casing
|
|
120
|
+
* since defaults is typically declared first in the config array)
|
|
121
|
+
*
|
|
122
|
+
* @param rules - The compiled rule array.
|
|
123
|
+
* @param url - The request URL to match against.
|
|
124
|
+
* @param field - Which casing map to merge ('requestHeaderCasing' or 'responseHeaderCasing').
|
|
125
|
+
* @returns The merged casing Map, or an empty Map if no rules match.
|
|
126
|
+
*/
|
|
127
|
+
const mergeCasingMaps = (rules, url, field) => {
|
|
128
|
+
const scopedMap = new Map();
|
|
129
|
+
const catchAllMap = new Map();
|
|
130
|
+
let hasScopedMatch = false;
|
|
131
|
+
for (const rule of rules) {
|
|
132
|
+
if (rule.urlRegex.test(url)) {
|
|
133
|
+
if (rule.isScoped) {
|
|
134
|
+
hasScopedMatch = true;
|
|
135
|
+
// First-declared wins for scoped rules
|
|
136
|
+
for (const [lowered, original] of rule[field]) {
|
|
137
|
+
if (!scopedMap.has(lowered)) {
|
|
138
|
+
scopedMap.set(lowered, original);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
} else {
|
|
142
|
+
// Last-declared wins for catch-all rules
|
|
143
|
+
// (ensures custom rules override defaults' casing)
|
|
144
|
+
for (const [lowered, original] of rule[field]) {
|
|
145
|
+
catchAllMap.set(lowered, original);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return hasScopedMatch ? scopedMap : catchAllMap;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Accumulates a single request header into the capture store.
|
|
155
|
+
* Applies security filtering at capture time (locked decision: sensitive
|
|
156
|
+
* headers never stored in memory).
|
|
157
|
+
*
|
|
158
|
+
* Mutates the accumulator in place for performance — no allocation per call.
|
|
159
|
+
* Last-value-wins semantics for duplicate header names.
|
|
160
|
+
*
|
|
161
|
+
* @param accumulator - Mutable record to store captured headers.
|
|
162
|
+
* @param headerName - The header name as provided by setRequestHeader (any case).
|
|
163
|
+
* @param headerValue - The header value string.
|
|
164
|
+
*/
|
|
165
|
+
const accumulateRequestHeader = (accumulator, headerName, headerValue) => {
|
|
166
|
+
const lowered = headerName.toLowerCase();
|
|
167
|
+
if ((0, _isHeaderAllowed.isHeaderAllowed)(lowered)) {
|
|
168
|
+
// Remove any existing entry with different casing for same header
|
|
169
|
+
// (last-value-wins: both value and casing from latest call)
|
|
170
|
+
// for...in avoids allocating a keys array on the request hot path
|
|
171
|
+
// eslint-disable-next-line guard-for-in
|
|
172
|
+
for (const existing in accumulator) {
|
|
173
|
+
if (existing.toLowerCase() === lowered) {
|
|
174
|
+
delete accumulator[existing];
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
accumulator[headerName] = headerValue;
|
|
179
|
+
_InternalLog.InternalLog.log(`${TAG} Accumulated request header "${headerName}"`, _types.SdkVerbosity.DEBUG);
|
|
180
|
+
} else {
|
|
181
|
+
_InternalLog.InternalLog.log(`${TAG} Request header "${headerName}" blocked by security filter`, _types.SdkVerbosity.DEBUG);
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Captures response headers from a raw getAllResponseHeaders() string.
|
|
187
|
+
* Applies security filtering first (defense in depth), then filters by
|
|
188
|
+
* the union of all matching compiled rules' response header sets.
|
|
189
|
+
*
|
|
190
|
+
* Returns undefined if:
|
|
191
|
+
* - Config is null (disabled)
|
|
192
|
+
* - rawHeaders is null/undefined/empty
|
|
193
|
+
* - No headers survive security filtering
|
|
194
|
+
* - No compiled rules match the URL
|
|
195
|
+
* - No headers survive rule-based filtering
|
|
196
|
+
*
|
|
197
|
+
* (Locked decision: no empty objects — undefined or absent, not `{}`.)
|
|
198
|
+
*
|
|
199
|
+
* @param rawHeaders - The raw CRLF string from getAllResponseHeaders().
|
|
200
|
+
* @param url - The full request URL for rule matching.
|
|
201
|
+
* @param config - The compiled header capture configuration.
|
|
202
|
+
* @returns Filtered response headers, or undefined.
|
|
203
|
+
*/
|
|
204
|
+
exports.accumulateRequestHeader = accumulateRequestHeader;
|
|
205
|
+
const captureResponseHeaders = (rawHeaders, url, config) => {
|
|
206
|
+
if (config === null) {
|
|
207
|
+
return undefined;
|
|
208
|
+
}
|
|
209
|
+
return filterResponseHeaders((0, _parseResponseHeaders.parseResponseHeaders)(rawHeaders, _isHeaderAllowed.isHeaderAllowed), url, config);
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Filters already-parsed response headers (lowercased names) the same way
|
|
214
|
+
* as {@link captureResponseHeaders}. Used by request proxies whose response
|
|
215
|
+
* headers are not exposed as a raw string (e.g. Fetch `Headers`).
|
|
216
|
+
*
|
|
217
|
+
* @param allHeaders - Response headers keyed by lowercased name.
|
|
218
|
+
* @param url - The full request URL for rule matching.
|
|
219
|
+
* @param config - The compiled header capture configuration.
|
|
220
|
+
* @returns Filtered response headers, or undefined.
|
|
221
|
+
*/
|
|
222
|
+
exports.captureResponseHeaders = captureResponseHeaders;
|
|
223
|
+
const filterResponseHeaders = (allHeaders, url, config) => {
|
|
224
|
+
if (config === null) {
|
|
225
|
+
return undefined;
|
|
226
|
+
}
|
|
227
|
+
const allCount = Object.keys(allHeaders).length;
|
|
228
|
+
if (allCount === 0) {
|
|
229
|
+
_InternalLog.InternalLog.log(`${TAG} No response headers to capture for ${url}`, _types.SdkVerbosity.DEBUG);
|
|
230
|
+
return undefined;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// Security filter first — defense in depth
|
|
234
|
+
const securityFiltered = {};
|
|
235
|
+
const blocked = [];
|
|
236
|
+
for (const [name, value] of Object.entries(allHeaders)) {
|
|
237
|
+
if ((0, _isHeaderAllowed.isHeaderAllowed)(name)) {
|
|
238
|
+
securityFiltered[name] = value;
|
|
239
|
+
} else {
|
|
240
|
+
blocked.push(name);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
if (blocked.length > 0) {
|
|
244
|
+
_InternalLog.InternalLog.log(`${TAG} Response headers blocked by security filter for ${url}: [${blocked.join(', ')}]`, _types.SdkVerbosity.DEBUG);
|
|
245
|
+
}
|
|
246
|
+
if (Object.keys(securityFiltered).length === 0) {
|
|
247
|
+
return undefined;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// Merge all matching rules' response header sets (union)
|
|
251
|
+
const matchUrl = (0, _normalizeUrlForMatching.normalizeUrlForMatching)(url);
|
|
252
|
+
const allowedHeaders = mergeMatchingHeaderNames(config, matchUrl, 'responseHeaderNames');
|
|
253
|
+
if (allowedHeaders.size === 0) {
|
|
254
|
+
_InternalLog.InternalLog.log(`${TAG} No rules matched ${url} for response headers — nothing captured`, _types.SdkVerbosity.DEBUG);
|
|
255
|
+
return undefined;
|
|
256
|
+
}
|
|
257
|
+
const casingMap = mergeCasingMaps(config, matchUrl, 'responseHeaderCasing');
|
|
258
|
+
const result = filterWithCasing(securityFiltered, allowedHeaders, casingMap);
|
|
259
|
+
if (result === undefined) {
|
|
260
|
+
_InternalLog.InternalLog.log(`${TAG} No response headers survived rule filtering for ${url}`, _types.SdkVerbosity.DEBUG);
|
|
261
|
+
} else {
|
|
262
|
+
_InternalLog.InternalLog.log(`${TAG} Captured ${Object.keys(result).length}/${allCount} response headers for ${url}: [${Object.keys(result).join(', ')}]`, _types.SdkVerbosity.DEBUG);
|
|
263
|
+
}
|
|
264
|
+
return result;
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Filters accumulated request headers by compiled rule matching.
|
|
269
|
+
*
|
|
270
|
+
* Called at request completion (DONE state) when the URL is final.
|
|
271
|
+
* Request headers are accumulated during setRequestHeader calls and
|
|
272
|
+
* filtered here to the union of all matching rules' request header sets.
|
|
273
|
+
*
|
|
274
|
+
* Returns undefined if:
|
|
275
|
+
* - Config is null (disabled)
|
|
276
|
+
* - No compiled rules match the URL
|
|
277
|
+
* - No headers survive rule-based filtering
|
|
278
|
+
*
|
|
279
|
+
* @param headers - The accumulated request headers (already security-filtered).
|
|
280
|
+
* @param url - The final request URL for rule matching.
|
|
281
|
+
* @param config - The compiled header capture configuration.
|
|
282
|
+
* @returns Filtered request headers, or undefined.
|
|
283
|
+
*/
|
|
284
|
+
exports.filterResponseHeaders = filterResponseHeaders;
|
|
285
|
+
const filterRequestHeadersByMode = (headers, url, config) => {
|
|
286
|
+
if (config === null) {
|
|
287
|
+
return undefined;
|
|
288
|
+
}
|
|
289
|
+
const accumulatedCount = Object.keys(headers).length;
|
|
290
|
+
|
|
291
|
+
// Merge all matching rules' request header sets (union)
|
|
292
|
+
const matchUrl = (0, _normalizeUrlForMatching.normalizeUrlForMatching)(url);
|
|
293
|
+
const allowedHeaders = mergeMatchingHeaderNames(config, matchUrl, 'requestHeaderNames');
|
|
294
|
+
if (allowedHeaders.size === 0) {
|
|
295
|
+
_InternalLog.InternalLog.log(`${TAG} No rules matched ${url} for request headers — nothing captured`, _types.SdkVerbosity.DEBUG);
|
|
296
|
+
return undefined;
|
|
297
|
+
}
|
|
298
|
+
const casingMap = mergeCasingMaps(config, matchUrl, 'requestHeaderCasing');
|
|
299
|
+
const result = filterWithCasing(headers, allowedHeaders, casingMap);
|
|
300
|
+
if (result === undefined) {
|
|
301
|
+
_InternalLog.InternalLog.log(`${TAG} No request headers survived rule filtering for ${url} (accumulated: ${accumulatedCount})`, _types.SdkVerbosity.DEBUG);
|
|
302
|
+
} else {
|
|
303
|
+
_InternalLog.InternalLog.log(`${TAG} Captured ${Object.keys(result).length}/${accumulatedCount} request headers for ${url}: [${Object.keys(result).join(', ')}]`, _types.SdkVerbosity.DEBUG);
|
|
304
|
+
}
|
|
305
|
+
return result;
|
|
306
|
+
};
|
|
307
|
+
exports.filterRequestHeadersByMode = filterRequestHeadersByMode;
|
|
308
|
+
//# sourceMappingURL=captureHeaders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_InternalLog","require","_types","_isHeaderAllowed","_normalizeUrlForMatching","_parseResponseHeaders","TAG","DEFAULT_RESPONSE_HEADERS","exports","Set","DEFAULT_REQUEST_HEADERS","CANONICAL_RESPONSE_HEADERS","Map","CANONICAL_REQUEST_HEADERS","filterWithCasing","headers","allowedSet","casingMap","filtered","hasEntries","name","value","Object","entries","lowered","toLowerCase","has","outputKey","get","undefined","mergeMatchingHeaderNames","rules","url","field","scopedMatches","catchAllMatches","hasScopedMatch","rule","urlRegex","test","isScoped","add","mergeCasingMaps","scopedMap","catchAllMap","original","set","accumulateRequestHeader","accumulator","headerName","headerValue","isHeaderAllowed","existing","InternalLog","log","SdkVerbosity","DEBUG","captureResponseHeaders","rawHeaders","config","filterResponseHeaders","parseResponseHeaders","allHeaders","allCount","keys","length","securityFiltered","blocked","push","join","matchUrl","normalizeUrlForMatching","allowedHeaders","size","result","filterRequestHeadersByMode","accumulatedCount"],"sourceRoot":"../../../../../../src","sources":["rum/instrumentation/resourceTracking/headerCapture/captureHeaders.ts"],"mappings":";;;;;;AAMA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,gBAAA,GAAAF,OAAA;AACA,IAAAG,wBAAA,GAAAH,OAAA;AACA,IAAAI,qBAAA,GAAAJ,OAAA;AAXA;AACA;AACA;AACA;AACA;;AAaA,MAAMK,GAAG,GAAG,6BAA6B;;AAEzC;AACA;AACA;AACA;AACO,MAAMC,wBAAqC,GAAAC,OAAA,CAAAD,wBAAA,GAAG,IAAIE,GAAG,CAAC,CACzD,eAAe,EACf,MAAM,EACN,KAAK,EACL,SAAS,EACT,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,MAAM,EACN,eAAe,EACf,SAAS,CACZ,CAAC;;AAEF;AACA;AACA;AAC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AACC,GAAG,CACX,GAAGhD,GAAG,mDAAmD0B,GAAG,kBAAkB4C,gBAAgB,GAAG,EACjGrB,mBAAY,CAACC,KACjB,CAAC;EACL,CAAC,MAAM;IACHH,wBAAW,CAACC,GAAG,CACX,GAAGhD,GAAG,aACFgB,MAAM,CAAC0C,IAAI,CAACU,MAAM,CAAC,CAACT,MAAM,IAC1BW,gBAAgB,wBAAwB5C,GAAG,MAAMV,MAAM,CAAC0C,IAAI,CAC5DU,MACJ,CAAC,CAACL,IAAI,CAAC,IAAI,CAAC,GAAG,EACfd,mBAAY,CAACC,KACjB,CAAC;EACL;EAEA,OAAOkB,MAAM;AACjB,CAAC;AAAClE,OAAA,CAAAmE,0BAAA,GAAAA,0BAAA","ignoreList":[]}
|
package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/compileHeaderConfig.js
ADDED
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.compileHeaderCaptureConfig = void 0;
|
|
7
|
+
var _InternalLog = require("../../../../InternalLog");
|
|
8
|
+
var _SdkVerbosity = require("../../../../config/types/SdkVerbosity");
|
|
9
|
+
var _firstPartyHosts = require("../distributedTracing/firstPartyHosts");
|
|
10
|
+
var _captureHeaders = require("./captureHeaders");
|
|
11
|
+
var _normalizeUrlForMatching = require("./normalizeUrlForMatching");
|
|
12
|
+
/*
|
|
13
|
+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
|
|
14
|
+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
|
|
15
|
+
* Copyright 2016-Present Datadog, Inc.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Builds a URL-matching RegExp from a user-supplied `match` string.
|
|
20
|
+
*
|
|
21
|
+
* The regex is applied to full URL strings (e.g. "https://api.example.com/v2/users").
|
|
22
|
+
* Pattern: `^https?://([^/?#\\]*@)?([^/?#@:\\]+\.)?${escapedHost}(:\d+)?${pathSuffix}`
|
|
23
|
+
* Optional userinfo (`user:pass@`) is allowed before the host; a hostname that
|
|
24
|
+
* only appears in the userinfo never matches.
|
|
25
|
+
* Subdomains are restricted to hostname characters, so a hostname appearing in
|
|
26
|
+
* the path or query of another URL never matches. Backslashes are excluded too,
|
|
27
|
+
* as URL parsers treat them as path separators. The path prefix (if any) must
|
|
28
|
+
* end on a path segment boundary: `api.example.com/v2` matches `/v2` and `/v2/users`,
|
|
29
|
+
* but not `/v22`. The host is matched case-insensitively (URLs go through
|
|
30
|
+
* normalizeUrlForMatching first), the path prefix case-sensitively.
|
|
31
|
+
*
|
|
32
|
+
* Returns null if the pattern is invalid (e.g. contains unescaped regex metacharacters that
|
|
33
|
+
* result in an invalid expression).
|
|
34
|
+
*/
|
|
35
|
+
const buildUrlMatchRegex = match => {
|
|
36
|
+
if (match === '*') {
|
|
37
|
+
return /.*/;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Split on first '/' to separate hostname from optional path prefix
|
|
41
|
+
const slashIndex = match.indexOf('/');
|
|
42
|
+
const hostname = slashIndex === -1 ? match : match.slice(0, slashIndex);
|
|
43
|
+
const pathPrefix = slashIndex === -1 ? '' : match.slice(slashIndex);
|
|
44
|
+
|
|
45
|
+
// The pattern host goes through the same normalizeHostname as request URLs
|
|
46
|
+
// (normalizeUrlForMatching), so hosts match case-insensitively. Paths stay case-sensitive.
|
|
47
|
+
const escapedHost = (0, _firstPartyHosts.escapeRegExp)((0, _normalizeUrlForMatching.normalizeHostname)(hostname));
|
|
48
|
+
// Host and path prefix must be followed by /, ?, # or end-of-string.
|
|
49
|
+
// A path prefix ending with '/' is already on a segment boundary.
|
|
50
|
+
const boundary = '(/|\\?|#|$)';
|
|
51
|
+
const pathSuffix = pathPrefix.endsWith('/') ? (0, _firstPartyHosts.escapeRegExp)(pathPrefix) : `${(0, _firstPartyHosts.escapeRegExp)(pathPrefix)}${boundary}`;
|
|
52
|
+
try {
|
|
53
|
+
// Regex matches full URL strings: scheme + optional userinfo + optional subdomains + host + optional port + path
|
|
54
|
+
const regex = new RegExp(`^https?://([^/?#\\\\]*@)?([^/?#@:\\\\]+\\.)?${escapedHost}(:\\d+)?${pathSuffix}`);
|
|
55
|
+
// Validate the final regex is well-formed
|
|
56
|
+
regex.test('validation_probe');
|
|
57
|
+
return regex;
|
|
58
|
+
} catch (_e) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Result from building a forURLs regex, carrying both the compiled regex
|
|
65
|
+
* and whether it represents a scoped (specific URL patterns) or catch-all match.
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Builds a combined URL-matching RegExp from an array of `forURLs` patterns.
|
|
70
|
+
*
|
|
71
|
+
* Returns an object with `regex` and `isScoped`, or `null` (all invalid), or `'skip'` (empty array).
|
|
72
|
+
* - `undefined` or `['*']` -> catch-all, isScoped=false
|
|
73
|
+
* - `[]` -> 'skip'
|
|
74
|
+
* - Specific patterns -> combined regex, isScoped=true
|
|
75
|
+
*/
|
|
76
|
+
const buildForURLsRegex = forURLs => {
|
|
77
|
+
// Omitting forURLs = match all URLs (catch-all)
|
|
78
|
+
if (forURLs === undefined) {
|
|
79
|
+
return {
|
|
80
|
+
regex: /.*/,
|
|
81
|
+
isScoped: false
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Empty array = no-op rule, skip with warning
|
|
86
|
+
if (forURLs.length === 0) {
|
|
87
|
+
return 'skip';
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Any array containing '*' matches all URLs, so it is equivalent to
|
|
91
|
+
// omitting forURLs (catch-all)
|
|
92
|
+
if (forURLs.includes('*')) {
|
|
93
|
+
return {
|
|
94
|
+
regex: /.*/,
|
|
95
|
+
isScoped: false
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Specific patterns = scoped
|
|
100
|
+
const patterns = [];
|
|
101
|
+
for (const pattern of forURLs) {
|
|
102
|
+
const regex = buildUrlMatchRegex(pattern);
|
|
103
|
+
if (regex === null) {
|
|
104
|
+
_InternalLog.InternalLog.log(`[DatadogRUM] headerCaptureRules: Skipping invalid forURLs pattern "${pattern}".`, _SdkVerbosity.SdkVerbosity.WARN);
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
// Extract the source from the compiled regex to combine
|
|
108
|
+
patterns.push(regex.source);
|
|
109
|
+
}
|
|
110
|
+
if (patterns.length === 0) {
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
try {
|
|
114
|
+
return {
|
|
115
|
+
regex: new RegExp(patterns.join('|')),
|
|
116
|
+
isScoped: true
|
|
117
|
+
};
|
|
118
|
+
} catch (_e) {
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
const isStringArray = value => Array.isArray(value) && value.every(item => typeof item === 'string');
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Checks the shape of a user-supplied rule at runtime. Rules coming from
|
|
126
|
+
* file-based configuration are not type-checked, so malformed entries must
|
|
127
|
+
* be skipped instead of throwing during compilation.
|
|
128
|
+
*/
|
|
129
|
+
const getRuleValidationError = rule => {
|
|
130
|
+
if (typeof rule !== 'object' || rule === null) {
|
|
131
|
+
return 'rule is not an object';
|
|
132
|
+
}
|
|
133
|
+
const {
|
|
134
|
+
type,
|
|
135
|
+
headers,
|
|
136
|
+
forURLs
|
|
137
|
+
} = rule;
|
|
138
|
+
if (forURLs !== undefined && !isStringArray(forURLs)) {
|
|
139
|
+
return '`forURLs` must be an array of strings';
|
|
140
|
+
}
|
|
141
|
+
switch (type) {
|
|
142
|
+
case 'defaults':
|
|
143
|
+
return null;
|
|
144
|
+
case 'matchHeaders':
|
|
145
|
+
case 'matchRequestHeaders':
|
|
146
|
+
case 'matchResponseHeaders':
|
|
147
|
+
return isStringArray(headers) ? null : '`headers` must be an array of strings';
|
|
148
|
+
default:
|
|
149
|
+
// Only interpolate strings: arbitrary objects may not be convertible
|
|
150
|
+
return typeof type === 'string' ? `unknown type "${type}"` : '`type` must be a string';
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Compiles an array of composable `HeaderCaptureRule` entries into compiled rules.
|
|
156
|
+
* Each rule variant type produces a different set of request/response header names.
|
|
157
|
+
* Each compiled rule carries an `isScoped` flag from its forURLs resolution.
|
|
158
|
+
*/
|
|
159
|
+
const compileRules = rules => {
|
|
160
|
+
const compiled = [];
|
|
161
|
+
for (const candidate of rules) {
|
|
162
|
+
const validationError = getRuleValidationError(candidate);
|
|
163
|
+
if (validationError !== null) {
|
|
164
|
+
_InternalLog.InternalLog.log(`[DatadogRUM] headerCaptureRules: Skipping invalid rule (${validationError}).`, _SdkVerbosity.SdkVerbosity.WARN);
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
const rule = candidate;
|
|
168
|
+
|
|
169
|
+
// Build URL regex from forURLs
|
|
170
|
+
const urlResult = buildForURLsRegex(rule.forURLs);
|
|
171
|
+
if (urlResult === 'skip') {
|
|
172
|
+
_InternalLog.InternalLog.log('[DatadogRUM] headerCaptureRules: Skipping rule with empty forURLs array (no-op).', _SdkVerbosity.SdkVerbosity.WARN);
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
if (urlResult === null) {
|
|
176
|
+
_InternalLog.InternalLog.log('[DatadogRUM] headerCaptureRules: Skipping rule — all forURLs patterns are invalid.', _SdkVerbosity.SdkVerbosity.WARN);
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
const {
|
|
180
|
+
regex: urlRegex,
|
|
181
|
+
isScoped
|
|
182
|
+
} = urlResult;
|
|
183
|
+
switch (rule.type) {
|
|
184
|
+
case 'defaults':
|
|
185
|
+
compiled.push({
|
|
186
|
+
urlRegex,
|
|
187
|
+
requestHeaderNames: new Set(_captureHeaders.DEFAULT_REQUEST_HEADERS),
|
|
188
|
+
responseHeaderNames: new Set(_captureHeaders.DEFAULT_RESPONSE_HEADERS),
|
|
189
|
+
isScoped,
|
|
190
|
+
requestHeaderCasing: new Map(_captureHeaders.CANONICAL_REQUEST_HEADERS),
|
|
191
|
+
responseHeaderCasing: new Map(_captureHeaders.CANONICAL_RESPONSE_HEADERS)
|
|
192
|
+
});
|
|
193
|
+
break;
|
|
194
|
+
case 'matchHeaders':
|
|
195
|
+
compiled.push({
|
|
196
|
+
urlRegex,
|
|
197
|
+
requestHeaderNames: new Set(rule.headers.map(h => h.toLowerCase())),
|
|
198
|
+
responseHeaderNames: new Set(rule.headers.map(h => h.toLowerCase())),
|
|
199
|
+
isScoped,
|
|
200
|
+
requestHeaderCasing: new Map(rule.headers.map(h => [h.toLowerCase(), h])),
|
|
201
|
+
responseHeaderCasing: new Map(rule.headers.map(h => [h.toLowerCase(), h]))
|
|
202
|
+
});
|
|
203
|
+
break;
|
|
204
|
+
case 'matchRequestHeaders':
|
|
205
|
+
compiled.push({
|
|
206
|
+
urlRegex,
|
|
207
|
+
requestHeaderNames: new Set(rule.headers.map(h => h.toLowerCase())),
|
|
208
|
+
responseHeaderNames: new Set(),
|
|
209
|
+
isScoped,
|
|
210
|
+
requestHeaderCasing: new Map(rule.headers.map(h => [h.toLowerCase(), h])),
|
|
211
|
+
responseHeaderCasing: new Map()
|
|
212
|
+
});
|
|
213
|
+
break;
|
|
214
|
+
case 'matchResponseHeaders':
|
|
215
|
+
compiled.push({
|
|
216
|
+
urlRegex,
|
|
217
|
+
requestHeaderNames: new Set(),
|
|
218
|
+
responseHeaderNames: new Set(rule.headers.map(h => h.toLowerCase())),
|
|
219
|
+
isScoped,
|
|
220
|
+
requestHeaderCasing: new Map(),
|
|
221
|
+
responseHeaderCasing: new Map(rule.headers.map(h => [h.toLowerCase(), h]))
|
|
222
|
+
});
|
|
223
|
+
break;
|
|
224
|
+
default:
|
|
225
|
+
// Unknown types are rejected by getRuleValidationError
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
return compiled;
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Converts a user-supplied header capture config into a runtime-efficient
|
|
234
|
+
* `CompiledHeaderCaptureConfig` (which is `CompiledHeaderCaptureRule[] | null`).
|
|
235
|
+
*
|
|
236
|
+
* Runs once at SDK initialization. Produces pre-built `RegExp` objects and `Set<string>`
|
|
237
|
+
* lookups so that per-request header matching is O(1) with no config traversal.
|
|
238
|
+
*
|
|
239
|
+
* Input: `'defaults' | HeaderCaptureRule[] | undefined`
|
|
240
|
+
* - `undefined` (omitted) = disabled, returns `null`
|
|
241
|
+
* - `'defaults'` = string shortcut, returns single-element array with default headers and catch-all regex
|
|
242
|
+
* - `HeaderCaptureRule[]` = composable array of rules, compiled into `CompiledHeaderCaptureRule[]`
|
|
243
|
+
* - `[]` (empty array) = logs WARN, returns `null`
|
|
244
|
+
* - Invalid value = logs WARN, returns `null`
|
|
245
|
+
*/
|
|
246
|
+
const compileHeaderCaptureConfig = config => {
|
|
247
|
+
if (config == null) {
|
|
248
|
+
return null;
|
|
249
|
+
}
|
|
250
|
+
if (config === 'defaults') {
|
|
251
|
+
return [{
|
|
252
|
+
requestHeaderNames: new Set(_captureHeaders.DEFAULT_REQUEST_HEADERS),
|
|
253
|
+
responseHeaderNames: new Set(_captureHeaders.DEFAULT_RESPONSE_HEADERS),
|
|
254
|
+
urlRegex: /.*/,
|
|
255
|
+
isScoped: false,
|
|
256
|
+
requestHeaderCasing: new Map(_captureHeaders.CANONICAL_REQUEST_HEADERS),
|
|
257
|
+
responseHeaderCasing: new Map(_captureHeaders.CANONICAL_RESPONSE_HEADERS)
|
|
258
|
+
}];
|
|
259
|
+
}
|
|
260
|
+
if (Array.isArray(config)) {
|
|
261
|
+
if (config.length === 0) {
|
|
262
|
+
_InternalLog.InternalLog.log('[DatadogRUM] headerCaptureRules is empty, no headers will be captured.', _SdkVerbosity.SdkVerbosity.WARN);
|
|
263
|
+
return null;
|
|
264
|
+
}
|
|
265
|
+
const compiled = compileRules(config);
|
|
266
|
+
if (compiled.length === 0) {
|
|
267
|
+
return null;
|
|
268
|
+
}
|
|
269
|
+
return compiled;
|
|
270
|
+
}
|
|
271
|
+
_InternalLog.InternalLog.log(`[DatadogRUM] headerCaptureRules: Unrecognized value "${JSON.stringify(config)}" — defaulting to disabled.`, _SdkVerbosity.SdkVerbosity.WARN);
|
|
272
|
+
return null;
|
|
273
|
+
};
|
|
274
|
+
exports.compileHeaderCaptureConfig = compileHeaderCaptureConfig;
|
|
275
|
+
//# sourceMappingURL=compileHeaderConfig.js.map
|
package/lib/commonjs/rum/instrumentation/resourceTracking/headerCapture/compileHeaderConfig.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_InternalLog","require","_SdkVerbosity","_firstPartyHosts","_captureHeaders","_normalizeUrlForMatching","buildUrlMatchRegex","match","slashIndex","indexOf","hostname","slice","pathPrefix","escapedHost","escapeRegExp","normalizeHostname","boundary","pathSuffix","endsWith","regex","RegExp","test","_e","buildForURLsRegex","forURLs","undefined","isScoped","length","includes","patterns","pattern","InternalLog","log","SdkVerbosity","WARN","push","source","join","isStringArray","value","Array","isArray","every","item","getRuleValidationError","rule","type","headers","compileRules","rules","compiled","candidate","validationError","urlResult","urlRegex","requestHeaderNames","Set","DEFAULT_REQUEST_HEADERS","responseHeaderNames","DEFAULT_RESPONSE_HEADERS","requestHeaderCasing","Map","CANONICAL_REQUEST_HEADERS","responseHeaderCasing","CANONICAL_RESPONSE_HEADERS","map","h","toLowerCase","compileHeaderCaptureConfig","config","JSON","stringify","exports"],"sourceRoot":"../../../../../../src","sources":["rum/instrumentation/resourceTracking/headerCapture/compileHeaderConfig.ts"],"mappings":";;;;;;AAMA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,aAAA,G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