@@ -15,6 +15,7 @@ require('./setup/core')
1515const { GRPC_CLIENT_ERROR_STATUSES , GRPC_SERVER_ERROR_STATUSES } = require ( '../src/constants' )
1616const { getEnvironmentVariable, getEnvironmentVariables } = require ( '../src/config-helper' )
1717const { assertObjectContains } = require ( '../../../integration-tests/helpers' )
18+ const { DD_MAJOR } = require ( '../../../version' )
1819
1920describe ( 'Config' , ( ) => {
2021 let Config
@@ -1170,8 +1171,12 @@ describe('Config', () => {
11701171 expect ( config ) . to . have . nested . property ( 'iast.redactionNamePattern' , 'REDACTION_NAME_PATTERN' )
11711172 expect ( config ) . to . have . nested . property ( 'iast.redactionValuePattern' , 'REDACTION_VALUE_PATTERN' )
11721173 expect ( config ) . to . have . nested . property ( 'iast.requestSampling' , 50 )
1173- expect ( config ) . to . have . nested . property ( 'iast.securityControlsConfiguration' ,
1174- 'SANITIZER:CODE_INJECTION:sanitizer.js:method' )
1174+ if ( DD_MAJOR < 6 ) {
1175+ expect ( config ) . to . have . nested . property ( 'iast.securityControlsConfiguration' ,
1176+ 'SANITIZER:CODE_INJECTION:sanitizer.js:method' )
1177+ } else {
1178+ expect ( config ) . to . not . have . property ( 'iast.securityControlsConfiguration' )
1179+ }
11751180 expect ( config ) . to . have . nested . property ( 'iast.stackTrace.enabled' , false )
11761181 expect ( config ) . to . have . nested . property ( 'iast.telemetryVerbosity' , 'DEBUG' )
11771182 expect ( config ) . to . have . nested . property ( 'llmobs.agentlessEnabled' , true )
@@ -1259,7 +1264,7 @@ describe('Config', () => {
12591264 { name : 'iast.redactionNamePattern' , value : 'REDACTION_NAME_PATTERN' , origin : 'code' } ,
12601265 { name : 'iast.redactionValuePattern' , value : 'REDACTION_VALUE_PATTERN' , origin : 'code' } ,
12611266 { name : 'iast.requestSampling' , value : 50 , origin : 'code' } ,
1262- {
1267+ DD_MAJOR < 6 && {
12631268 name : 'iast.securityControlsConfiguration' ,
12641269 value : 'SANITIZER:CODE_INJECTION:sanitizer.js:method' ,
12651270 origin : 'code'
@@ -1289,7 +1294,7 @@ describe('Config', () => {
12891294 { name : 'traceId128BitGenerationEnabled' , value : true , origin : 'code' } ,
12901295 { name : 'traceId128BitLoggingEnabled' , value : true , origin : 'code' } ,
12911296 { name : 'version' , value : '0.1.0' , origin : 'code' }
1292- ] )
1297+ ] . filter ( v => v ) )
12931298 } )
12941299
12951300 it ( 'should initialize from the options with url taking precedence' , ( ) => {
@@ -1684,8 +1689,13 @@ describe('Config', () => {
16841689 expect ( config ) . to . have . nested . property ( 'iast.redactionNamePattern' , 'REDACTION_NAME_PATTERN' )
16851690 expect ( config ) . to . have . nested . property ( 'iast.redactionValuePattern' , 'REDACTION_VALUE_PATTERN' )
16861691 expect ( config ) . to . have . nested . property ( 'iast.requestSampling' , 30 )
1687- expect ( config ) . to . have . nested . property ( 'iast.securityControlsConfiguration' ,
1688- 'SANITIZER:CODE_INJECTION:sanitizer.js:method2' )
1692+ if ( DD_MAJOR < 6 ) {
1693+ expect ( config ) . to . have . nested . property ( 'iast.securityControlsConfiguration' ,
1694+ 'SANITIZER:CODE_INJECTION:sanitizer.js:method2' )
1695+ } else {
1696+ expect ( config ) . to . have . nested . property ( 'iast.securityControlsConfiguration' ,
1697+ 'SANITIZER:CODE_INJECTION:sanitizer.js:method1' )
1698+ }
16891699 expect ( config ) . to . have . nested . property ( 'iast.stackTrace.enabled' , false )
16901700 expect ( config ) . to . have . nested . property ( 'llmobs.agentlessEnabled' , false )
16911701 expect ( config ) . to . have . nested . property ( 'llmobs.mlApp' , 'myOtherMlApp' )
0 commit comments