From 50505c8f436d44990ff5e3a9870e648672e3b9c5 Mon Sep 17 00:00:00 2001 From: Alexandros Milaios Date: Fri, 4 Oct 2024 11:53:18 +0300 Subject: [PATCH 1/9] chore: update singer zendesk-chat and stripe (#1716) --- src/configurations/sources/singer-recurly/db-config.json | 2 +- src/configurations/sources/singer_stripe/db-config.json | 2 +- src/configurations/sources/singer_zendesk_chat/db-config.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/configurations/sources/singer-recurly/db-config.json b/src/configurations/sources/singer-recurly/db-config.json index 28625200e..2b35a5742 100644 --- a/src/configurations/sources/singer-recurly/db-config.json +++ b/src/configurations/sources/singer-recurly/db-config.json @@ -4,7 +4,7 @@ "displayName": "Recurly", "options": { "isBeta": false, - "image": "rudderstack/source-recurly:v5.3.0" + "image": "rudderstack/source-recurly:v8.3.10" }, "type": "cloudSource" } diff --git a/src/configurations/sources/singer_stripe/db-config.json b/src/configurations/sources/singer_stripe/db-config.json index adbd0a0a2..c6809f085 100644 --- a/src/configurations/sources/singer_stripe/db-config.json +++ b/src/configurations/sources/singer_stripe/db-config.json @@ -3,7 +3,7 @@ "category": "singer-protocol", "displayName": "Stripe", "options": { - "image": "rudderstack/source-stripe:v8.2.20" + "image": "rudderstack/source-stripe:v8.3.8" }, "type": "cloudSource" } diff --git a/src/configurations/sources/singer_zendesk_chat/db-config.json b/src/configurations/sources/singer_zendesk_chat/db-config.json index 941b728a7..29bae399f 100644 --- a/src/configurations/sources/singer_zendesk_chat/db-config.json +++ b/src/configurations/sources/singer_zendesk_chat/db-config.json @@ -6,7 +6,7 @@ "auth": { "oauthRole": "singer-zendesk-chat" }, - "image": "rudderstack/source-zendesk-chat:v5.3.0" + "image": "rudderstack/source-zendesk-chat:v8.3.8" }, "type": "cloudSource" } From 6339410ecec4f6739df44383b866b82662642ae6 Mon Sep 17 00:00:00 2001 From: Aanshi Lahoti <110057617+aanshi07@users.noreply.github.com> Date: Sun, 6 Oct 2024 14:07:21 +0530 Subject: [PATCH 2/9] feat: added test cases (#1659) Co-authored-by: Yashasvi Bajpai <33063622+yashasvibajpai@users.noreply.github.com> --- .../destinations/bugsnag/schema.json | 57 ++++++++++++- .../destinations/bugsnag/ui-config.json | 2 +- .../destinations/candu/schema.json | 6 +- .../destinations/chartbeat/schema.json | 47 ++++++++++- .../destinations/clevertap/schema.json | 58 ++++++++++++- .../destinations/confluent_cloud/schema.json | 18 +++- .../destinations/criteo_audience/schema.json | 15 +++- .../destinations/delighted/schema.json | 14 +++- .../digital_ocean_spaces/schema.json | 22 ++++- .../destinations/drip/schema.json | 55 +++++++++++- .../destinations/gainsight/schema.json | 10 ++- .../destinations/gainsight_px/schema.json | 10 ++- .../data/validation/destinations/bugsnag.json | 13 +++ test/data/validation/destinations/candu.json | 13 +++ .../validation/destinations/chartbeat.json | 57 +++++++++++++ .../validation/destinations/clevertap.json | 84 +++++++++++++++---- .../destinations/confluent_cloud.json | 66 +++++++++++++++ .../destinations/criteo_audience.json | 71 ++++++++++++++-- .../validation/destinations/delighted.json | 45 ++++++++-- .../destinations/digital_ocean_spaces.json | 66 ++++++++++++++- test/data/validation/destinations/drip.json | 48 +++++++++-- .../validation/destinations/gainsight.json | 15 +++- .../validation/destinations/gainsight_px.json | 49 +++++++++++ 23 files changed, 789 insertions(+), 52 deletions(-) diff --git a/src/configurations/destinations/bugsnag/schema.json b/src/configurations/destinations/bugsnag/schema.json index e4b810155..2d90f8605 100644 --- a/src/configurations/destinations/bugsnag/schema.json +++ b/src/configurations/destinations/bugsnag/schema.json @@ -1,9 +1,64 @@ { "configSchema": { "$schema": "http://json-schema.org/draft-07/schema#", - "required": [], + "required": ["apiKey"], "type": "object", "properties": { + "apiKey": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + }, + "eventFilteringOption": { + "type": "string", + "enum": ["disable", "whitelistedEvents", "blacklistedEvents"], + "default": "disable" + }, + "whitelistedEvents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "eventName": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "blacklistedEvents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "eventName": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "useNativeSDK": { + "type": "object", + "properties": { + "web": { + "type": "boolean" + }, + "android": { + "type": "boolean" + }, + "ios": { + "type": "boolean" + } + } + }, + "releaseStage": { + "type": "object", + "properties": { + "web": { + "type": "boolean" + } + } + }, "consentManagement": { "type": "object", "properties": { diff --git a/src/configurations/destinations/bugsnag/ui-config.json b/src/configurations/destinations/bugsnag/ui-config.json index b21464c07..359679049 100644 --- a/src/configurations/destinations/bugsnag/ui-config.json +++ b/src/configurations/destinations/bugsnag/ui-config.json @@ -7,7 +7,7 @@ "type": "textInput", "label": "BugSnag Api Key", "value": "apiKey", - "regex": "^(.{0,100})$", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$", "regexErrorMessage": "Invalid BugSnag Api Key", "required": true, "placeholder": "e.g: 1234567890abcdef12345" diff --git a/src/configurations/destinations/candu/schema.json b/src/configurations/destinations/candu/schema.json index 7244091d1..31f521536 100644 --- a/src/configurations/destinations/candu/schema.json +++ b/src/configurations/destinations/candu/schema.json @@ -1,9 +1,13 @@ { "configSchema": { "$schema": "http://json-schema.org/draft-07/schema#", - "required": [], + "required": ["apiKey"], "type": "object", "properties": { + "apiKey": { + "type": "string", + "pattern": ".*" + }, "consentManagement": { "type": "object", "properties": { diff --git a/src/configurations/destinations/chartbeat/schema.json b/src/configurations/destinations/chartbeat/schema.json index 9fc7407f2..d6c0b09f1 100644 --- a/src/configurations/destinations/chartbeat/schema.json +++ b/src/configurations/destinations/chartbeat/schema.json @@ -1,9 +1,54 @@ { "configSchema": { "$schema": "http://json-schema.org/draft-07/schema#", - "required": [], + "required": ["domain", "uid"], "type": "object", "properties": { + "domain": { + "type": "string", + "pattern": "^(.{0,100})$" + }, + "uid": { + "type": "string", + "pattern": "^(.{0,100})$" + }, + "eventFilteringOption": { + "type": "string", + "enum": ["disable", "whitelistedEvents", "blacklistedEvents"], + "default": "disable" + }, + "whitelistedEvents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "eventName": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "blacklistedEvents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "eventName": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "useNativeSDK": { + "type": "object", + "properties": { + "web": { + "type": "boolean" + } + } + }, "consentManagement": { "type": "object", "properties": { diff --git a/src/configurations/destinations/clevertap/schema.json b/src/configurations/destinations/clevertap/schema.json index 84a3f4c1b..f7be0504b 100644 --- a/src/configurations/destinations/clevertap/schema.json +++ b/src/configurations/destinations/clevertap/schema.json @@ -1,9 +1,65 @@ { "configSchema": { "$schema": "http://json-schema.org/draft-07/schema#", - "required": [], + "required": ["accountId", "passcode"], "type": "object", "properties": { + "accountId": { + "type": "string", + "pattern": ".*" + }, + "passcode": { + "type": "string", + "pattern": ".*" + }, + "accountToken": { + "type": "string", + "pattern": ".*" + }, + "trackAnonymous": { "type": "boolean", "default": false }, + "enableObjectIdMapping": { "type": "boolean", "default": false }, + "region": { + "type": "string", + "enum": ["none", "in1", "sg1", "us1", "sk1", "aps3", "mec1"], + "default": "none" + }, + "eventFilteringOption": { + "type": "string", + "enum": ["disable", "whitelistedEvents", "blacklistedEvents"], + "default": "disable" + }, + "whitelistedEvents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "eventName": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "blacklistedEvents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "eventName": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "useNativeSDK": { + "type": "object", + "properties": { + "web": { + "type": "boolean" + } + } + }, "consentManagement": { "type": "object", "properties": { diff --git a/src/configurations/destinations/confluent_cloud/schema.json b/src/configurations/destinations/confluent_cloud/schema.json index 84a3f4c1b..112ccaf79 100644 --- a/src/configurations/destinations/confluent_cloud/schema.json +++ b/src/configurations/destinations/confluent_cloud/schema.json @@ -1,9 +1,25 @@ { "configSchema": { "$schema": "http://json-schema.org/draft-07/schema#", - "required": [], + "required": ["bootstrapServer", "topic", "apiKey", "apiSecret"], "type": "object", "properties": { + "bootstrapServer": { + "type": "string", + "pattern": "^(.{0,100})$" + }, + "topic": { + "type": "string", + "pattern": "^(.{0,100})$" + }, + "apiKey": { + "type": "string", + "pattern": "^(.{0,100})$" + }, + "apiSecret": { + "type": "string", + "pattern": "^(.{0,100})$" + }, "consentManagement": { "type": "object", "properties": { diff --git a/src/configurations/destinations/criteo_audience/schema.json b/src/configurations/destinations/criteo_audience/schema.json index 0036d5b6d..d030b8710 100644 --- a/src/configurations/destinations/criteo_audience/schema.json +++ b/src/configurations/destinations/criteo_audience/schema.json @@ -1,7 +1,7 @@ { "configSchema": { "$schema": "http://json-schema.org/draft-07/schema#", - "required": ["audienceType"], + "required": ["adAccountId", "audienceId", "audienceType", "gumCallerId"], "type": "object", "additionalProperties": true, "properties": { @@ -19,6 +19,19 @@ "enum": ["email", "madid", "identityLink", "gum"], "default": "email" }, + "audienceId": { + "type": "object", + "properties": { + "cloud": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^[0-9]+$" + } + } + }, + "gumCallerId": { + "type": "string", + "pattern": "^[0-9]+$" + }, "oneTrustCookieCategories": { "type": "object", "properties": { diff --git a/src/configurations/destinations/delighted/schema.json b/src/configurations/destinations/delighted/schema.json index 7244091d1..aa4681aef 100644 --- a/src/configurations/destinations/delighted/schema.json +++ b/src/configurations/destinations/delighted/schema.json @@ -1,9 +1,21 @@ { "configSchema": { "$schema": "http://json-schema.org/draft-07/schema#", - "required": [], + "required": ["apiKey", "channel"], "type": "object", "properties": { + "apiKey": { + "type": "string", + "pattern": ".*" + }, + "channel": { + "type": "string", + "enum": ["email", "sms"], + "default": "email" + }, + "delay": { + "type": "string" + }, "consentManagement": { "type": "object", "properties": { diff --git a/src/configurations/destinations/digital_ocean_spaces/schema.json b/src/configurations/destinations/digital_ocean_spaces/schema.json index 94ba7c990..0993a61ed 100644 --- a/src/configurations/destinations/digital_ocean_spaces/schema.json +++ b/src/configurations/destinations/digital_ocean_spaces/schema.json @@ -1,9 +1,29 @@ { "configSchema": { "$schema": "http://json-schema.org/draft-07/schema#", - "required": [], + "required": ["endPoint", "accessKeyID", "accessKey", "bucketName"], "type": "object", "properties": { + "endPoint": { + "type": "string", + "pattern": "(?!.*\\.ngrok\\.io)^(.{0,100})$" + }, + "accessKeyID": { + "type": "string", + "pattern": "^(.{0,100})$" + }, + "accessKey": { + "type": "string", + "pattern": "^(.{0,100})$" + }, + "bucketName": { + "type": "string", + "pattern": "^(.{0,100})$" + }, + "prefix": { + "type": "string", + "pattern": "^(.{0,100})$" + }, "consentManagement": { "type": "object", "properties": { diff --git a/src/configurations/destinations/drip/schema.json b/src/configurations/destinations/drip/schema.json index 7244091d1..541026039 100644 --- a/src/configurations/destinations/drip/schema.json +++ b/src/configurations/destinations/drip/schema.json @@ -1,9 +1,62 @@ { "configSchema": { "$schema": "http://json-schema.org/draft-07/schema#", - "required": [], + "required": ["accountId"], "type": "object", "properties": { + "accountId": { + "type": "string", + "pattern": "^(.{0,100})$" + }, + "apiKey": { + "type": "string", + "pattern": ".*" + }, + "campaignId": { + "type": "string", + "pattern": "^(.{0,100})$" + }, + "enableUserCreation": { + "type": "boolean", + "default": true + }, + "eventFilteringOption": { + "type": "string", + "enum": ["disable", "whitelistedEvents", "blacklistedEvents"], + "default": "disable" + }, + "whitelistedEvents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "eventName": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "blacklistedEvents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "eventName": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "useNativeSDK": { + "type": "object", + "properties": { + "web": { + "type": "boolean" + } + } + }, "consentManagement": { "type": "object", "properties": { diff --git a/src/configurations/destinations/gainsight/schema.json b/src/configurations/destinations/gainsight/schema.json index 7244091d1..8d840f693 100644 --- a/src/configurations/destinations/gainsight/schema.json +++ b/src/configurations/destinations/gainsight/schema.json @@ -1,9 +1,17 @@ { "configSchema": { "$schema": "http://json-schema.org/draft-07/schema#", - "required": [], + "required": ["domain"], "type": "object", "properties": { + "domain": { + "type": "string", + "pattern": "^(.{0,100})$" + }, + "accessKey": { + "type": "string", + "pattern": ".*" + }, "consentManagement": { "type": "object", "properties": { diff --git a/src/configurations/destinations/gainsight_px/schema.json b/src/configurations/destinations/gainsight_px/schema.json index 7244091d1..ed136c1a2 100644 --- a/src/configurations/destinations/gainsight_px/schema.json +++ b/src/configurations/destinations/gainsight_px/schema.json @@ -1,9 +1,17 @@ { "configSchema": { "$schema": "http://json-schema.org/draft-07/schema#", - "required": [], + "required": ["apiKey", "productTagKey"], "type": "object", "properties": { + "apiKey": { + "type": "string", + "pattern": ".*" + }, + "productTagKey": { + "type": "string", + "pattern": "^(.{0,100})$" + }, "consentManagement": { "type": "object", "properties": { diff --git a/test/data/validation/destinations/bugsnag.json b/test/data/validation/destinations/bugsnag.json index 74e0b4f5c..1068ccfe3 100644 --- a/test/data/validation/destinations/bugsnag.json +++ b/test/data/validation/destinations/bugsnag.json @@ -97,6 +97,19 @@ "result": false, "err": ["consentManagement.android.0.provider must be equal to one of the allowed values"] }, + { + "testTitle": "Without apiKey", + "config": { + "oneTrustCookieCategories": { + "oneTrustCookieCategory": "C0001" + }, + "connectionMode": { + "web": "cloud" + } + }, + "result": false, + "err": [" must have required property 'apiKey'"] + }, { "testTitle": "With valid multiple consent management providers config", "config": { diff --git a/test/data/validation/destinations/candu.json b/test/data/validation/destinations/candu.json index 75160f519..06435b862 100644 --- a/test/data/validation/destinations/candu.json +++ b/test/data/validation/destinations/candu.json @@ -97,6 +97,19 @@ "result": false, "err": ["consentManagement.android.0.provider must be equal to one of the allowed values"] }, + { + "testTitle": "Without apiKey", + "config": { + "oneTrustCookieCategories": { + "oneTrustCookieCategory": "C0001" + }, + "connectionMode": { + "web": "cloud" + } + }, + "result": false, + "err": [" must have required property 'apiKey'"] + }, { "testTitle": "With valid multiple consent management providers config", "config": { diff --git a/test/data/validation/destinations/chartbeat.json b/test/data/validation/destinations/chartbeat.json index 2e6f4edd9..d7f54afc7 100644 --- a/test/data/validation/destinations/chartbeat.json +++ b/test/data/validation/destinations/chartbeat.json @@ -3,6 +3,7 @@ "testTitle": "With valid multiple consent management providers config", "config": { "domain": "test-host", + "uid": "ABCDEFG", "consentManagement": { "web": [ { @@ -35,6 +36,7 @@ "testTitle": "With consent management custom provider config and invalid resolutionStrategy value", "config": { "domain": "test-host", + "uid": "ABCDEFG", "consentManagement": { "web": [ { @@ -54,6 +56,7 @@ "testTitle": "With consent management custom provider config and no resolutionStrategy value", "config": { "domain": "test-host", + "uid": "ABCDEFG", "consentManagement": { "web": [ { @@ -72,6 +75,7 @@ "testTitle": "With consent management OneTrust provider config and no resolutionStrategy value", "config": { "domain": "test-host", + "uid": "ABCDEFG", "consentManagement": { "web": [ { @@ -86,6 +90,7 @@ "testTitle": "With consent management custom provider config invalid provider value", "config": { "domain": "test-host", + "uid": "ABCDEFG", "consentManagement": { "web": [ { @@ -97,10 +102,52 @@ "result": false, "err": ["consentManagement.web.0.provider must be equal to one of the allowed values"] }, + { + "testTitle": "Without domain", + "config": { + "uid": "ABCDEFG", + "oneTrustCookieCategories": { + "oneTrustCookieCategory": "C0001" + }, + "connectionMode": { + "web": "device" + } + }, + "result": false, + "err": [" must have required property 'domain'"] + }, + { + "testTitle": "Without uid", + "config": { + "domain": "test-host", + "oneTrustCookieCategories": { + "oneTrustCookieCategory": "C0001" + }, + "connectionMode": { + "web": "device" + } + }, + "result": false, + "err": [" must have required property 'uid'"] + }, + { + "testTitle": "Without domain and uid", + "config": { + "oneTrustCookieCategories": { + "oneTrustCookieCategory": "C0001" + }, + "connectionMode": { + "web": "device" + } + }, + "result": false, + "err": [" must have required property 'domain'", " must have required property 'uid'"] + }, { "testTitle": "With valid multiple consent management providers config", "config": { "domain": "test-host", + "uid": "ABCDEFG", "consentManagement": { "web": [ { @@ -153,6 +200,7 @@ "testTitle": "With valid multiple consent management providers config", "config": { "domain": "test-host", + "uid": "ABCDEFG", "consentManagement": { "web": [ { @@ -205,6 +253,7 @@ "testTitle": "With valid multiple consent management providers config", "config": { "domain": "test-host", + "uid": "ABCDEFG", "consentManagement": { "web": [ { @@ -251,6 +300,7 @@ "testTitle": "With valid multiple consent management providers config", "config": { "domain": "test-host", + "uid": "ABCDEFG", "consentManagement": { "web": [ { @@ -289,6 +339,7 @@ "testTitle": "With valid multiple consent management providers config", "config": { "domain": "test-host", + "uid": "ABCDEFG", "consentManagement": { "web": [ { @@ -335,6 +386,7 @@ "testTitle": "With valid multiple consent management providers config", "config": { "domain": "test-host", + "uid": "ABCDEFG", "consentManagement": { "web": [ { @@ -381,6 +433,7 @@ "testTitle": "With valid multiple consent management providers config", "config": { "domain": "test-host", + "uid": "ABCDEFG", "consentManagement": { "web": [ { @@ -430,6 +483,7 @@ "testTitle": "With valid multiple consent management providers config", "config": { "domain": "test-host", + "uid": "ABCDEFG", "consentManagement": { "web": [ { @@ -486,6 +540,7 @@ "testTitle": "With valid multiple consent management providers config", "config": { "domain": "test-host", + "uid": "ABCDEFG", "consentManagement": { "web": [ { @@ -546,6 +601,7 @@ "testTitle": "With valid multiple consent management providers config", "config": { "domain": "test-host", + "uid": "ABCDEFG", "consentManagement": { "web": [ { @@ -589,6 +645,7 @@ "testTitle": "With valid multiple consent management providers config", "config": { "domain": "test-host", + "uid": "ABCDEFG", "consentManagement": { "web": [ { diff --git a/test/data/validation/destinations/clevertap.json b/test/data/validation/destinations/clevertap.json index 3797b4a84..d5db10999 100644 --- a/test/data/validation/destinations/clevertap.json +++ b/test/data/validation/destinations/clevertap.json @@ -2,10 +2,10 @@ { "testTitle": "With valid multiple consent management providers config", "config": { - "accountid": "test-host", + "accountId": "test-host", "accounttoken": "test-database", "passcode": "test-user", - "region": "test-password", + "region": "in1", "consentManagement": { "web": [ { @@ -37,10 +37,10 @@ { "testTitle": "With consent management custom provider config and invalid resolutionStrategy value", "config": { - "accountid": "test-host", + "accountId": "test-host", "accounttoken": "test-database", "passcode": "test-user", - "region": "test-password", + "region": "in1", "consentManagement": { "android": [ { @@ -59,10 +59,10 @@ { "testTitle": "With consent management custom provider config and no resolutionStrategy value", "config": { - "accountid": "test-host", + "accountId": "test-host", "accounttoken": "test-database", "passcode": "test-user", - "region": "test-password", + "region": "sg1", "consentManagement": { "android": [ { @@ -80,10 +80,10 @@ { "testTitle": "With consent management OneTrust provider config and no resolutionStrategy value", "config": { - "accountid": "test-host", + "accountId": "test-host", "accounttoken": "test-database", "passcode": "test-user", - "region": "test-password", + "region": "sg1", "consentManagement": { "android": [ { @@ -97,10 +97,10 @@ { "testTitle": "With consent management custom provider config invalid provider value", "config": { - "accountid": "test-host", + "accountId": "test-host", "accounttoken": "test-database", "passcode": "test-user", - "region": "test-password", + "region": "us1", "consentManagement": { "android": [ { @@ -112,13 +112,65 @@ "result": false, "err": ["consentManagement.android.0.provider must be equal to one of the allowed values"] }, + { + "testTitle": "Without accountId", + "config": { + "passcode": "test-user", + "oneTrustCookieCategories": { + "oneTrustCookieCategory": "C0001" + }, + "connectionMode": { + "web": "cloud" + } + }, + "result": false, + "err": [" must have required property 'accountId'"] + }, + { + "testTitle": "Without passcode", + "config": { + "accountId": "test-host", + "oneTrustCookieCategories": { + "oneTrustCookieCategory": "C0001" + }, + "connectionMode": { + "web": "cloud" + } + }, + "result": false, + "err": [" must have required property 'passcode'"] + }, + { + "testTitle": "Without accountId and passcode", + "config": { + "oneTrustCookieCategories": { + "oneTrustCookieCategory": "C0001" + }, + "connectionMode": { + "web": "cloud" + } + }, + "result": false, + "err": [" must have required property 'accountId'", " must have required property 'passcode'"] + }, + { + "testTitle": "Invalid region", + "config": { + "accountId": "test-host", + "accounttoken": "test-database", + "passcode": "test-user", + "region": "test-123" + }, + "result": false, + "err": ["region must be equal to one of the allowed values"] + }, { "testTitle": "With valid multiple consent management providers config", "config": { - "accountid": "test-host", + "accountId": "test-host", "accounttoken": "test-database", "passcode": "test-user", - "region": "test-password", + "region": "in1", "consentManagement": { "web": [ { @@ -272,10 +324,10 @@ { "testTitle": "With valid multiple consent management providers config", "config": { - "accountid": "test-host", + "accountId": "test-host", "accounttoken": "test-database", "passcode": "test-user", - "region": "test-password", + "region": "sg1", "consentManagement": { "web": [ { @@ -324,10 +376,10 @@ { "testTitle": "With valid multiple consent management providers config", "config": { - "accountid": "test-host", + "accountId": "test-host", "accounttoken": "test-database", "passcode": "test-user", - "region": "test-password", + "region": "in1", "consentManagement": { "web": [ { diff --git a/test/data/validation/destinations/confluent_cloud.json b/test/data/validation/destinations/confluent_cloud.json index d436aecdb..fd13d6865 100644 --- a/test/data/validation/destinations/confluent_cloud.json +++ b/test/data/validation/destinations/confluent_cloud.json @@ -112,6 +112,72 @@ "result": false, "err": ["consentManagement.android.0.provider must be equal to one of the allowed values"] }, + { + "testTitle": "Without apiKey", + "config": { + "bootstrapServer": "test-host", + "topic": "test-database", + "apiSecret": "test-password", + "oneTrustCookieCategories": { + "oneTrustCookieCategory": "C0001" + }, + "connectionMode": { + "web": "cloud" + } + }, + "result": false, + "err": [" must have required property 'apiKey'"] + }, + { + "testTitle": "Without bootstrapServer", + "config": { + "topic": "test-database", + "apiKey": "test-user", + "apiSecret": "test-password", + "oneTrustCookieCategories": { + "oneTrustCookieCategory": "C0001" + }, + "connectionMode": { + "web": "cloud" + } + }, + "result": false, + "err": [" must have required property 'bootstrapServer'"] + }, + { + "testTitle": "Without apiSecret", + "config": { + "bootstrapServer": "test-host", + "topic": "test-database", + "apiKey": "test-user", + "oneTrustCookieCategories": [ + { + "oneTrustCookieCategory": "C0001" + } + ], + "connectionMode": { + "web": "cloud" + } + }, + "result": false, + "err": [" must have required property 'apiSecret'", "oneTrustCookieCategories must be object"] + }, + { + "testTitle": "Without topic", + "config": { + "bootstrapServer": "test-host", + "apiKey": "test-user", + "apiSecret": "test-password", + "oneTrustCookieCategories": { + "oneTrustCookieCategory": "C0001" + }, + "connectionMode": { + "web": "cloud" + } + }, + "result": false, + "err": [" must have required property 'topic'"] + }, { "testTitle": "With valid multiple consent management providers config", "config": { diff --git a/test/data/validation/destinations/criteo_audience.json b/test/data/validation/destinations/criteo_audience.json index 9c1c0803f..70e85093c 100644 --- a/test/data/validation/destinations/criteo_audience.json +++ b/test/data/validation/destinations/criteo_audience.json @@ -7,16 +7,21 @@ "audienceType": "email", "adAccountId": { "warehouse": "0000000" - } + }, + "gumCallerId": "532445" }, "result": true }, { "config": { + "audienceId": { + "cloud": "000000" + }, "audienceType": "email", "adAccountId": { "warehouse": "0000000" - } + }, + "gumCallerId": "5445" }, "result": true }, @@ -28,7 +33,8 @@ "audienceType": "email", "adAccountId": { "warehouse": "" - } + }, + "gumCallerId": "53445" }, "result": false, "err": [ @@ -37,7 +43,12 @@ }, { "config": { - "audienceId": "000000", + "adAccountId": { + "warehouse": "0000000" + }, + "audienceId": { + "cloud": "000000" + }, "audienceType": "gum", "gumCallerId": "" }, @@ -45,7 +56,8 @@ "err": [ "gumCallerId must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^[0-9]+$\"", " must match \"then\" schema", - " must match a schema in anyOf" + " must match a schema in anyOf", + "gumCallerId must match pattern \"^[0-9]+$\"" ] }, { @@ -54,6 +66,9 @@ "cloud": "000000" }, "audienceType": "gum", + "adAccountId": { + "warehouse": "0000000" + }, "gumCallerId": "00000" }, "result": true @@ -68,6 +83,7 @@ "adAccountId": { "warehouse": "0000000" }, + "gumCallerId": "00000", "consentManagement": { "web": [ { @@ -106,6 +122,7 @@ "adAccountId": { "warehouse": "0000000" }, + "gumCallerId": "00000", "consentManagement": { "shopify": [ { @@ -131,6 +148,7 @@ "adAccountId": { "warehouse": "0000000" }, + "gumCallerId": "00000", "consentManagement": { "shopify": [ { @@ -155,6 +173,7 @@ "adAccountId": { "warehouse": "0000000" }, + "gumCallerId": "00000", "consentManagement": { "shopify": [ { @@ -175,6 +194,7 @@ "adAccountId": { "warehouse": "0000000" }, + "gumCallerId": "00000", "consentManagement": { "shopify": [ { @@ -187,6 +207,7 @@ "err": ["consentManagement.shopify.0.provider must be equal to one of the allowed values"] }, { + "testTitle": "Without audienceId", "config": { "audienceId": { "cloud": "000000" @@ -195,6 +216,7 @@ "adAccountId": { "warehouse": "0000000" }, + "gumCallerId": "00000", "oneTrustCookieCategories": { "cloud": [ { @@ -253,6 +275,7 @@ "adAccountId": { "warehouse": "0000000" }, + "gumCallerId": "00000", "oneTrustCookieCategories": { "cloud": [], "warehouse": [ @@ -282,6 +305,18 @@ }, "result": true }, + { + "testTitle": "Without audienceId", + "config": { + "audienceType": "email", + "adAccountId": { + "warehouse": "0000000" + }, + "gumCallerId": "53445" + }, + "result": false, + "err": [" must have required property 'audienceId'"] + }, { "config": { "audienceId": { @@ -291,6 +326,7 @@ "adAccountId": { "warehouse": "0000000" }, + "gumCallerId": "53445", "oneTrustCookieCategories": [ { "oneTrustCookieCategory": "C0001" @@ -317,6 +353,18 @@ "cloud": "000000" }, "audienceType": "email", + "gumCallerId": "532445" + }, + "result": false, + "err": [" must have required property 'adAccountId'"] + }, + { + "testTitle": "Without gumCallerId", + "config": { + "audienceId": { + "cloud": "000000" + }, + "gumCallerId": "00000", "adAccountId": { "warehouse": "0000000" }, @@ -385,7 +433,20 @@ "audienceType": "email", "adAccountId": { "warehouse": "0000000" + } + }, + "result": false, + "err": [" must have required property 'gumCallerId'"] + }, + { + "config": { + "adAccountId": { + "warehouse": "0000000" + }, + "audienceId": { + "cloud": "000000" }, + "gumCallerId": "00000", "oneTrustCookieCategories": { "cloud": [ "not an object", diff --git a/test/data/validation/destinations/delighted.json b/test/data/validation/destinations/delighted.json index 85ede9264..1d4c2f51b 100644 --- a/test/data/validation/destinations/delighted.json +++ b/test/data/validation/destinations/delighted.json @@ -3,7 +3,7 @@ "testTitle": "With valid multiple consent management providers config", "config": { "apiKey": "test-host", - "channel": "test-database", + "channel": "email", "delay": "test-user", "consentManagement": { "web": [ @@ -37,7 +37,7 @@ "testTitle": "With consent management custom provider config and invalid resolutionStrategy value", "config": { "apiKey": "test-host", - "channel": "test-database", + "channel": "sms", "delay": "test-user", "consentManagement": { "android": [ @@ -58,7 +58,7 @@ "testTitle": "With consent management custom provider config and no resolutionStrategy value", "config": { "apiKey": "test-host", - "channel": "test-database", + "channel": "email", "delay": "test-user", "consentManagement": { "android": [ @@ -78,7 +78,7 @@ "testTitle": "With consent management OneTrust provider config and no resolutionStrategy value", "config": { "apiKey": "test-host", - "channel": "test-database", + "channel": "email", "delay": "test-user", "consentManagement": { "android": [ @@ -94,7 +94,7 @@ "testTitle": "With consent management custom provider config invalid provider value", "config": { "apiKey": "test-host", - "channel": "test-database", + "channel": "sms", "delay": "test-user", "consentManagement": { "android": [ @@ -108,10 +108,39 @@ "err": ["consentManagement.android.0.provider must be equal to one of the allowed values"] }, { - "testTitle": "With valid multiple consent management providers config", + "testTitle": "Without apiKey", + "config": { + "channel": "sms", + "oneTrustCookieCategories": { + "oneTrustCookieCategory": "C0001" + }, + "connectionMode": { + "web": "cloud" + } + }, + "result": false, + "err": [" must have required property 'apiKey'"] + }, + { + "testTitle": "Invalid channel", "config": { "apiKey": "test-host", "channel": "test-database", + "oneTrustCookieCategories": { + "oneTrustCookieCategory": "C0001" + }, + "connectionMode": { + "web": "cloud" + } + }, + "result": false, + "err": ["channel must be equal to one of the allowed values"] + }, + { + "testTitle": "With valid multiple consent management providers config", + "config": { + "apiKey": "test-host", + "channel": "sms", "delay": "test-user", "consentManagement": { "web": [ @@ -267,7 +296,7 @@ "testTitle": "With valid multiple consent management providers config", "config": { "apiKey": "test-host", - "channel": "test-database", + "channel": "sms", "delay": "test-user", "consentManagement": { "web": [ @@ -318,7 +347,7 @@ "testTitle": "With valid multiple consent management providers config", "config": { "apiKey": "test-host", - "channel": "test-database", + "channel": "sms", "delay": "test-user", "consentManagement": { "web": [ diff --git a/test/data/validation/destinations/digital_ocean_spaces.json b/test/data/validation/destinations/digital_ocean_spaces.json index 5f2bf1ce7..2b64c1c71 100644 --- a/test/data/validation/destinations/digital_ocean_spaces.json +++ b/test/data/validation/destinations/digital_ocean_spaces.json @@ -117,6 +117,54 @@ "result": false, "err": ["consentManagement.android.0.provider must be equal to one of the allowed values"] }, + { + "testTitle": "Without endPoint", + "config": { + "accessKeyID": "test-database", + "accessKey": "test-user", + "bucketName": "test-password", + "oneTrustCookieCategories": { + "oneTrustCookieCategory": "C0001" + }, + "connectionMode": { + "web": "cloud" + } + }, + "result": false, + "err": [" must have required property 'endPoint'"] + }, + { + "testTitle": "Without accessKeyID", + "config": { + "endPoint": "test-host", + "accessKey": "test-user", + "bucketName": "test-password", + "oneTrustCookieCategories": { + "oneTrustCookieCategory": "C0001" + }, + "connectionMode": { + "web": "cloud" + } + }, + "result": false, + "err": [" must have required property 'accessKeyID'"] + }, + { + "testTitle": "Without accessKey", + "config": { + "endPoint": "test-host", + "accessKeyID": "test-database", + "bucketName": "test-password", + "oneTrustCookieCategories": { + "oneTrustCookieCategory": "C0001" + }, + "connectionMode": { + "web": "cloud" + } + }, + "result": false, + "err": [" must have required property 'accessKey'"] + }, { "testTitle": "With valid multiple consent management providers config", "config": { @@ -329,11 +377,27 @@ "err": ["oneTrustCookieCategories must be object", "ketchConsentPurposes must be object"] }, { - "testTitle": "With valid multiple consent management providers config", + "testTitle": "Without bucketName", "config": { "endPoint": "test-host", "accessKeyID": "test-database", "accessKey": "test-user", + "oneTrustCookieCategories": { + "oneTrustCookieCategory": "C0001" + }, + "connectionMode": { + "web": "cloud" + } + }, + "result": false, + "err": [" must have required property 'bucketName'"] + }, + { + "testTitle": "With invalid multiple consent management providers config", + "config": { + "accessKeyID": "test-database", + "accessKey": "test-user", + "endPoint": "test-host", "bucketName": "test-password", "prefix": "0000", "consentManagement": { diff --git a/test/data/validation/destinations/drip.json b/test/data/validation/destinations/drip.json index 136ba4150..97a821a9d 100644 --- a/test/data/validation/destinations/drip.json +++ b/test/data/validation/destinations/drip.json @@ -5,7 +5,7 @@ "accountId": "test-host", "apiKey": "test-database", "campaignId": "test-user", - "enableUserCreation": "test-password", + "enableUserCreation": true, "consentManagement": { "web": [ { @@ -40,7 +40,7 @@ "accountId": "test-host", "apiKey": "test-database", "campaignId": "test-user", - "enableUserCreation": "test-password", + "enableUserCreation": true, "consentManagement": { "android": [ { @@ -62,7 +62,7 @@ "accountId": "test-host", "apiKey": "test-database", "campaignId": "test-user", - "enableUserCreation": "test-password", + "enableUserCreation": false, "consentManagement": { "android": [ { @@ -83,7 +83,7 @@ "accountId": "test-host", "apiKey": "test-database", "campaignId": "test-user", - "enableUserCreation": "test-password", + "enableUserCreation": true, "consentManagement": { "android": [ { @@ -100,7 +100,7 @@ "accountId": "test-host", "apiKey": "test-database", "campaignId": "test-user", - "enableUserCreation": "test-password", + "enableUserCreation": false, "consentManagement": { "android": [ { @@ -112,13 +112,28 @@ "result": false, "err": ["consentManagement.android.0.provider must be equal to one of the allowed values"] }, + { + "testTitle": "Without accountId", + "config": { + "apiKey": "test-database", + "campaignId": "test-user", + "oneTrustCookieCategories": { + "oneTrustCookieCategory": "C0001" + }, + "connectionMode": { + "web": "cloud" + } + }, + "result": false, + "err": [" must have required property 'accountId'"] + }, { "testTitle": "With valid multiple consent management providers config", "config": { "accountId": "test-host", "apiKey": "test-database", "campaignId": "test-user", - "enableUserCreation": "test-password", + "enableUserCreation": true, "consentManagement": { "web": [ { @@ -270,12 +285,27 @@ "result": true }, { - "testTitle": "With valid multiple consent management providers config", + "testTitle": "Invalid enableUserCreation", "config": { "accountId": "test-host", "apiKey": "test-database", "campaignId": "test-user", - "enableUserCreation": "test-password", + "enableUserCreation": "test", + "oneTrustCookieCategories": { + "oneTrustCookieCategory": "C0001" + }, + "connectionMode": { + "web": "cloud" + } + }, + "result": false, + "err": ["enableUserCreation must be boolean"] + }, + { + "testTitle": "With invalid multiple consent management providers config", + "config": { + "accountId": "test-host", + "enableUserCreation": false, "consentManagement": { "web": [ { @@ -327,7 +357,7 @@ "accountId": "test-host", "apiKey": "test-database", "campaignId": "test-user", - "enableUserCreation": "test-password", + "enableUserCreation": false, "consentManagement": { "web": [ { diff --git a/test/data/validation/destinations/gainsight.json b/test/data/validation/destinations/gainsight.json index 6e8a70801..aaefe1f09 100644 --- a/test/data/validation/destinations/gainsight.json +++ b/test/data/validation/destinations/gainsight.json @@ -113,11 +113,24 @@ "err": ["consentManagement.android.0.provider must be equal to one of the allowed values"] }, { - "testTitle": "With valid multiple consent management providers config", + "testTitle": "Without domain", "config": { "accessKey": "test-host", "sharedSecret": "test-database", "tenantId": "test-user", + "oneTrustCookieCategories": { + "oneTrustCookieCategory": "C0001" + }, + "connectionMode": { + "web": "cloud" + } + }, + "result": false, + "err": [" must have required property 'domain'"] + }, + { + "testTitle": "With valid multiple consent management providers config", + "config": { "domain": "test-password", "consentManagement": { "web": [ diff --git a/test/data/validation/destinations/gainsight_px.json b/test/data/validation/destinations/gainsight_px.json index 0e958e693..c4c9f1a60 100644 --- a/test/data/validation/destinations/gainsight_px.json +++ b/test/data/validation/destinations/gainsight_px.json @@ -3,6 +3,7 @@ "testTitle": "With valid multiple consent management providers config", "config": { "apiKey": "test-host", + "productTagKey": "AP-XXXXXX-1", "consentManagement": { "web": [ { @@ -35,6 +36,7 @@ "testTitle": "With consent management custom provider config and invalid resolutionStrategy value", "config": { "apiKey": "test-host", + "productTagKey": "AP-XXXXXX-1", "consentManagement": { "android": [ { @@ -54,6 +56,7 @@ "testTitle": "With consent management custom provider config and no resolutionStrategy value", "config": { "apiKey": "test-host", + "productTagKey": "AP-XXXXXX-1", "consentManagement": { "android": [ { @@ -72,6 +75,7 @@ "testTitle": "With consent management OneTrust provider config and no resolutionStrategy value", "config": { "apiKey": "test-host", + "productTagKey": "AP-XXXXXX-1", "consentManagement": { "android": [ { @@ -86,6 +90,7 @@ "testTitle": "With consent management custom provider config invalid provider value", "config": { "apiKey": "test-host", + "productTagKey": "AP-XXXXXX-1", "consentManagement": { "android": [ { @@ -97,10 +102,52 @@ "result": false, "err": ["consentManagement.android.0.provider must be equal to one of the allowed values"] }, + { + "testTitle": "Without apiKey", + "config": { + "productTagKey": "AP-XXXXXX-1", + "oneTrustCookieCategories": { + "oneTrustCookieCategory": "C0001" + }, + "connectionMode": { + "web": "cloud" + } + }, + "result": false, + "err": [" must have required property 'apiKey'"] + }, + { + "testTitle": "Without productTagKey", + "config": { + "apiKey": "test-host", + "oneTrustCookieCategories": { + "oneTrustCookieCategory": "C0001" + }, + "connectionMode": { + "web": "cloud" + } + }, + "result": false, + "err": [" must have required property 'productTagKey'"] + }, + { + "testTitle": "Without apiKey and productTagKey", + "config": { + "oneTrustCookieCategories": { + "oneTrustCookieCategory": "C0001" + }, + "connectionMode": { + "web": "cloud" + } + }, + "result": false, + "err": [" must have required property 'apiKey'", " must have required property 'productTagKey'"] + }, { "testTitle": "With valid multiple consent management providers config", "config": { "apiKey": "test-host", + "productTagKey": "AP-XXXXXX-1", "consentManagement": { "web": [ { @@ -255,6 +302,7 @@ "testTitle": "With valid multiple consent management providers config", "config": { "apiKey": "test-host", + "productTagKey": "AP-XXXXXX-1", "consentManagement": { "web": [ { @@ -304,6 +352,7 @@ "testTitle": "With valid multiple consent management providers config", "config": { "apiKey": "test-host", + "productTagKey": "AP-XXXXXX-1", "consentManagement": { "web": [ { From 946b54d10e833f7e65820def41b2a9ef48cc646d Mon Sep 17 00:00:00 2001 From: shrouti1507 <60211312+shrouti1507@users.noreply.github.com> Date: Wed, 9 Oct 2024 10:45:22 +0530 Subject: [PATCH 3/9] chore: adding salesforce oauth sandbox support for closed testing (#1732) --- .../salesforce_oauth_sandbox/db-config.json | 113 +++ .../salesforce_oauth_sandbox/schema.json | 777 ++++++++++++++++++ .../salesforce_oauth_sandbox/ui-config.json | 161 ++++ .../salesforce_oauth_sandbox.json | 344 ++++++++ 4 files changed, 1395 insertions(+) create mode 100644 src/configurations/destinations/salesforce_oauth_sandbox/db-config.json create mode 100644 src/configurations/destinations/salesforce_oauth_sandbox/schema.json create mode 100644 src/configurations/destinations/salesforce_oauth_sandbox/ui-config.json create mode 100644 test/data/validation/destinations/salesforce_oauth_sandbox.json diff --git a/src/configurations/destinations/salesforce_oauth_sandbox/db-config.json b/src/configurations/destinations/salesforce_oauth_sandbox/db-config.json new file mode 100644 index 000000000..bcbb2d1ef --- /dev/null +++ b/src/configurations/destinations/salesforce_oauth_sandbox/db-config.json @@ -0,0 +1,113 @@ +{ + "name": "SALESFORCE_OAUTH_SANDBOX", + "displayName": "Salesforce Sandbox V2 ", + "config": { + "isAudienceSupported": true, + "supportsVisualMapper": true, + "auth": { + "type": "OAuth", + "role": "salesforce_sandbox", + "rudderScopes": ["delivery"] + }, + "transformAtV1": "router", + "saveDestinationResponse": true, + "includeKeys": ["oneTrustCookieCategories", "consentManagement"], + "excludeKeys": [], + "supportedSourceTypes": [ + "android", + "ios", + "web", + "unity", + "amp", + "cloud", + "warehouse", + "reactnative", + "flutter", + "cordova" + ], + "supportedMessageTypes": ["identify"], + "destConfig": { + "defaultConfig": ["rudderAccountId", "mapProperties", "useContactId"], + "android": [ + "connectionMode", + "consentManagement", + "oneTrustCookieCategories", + "ketchConsentPurposes" + ], + "ios": [ + "connectionMode", + "consentManagement", + "oneTrustCookieCategories", + "ketchConsentPurposes" + ], + "web": [ + "connectionMode", + "consentManagement", + "oneTrustCookieCategories", + "ketchConsentPurposes" + ], + "unity": [ + "connectionMode", + "consentManagement", + "oneTrustCookieCategories", + "ketchConsentPurposes" + ], + "amp": [ + "connectionMode", + "consentManagement", + "oneTrustCookieCategories", + "ketchConsentPurposes" + ], + "cloud": [ + "connectionMode", + "consentManagement", + "oneTrustCookieCategories", + "ketchConsentPurposes" + ], + "warehouse": [ + "connectionMode", + "consentManagement", + "oneTrustCookieCategories", + "ketchConsentPurposes" + ], + "reactnative": [ + "connectionMode", + "consentManagement", + "oneTrustCookieCategories", + "ketchConsentPurposes" + ], + "flutter": [ + "connectionMode", + "consentManagement", + "oneTrustCookieCategories", + "ketchConsentPurposes" + ], + "cordova": [ + "connectionMode", + "consentManagement", + "oneTrustCookieCategories", + "ketchConsentPurposes" + ] + }, + "secretKeys": [], + "supportedConnectionModes": { + "android": ["cloud"], + "ios": ["cloud"], + "web": ["cloud"], + "unity": ["cloud"], + "amp": ["cloud"], + "cloud": ["cloud"], + "warehouse": ["cloud"], + "reactnative": ["cloud"], + "flutter": ["cloud"], + "cordova": ["cloud"] + } + }, + "options": { + "hidden": { + "featureFlagName": "AMP_salesforce_sandbox", + "featureFlagValue": false + }, + "isBeta": true + } +} diff --git a/src/configurations/destinations/salesforce_oauth_sandbox/schema.json b/src/configurations/destinations/salesforce_oauth_sandbox/schema.json new file mode 100644 index 000000000..3d52493b6 --- /dev/null +++ b/src/configurations/destinations/salesforce_oauth_sandbox/schema.json @@ -0,0 +1,777 @@ +{ + "configSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "required": [], + "type": "object", + "properties": { + "mapProperties": { + "type": "boolean", + "default": true + }, + "useContactId": { + "type": "boolean", + "default": false + }, + "oneTrustCookieCategories": { + "type": "object", + "properties": { + "android": { + "type": "array", + "items": { + "type": "object", + "properties": { + "oneTrustCookieCategory": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "ios": { + "type": "array", + "items": { + "type": "object", + "properties": { + "oneTrustCookieCategory": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "web": { + "type": "array", + "items": { + "type": "object", + "properties": { + "oneTrustCookieCategory": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "unity": { + "type": "array", + "items": { + "type": "object", + "properties": { + "oneTrustCookieCategory": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "amp": { + "type": "array", + "items": { + "type": "object", + "properties": { + "oneTrustCookieCategory": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "cloud": { + "type": "array", + "items": { + "type": "object", + "properties": { + "oneTrustCookieCategory": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "warehouse": { + "type": "array", + "items": { + "type": "object", + "properties": { + "oneTrustCookieCategory": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "reactnative": { + "type": "array", + "items": { + "type": "object", + "properties": { + "oneTrustCookieCategory": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "flutter": { + "type": "array", + "items": { + "type": "object", + "properties": { + "oneTrustCookieCategory": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "cordova": { + "type": "array", + "items": { + "type": "object", + "properties": { + "oneTrustCookieCategory": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + } + }, + "consentManagement": { + "type": "object", + "properties": { + "cloud": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + }, + "warehouse": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + }, + "android": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + }, + "ios": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + }, + "web": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + }, + "unity": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + }, + "amp": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + }, + "reactnative": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + }, + "flutter": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + }, + "cordova": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + } + } + }, + "connectionMode": { + "type": "object", + "properties": { + "android": { + "type": "string", + "enum": ["cloud"] + }, + "ios": { + "type": "string", + "enum": ["cloud"] + }, + "web": { + "type": "string", + "enum": ["cloud"] + }, + "unity": { + "type": "string", + "enum": ["cloud"] + }, + "amp": { + "type": "string", + "enum": ["cloud"] + }, + "cloud": { + "type": "string", + "enum": ["cloud"] + }, + "warehouse": { + "type": "string", + "enum": ["cloud"] + }, + "reactnative": { + "type": "string", + "enum": ["cloud"] + }, + "flutter": { + "type": "string", + "enum": ["cloud"] + }, + "cordova": { + "type": "string", + "enum": ["cloud"] + } + } + }, + "ketchConsentPurposes": { + "type": "object", + "properties": { + "android": { + "type": "array", + "items": { + "type": "object", + "properties": { + "purpose": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "ios": { + "type": "array", + "items": { + "type": "object", + "properties": { + "purpose": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "web": { + "type": "array", + "items": { + "type": "object", + "properties": { + "purpose": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "unity": { + "type": "array", + "items": { + "type": "object", + "properties": { + "purpose": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "amp": { + "type": "array", + "items": { + "type": "object", + "properties": { + "purpose": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "cloud": { + "type": "array", + "items": { + "type": "object", + "properties": { + "purpose": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "warehouse": { + "type": "array", + "items": { + "type": "object", + "properties": { + "purpose": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "reactnative": { + "type": "array", + "items": { + "type": "object", + "properties": { + "purpose": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "flutter": { + "type": "array", + "items": { + "type": "object", + "properties": { + "purpose": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "cordova": { + "type": "array", + "items": { + "type": "object", + "properties": { + "purpose": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + } + } + } + } +} diff --git a/src/configurations/destinations/salesforce_oauth_sandbox/ui-config.json b/src/configurations/destinations/salesforce_oauth_sandbox/ui-config.json new file mode 100644 index 000000000..60e469af2 --- /dev/null +++ b/src/configurations/destinations/salesforce_oauth_sandbox/ui-config.json @@ -0,0 +1,161 @@ +{ + "uiConfig": [ + { + "title": "Other Settings", + "fields": [ + { + "type": "checkbox", + "label": "Map Rudder Properties to Salesforce Properties", + "value": "mapProperties", + "default": true + }, + { + "type": "checkbox", + "label": "Use contactId for converted leads", + "value": "useContactId", + "default": false, + "footerNote": "It is suggested to enable this option when both lead and contact field mappings are same." + } + ] + }, + { + "title": "Consent Settings", + "fields": [ + { + "type": "dynamicCustomForm", + "value": "oneTrustCookieCategories", + "label": "OneTrust Consent Category IDs", + "footerNote": "The support for category names is deprecated. We recommend using the category IDs instead of the names as IDs are unique and less likely to change over time, making them a more reliable choice.", + "customFields": [ + { + "type": "textInput", + "placeholder": "C0001", + "value": "oneTrustCookieCategory", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$", + "label": "Category ID", + "required": false + } + ], + "preRequisites": { + "featureFlags": [ + { + "configKey": "AMP_enable-gcm", + "value": false + }, + { + "configKey": "AMP_enable-gcm" + } + ], + "featureFlagsCondition": "or" + } + }, + { + "type": "dynamicCustomForm", + "value": "ketchConsentPurposes", + "label": "Ketch Consent Purpose IDs", + "customFields": [ + { + "type": "textInput", + "placeholder": "marketing", + "value": "purpose", + "label": "Purpose ID", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$", + "required": false + } + ], + "preRequisites": { + "featureFlags": [ + { + "configKey": "AMP_enable-gcm", + "value": false + }, + { + "configKey": "AMP_enable-gcm" + } + ], + "featureFlagsCondition": "or" + } + }, + { + "type": "dynamicCustomForm", + "value": "consentManagement", + "label": "Consent management settings", + "footerNote": "The support for category names is deprecated. We recommend using the category IDs instead of the names as IDs are unique and less likely to change over time, making them a more reliable choice.", + "customFields": [ + { + "type": "singleSelect", + "label": "Consent management provider", + "value": "provider", + "options": [ + { + "name": "Custom", + "value": "custom" + }, + { + "name": "Ketch", + "value": "ketch" + }, + { + "name": "OneTrust", + "value": "oneTrust" + } + ], + "defaultOption": { + "name": "OneTrust", + "value": "oneTrust" + }, + "required": true + }, + { + "type": "singleSelect", + "label": "the required consent logic", + "value": "resolutionStrategy", + "options": [ + { + "name": "AND", + "value": "and" + }, + { + "name": "OR", + "value": "or" + } + ], + "required": true, + "variant": "badge", + "preRequisites": { + "fields": [ + { + "configKey": "provider", + "value": "custom" + } + ] + } + }, + { + "type": "dynamicCustomForm", + "value": "consents", + "label": "Enter consent category ID’s", + "customFields": [ + { + "type": "textInput", + "placeholder": "Marketing", + "value": "consent", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$", + "required": false + } + ] + } + ], + "preRequisites": { + "featureFlags": [ + { + "configKey": "AMP_enable-gcm", + "value": true + } + ] + } + } + ] + } + ] +} diff --git a/test/data/validation/destinations/salesforce_oauth_sandbox.json b/test/data/validation/destinations/salesforce_oauth_sandbox.json new file mode 100644 index 000000000..3b74a77b8 --- /dev/null +++ b/test/data/validation/destinations/salesforce_oauth_sandbox.json @@ -0,0 +1,344 @@ +[ + { + "config": { + "mapProperties": true, + "useContactId": true + }, + "result": true + }, + { + "config": { + "mapProperties": true, + "useContactId": true + }, + "result": true + }, + { + "config": { + "mapProperties": true, + "useContactId": true + }, + "result": true + }, + { + "testTitle": "With valid multiple consent management providers config", + "config": { + "mapProperties": true, + "useContactId": true, + "consentManagement": { + "web": [ + { + "provider": "custom", + "consents": [ + { + "consent": "Marketing" + } + ], + "resolutionStrategy": "or" + }, + { + "provider": "oneTrust", + "consents": [ + { + "consent": "Marketing" + } + ] + }, + { + "provider": "ketch", + "consents": [] + } + ] + } + }, + "result": true + }, + { + "testTitle": "With consent management custom provider config and invalid resolutionStrategy value", + "config": { + "mapProperties": true, + "useContactId": true, + "consentManagement": { + "android": [ + { + "provider": "custom", + "resolutionStrategy": "nor" + } + ] + } + }, + "result": false, + "err": [ + "consentManagement.android.0.resolutionStrategy must be equal to one of the allowed values", + "consentManagement.android.0 must match \"then\" schema" + ] + }, + { + "testTitle": "With consent management custom provider config and no resolutionStrategy value", + "config": { + "mapProperties": true, + "useContactId": true, + "consentManagement": { + "android": [ + { + "provider": "custom" + } + ] + } + }, + "result": false, + "err": [ + "consentManagement.android.0 must have required property 'resolutionStrategy'", + "consentManagement.android.0 must match \"then\" schema" + ] + }, + { + "testTitle": "With consent management OneTrust provider config and no resolutionStrategy value", + "config": { + "mapProperties": true, + "useContactId": true, + "consentManagement": { + "android": [ + { + "provider": "oneTrust" + } + ] + } + }, + "result": true + }, + { + "testTitle": "With consent management custom provider config invalid provider value", + "config": { + "mapProperties": true, + "useContactId": true, + "consentManagement": { + "android": [ + { + "provider": "dummyProvider" + } + ] + } + }, + "result": false, + "err": ["consentManagement.android.0.provider must be equal to one of the allowed values"] + }, + { + "config": { + "mapProperties": true, + "useContactId": true, + "oneTrustCookieCategories": { + "android": [ + { + "oneTrustCookieCategory": "C0001" + }, + { + "oneTrustCookieCategory": "C0002" + } + ], + "ios": [ + { + "oneTrustCookieCategory": "C0003" + }, + { + "oneTrustCookieCategory": "C0004" + } + ], + "web": [ + { + "oneTrustCookieCategory": "" + } + ], + "unity": [], + "amp": [ + { + "oneTrustCookieCategory": "env.ENVIRONMENT_VARIABLE" + } + ], + "cloud": [ + { + "oneTrustCookieCategory": "{{ event.properties.prop1 || 'val' }}" + } + ], + "warehouse": [ + { + "oneTrustCookieCategory": "C0001" + }, + { + "oneTrustCookieCategory": "C0002" + } + ], + "reactnative": [ + { + "oneTrustCookieCategory": "C0003" + }, + { + "oneTrustCookieCategory": "C0004" + } + ], + "flutter": [ + { + "oneTrustCookieCategory": "" + } + ], + "cordova": [] + }, + "ketchConsentPurposes": { + "android": [ + { + "purpose": "P1" + }, + { + "purpose": "P2" + } + ], + "ios": [ + { + "purpose": "P3" + }, + { + "purpose": "P4" + } + ], + "web": [ + { + "purpose": "" + } + ], + "unity": [], + "amp": [ + { + "purpose": "env.ENVIRONMENT_VARIABLE" + } + ], + "cloud": [ + { + "purpose": "{{ event.properties.prop1 || 'val' }}" + } + ], + "warehouse": [ + { + "purpose": "P1" + }, + { + "purpose": "P2" + } + ], + "reactnative": [ + { + "purpose": "P3" + }, + { + "purpose": "P4" + } + ], + "flutter": [ + { + "purpose": "" + } + ], + "cordova": [] + } + }, + "result": true + }, + { + "config": { + "mapProperties": true, + "useContactId": true, + "oneTrustCookieCategories": [ + { + "oneTrustCookieCategory": "C0001" + }, + { + "oneTrustCookieCategory": "C0002" + } + ], + "ketchConsentPurposes": [ + { + "purpose": "P1" + }, + { + "purpose": "P2" + } + ] + }, + "result": false, + "err": ["oneTrustCookieCategories must be object", "ketchConsentPurposes must be object"] + }, + { + "config": { + "mapProperties": true, + "useContactId": true, + "oneTrustCookieCategories": { + "android": [ + { + "oneTrustCookieCategory": "more than 100 characters string - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "oneTrustCookieCategory": "C0004" + } + ], + "ios": [ + { + "oneTrustCookieCategory": { + "not": "a string" + } + }, + { + "oneTrustCookieCategory": "C0004" + } + ], + "web": { + "not": "an array" + }, + "unity": [ + "not an object", + { + "oneTrustCookieCategory": "C0004" + } + ] + }, + "ketchConsentPurposes": { + "android": [ + { + "purpose": "more than 100 characters string - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "purpose": "P4" + } + ], + "ios": [ + { + "purpose": { + "not": "a string" + } + }, + { + "purpose": "P4" + } + ], + "web": { + "not": "an array" + }, + "unity": [ + "not an object", + { + "purpose": "P4" + } + ] + } + }, + "result": false, + "err": [ + "oneTrustCookieCategories.android.0.oneTrustCookieCategory must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$\"", + "oneTrustCookieCategories.ios.0.oneTrustCookieCategory must be string", + "oneTrustCookieCategories.web must be array", + "oneTrustCookieCategories.unity.0 must be object", + "ketchConsentPurposes.android.0.purpose must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$\"", + "ketchConsentPurposes.ios.0.purpose must be string", + "ketchConsentPurposes.web must be array", + "ketchConsentPurposes.unity.0 must be object" + ] + } +] From 2ef7ae497b3bad172024d1eeb54beb223ddf296a Mon Sep 17 00:00:00 2001 From: Mohamed Khattab Date: Wed, 9 Oct 2024 08:40:25 +0300 Subject: [PATCH 4/9] feat: add Iubenda support to ga4 destination (#1691) Co-authored-by: Sai Kumar Battinoju <88789928+saikumarrs@users.noreply.github.com> --- .../destinations/ga4/schema.json | 22 +++++++++---------- .../destinations/ga4/ui-config.json | 4 ++++ test/data/validation/destinations/ga4.json | 11 ++++++++++ 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/configurations/destinations/ga4/schema.json b/src/configurations/destinations/ga4/schema.json index 978226d65..95851788e 100644 --- a/src/configurations/destinations/ga4/schema.json +++ b/src/configurations/destinations/ga4/schema.json @@ -342,7 +342,7 @@ "properties": { "provider": { "type": "string", - "enum": ["custom", "ketch", "oneTrust"], + "enum": ["custom", "iubenda", "ketch", "oneTrust"], "default": "oneTrust" }, "consents": { @@ -388,7 +388,7 @@ "properties": { "provider": { "type": "string", - "enum": ["custom", "ketch", "oneTrust"], + "enum": ["custom", "iubenda", "ketch", "oneTrust"], "default": "oneTrust" }, "consents": { @@ -434,7 +434,7 @@ "properties": { "provider": { "type": "string", - "enum": ["custom", "ketch", "oneTrust"], + "enum": ["custom", "iubenda", "ketch", "oneTrust"], "default": "oneTrust" }, "consents": { @@ -480,7 +480,7 @@ "properties": { "provider": { "type": "string", - "enum": ["custom", "ketch", "oneTrust"], + "enum": ["custom", "iubenda", "ketch", "oneTrust"], "default": "oneTrust" }, "consents": { @@ -526,7 +526,7 @@ "properties": { "provider": { "type": "string", - "enum": ["custom", "ketch", "oneTrust"], + "enum": ["custom", "iubenda", "ketch", "oneTrust"], "default": "oneTrust" }, "consents": { @@ -572,7 +572,7 @@ "properties": { "provider": { "type": "string", - "enum": ["custom", "ketch", "oneTrust"], + "enum": ["custom", "iubenda", "ketch", "oneTrust"], "default": "oneTrust" }, "consents": { @@ -618,7 +618,7 @@ "properties": { "provider": { "type": "string", - "enum": ["custom", "ketch", "oneTrust"], + "enum": ["custom", "iubenda", "ketch", "oneTrust"], "default": "oneTrust" }, "consents": { @@ -664,7 +664,7 @@ "properties": { "provider": { "type": "string", - "enum": ["custom", "ketch", "oneTrust"], + "enum": ["custom", "iubenda", "ketch", "oneTrust"], "default": "oneTrust" }, "consents": { @@ -710,7 +710,7 @@ "properties": { "provider": { "type": "string", - "enum": ["custom", "ketch", "oneTrust"], + "enum": ["custom", "iubenda", "ketch", "oneTrust"], "default": "oneTrust" }, "consents": { @@ -756,7 +756,7 @@ "properties": { "provider": { "type": "string", - "enum": ["custom", "ketch", "oneTrust"], + "enum": ["custom", "iubenda", "ketch", "oneTrust"], "default": "oneTrust" }, "consents": { @@ -802,7 +802,7 @@ "properties": { "provider": { "type": "string", - "enum": ["custom", "ketch", "oneTrust"], + "enum": ["custom", "iubenda", "ketch", "oneTrust"], "default": "oneTrust" }, "consents": { diff --git a/src/configurations/destinations/ga4/ui-config.json b/src/configurations/destinations/ga4/ui-config.json index b94667b39..135b8bc34 100644 --- a/src/configurations/destinations/ga4/ui-config.json +++ b/src/configurations/destinations/ga4/ui-config.json @@ -473,6 +473,10 @@ "label": "Custom", "value": "custom" }, + { + "label": "Iubenda", + "value": "iubenda" + }, { "label": "Ketch", "value": "ketch" diff --git a/test/data/validation/destinations/ga4.json b/test/data/validation/destinations/ga4.json index a83d24e28..6606a3168 100644 --- a/test/data/validation/destinations/ga4.json +++ b/test/data/validation/destinations/ga4.json @@ -317,6 +317,17 @@ { "provider": "ketch", "consents": [] + }, + { + "provider": "iubenda", + "consents": [ + { + "consent": "1" + }, + { + "consent": "4" + } + ] } ] } From d45386b4081d0d910b078c073147257842b78772 Mon Sep 17 00:00:00 2001 From: Sudip Paul <67197965+ItsSudip@users.noreply.github.com> Date: Wed, 9 Oct 2024 11:51:24 +0530 Subject: [PATCH 5/9] fix: add new field for list of props (#1734) --- .../destinations/af/db-config.json | 3 ++- src/configurations/destinations/af/schema.json | 11 +++++++++++ .../destinations/af/ui-config.json | 18 ++++++++++++++++++ test/data/validation/destinations/af.json | 14 ++++++++++++++ 4 files changed, 45 insertions(+), 1 deletion(-) diff --git a/src/configurations/destinations/af/db-config.json b/src/configurations/destinations/af/db-config.json index 1c28e7384..92c3642b7 100644 --- a/src/configurations/destinations/af/db-config.json +++ b/src/configurations/destinations/af/db-config.json @@ -69,7 +69,8 @@ "whitelistedEvents", "eventFilteringOption", "statusCallbackUrls", - "apiToken" + "apiToken", + "listOfProps" ], "android": [ "useNativeSDK", diff --git a/src/configurations/destinations/af/schema.json b/src/configurations/destinations/af/schema.json index 31cc8aa98..1bafe6cd2 100644 --- a/src/configurations/destinations/af/schema.json +++ b/src/configurations/destinations/af/schema.json @@ -25,6 +25,17 @@ "type": "boolean", "default": false }, + "listOfProps": { + "type": "array", + "items": { + "type": "object", + "properties": { + "property": { + "type": "string" + } + } + } + }, "afCurrencyAtRoot": { "type": "boolean", "default": false diff --git a/src/configurations/destinations/af/ui-config.json b/src/configurations/destinations/af/ui-config.json index b4d0e5042..8a344f206 100644 --- a/src/configurations/destinations/af/ui-config.json +++ b/src/configurations/destinations/af/ui-config.json @@ -82,6 +82,24 @@ "footerNote": "To send the custom properties to the root of eventValue.", "default": false }, + { + "type": "dynamicCustomForm", + "label": "List of properties", + "value": "listOfProps", + "footerNote": "Add your name of properties that need to be sent at the root of eventValue.", + "customFields": [ + { + "type": "textInput", + "value": "property", + "required": false, + "placeholder": "e.g: Price" + } + ], + "preRequisiteField": { + "name": "addPropertiesAtRoot", + "selectedValue": false + } + }, { "type": "checkbox", "label": "Add af_currency to root of eventValue", diff --git a/test/data/validation/destinations/af.json b/test/data/validation/destinations/af.json index d1db8844c..c90a568a3 100644 --- a/test/data/validation/destinations/af.json +++ b/test/data/validation/destinations/af.json @@ -8,6 +8,20 @@ "useRichEventName": true, "sharingFilter": "all", "eventFilteringOption": "whitelistedEvents", + "listOfProps": [ + { + "property": "prop1" + }, + { + "property": "prop2" + }, + { + "property": "prop3" + }, + { + "property": "prop4" + } + ], "whitelistedEvents": [ { "eventName": "devKey_event" From e6f2b974605b25c95aa843d9c82561f6037b6b15 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 9 Oct 2024 09:46:28 +0000 Subject: [PATCH 6/9] chore(release): 1.95.0 --- CHANGELOG.md | 13 +++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97131132c..5b91072c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [1.95.0](https://github.com/rudderlabs/rudder-config-schema/compare/v1.94.2...v1.95.0) (2024-10-09) + + +### Features + +* add Iubenda support to ga4 destination ([#1691](https://github.com/rudderlabs/rudder-config-schema/issues/1691)) ([2ef7ae4](https://github.com/rudderlabs/rudder-config-schema/commit/2ef7ae497b3bad172024d1eeb54beb223ddf296a)) +* added test cases ([#1659](https://github.com/rudderlabs/rudder-config-schema/issues/1659)) ([6339410](https://github.com/rudderlabs/rudder-config-schema/commit/6339410ecec4f6739df44383b866b82662642ae6)) + + +### Bug Fixes + +* add new field for list of props ([#1734](https://github.com/rudderlabs/rudder-config-schema/issues/1734)) ([d45386b](https://github.com/rudderlabs/rudder-config-schema/commit/d45386b4081d0d910b078c073147257842b78772)) + ### [1.94.2](https://github.com/rudderlabs/rudder-config-schema/compare/v1.94.1...v1.94.2) (2024-10-04) diff --git a/package-lock.json b/package-lock.json index edba10b1a..da2162394 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rudder-config-schema", - "version": "1.94.2", + "version": "1.95.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rudder-config-schema", - "version": "1.94.2", + "version": "1.95.0", "license": "MIT", "dependencies": { "ajv": "^8.12.0", diff --git a/package.json b/package.json index c380fa19a..544808968 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rudder-config-schema", - "version": "1.94.2", + "version": "1.95.0", "description": "", "main": "src/index.ts", "private": true, From d841adfc5103978a6a83412a51a00f87a9b7f28f Mon Sep 17 00:00:00 2001 From: Anant Jain <62471433+anantjain45823@users.noreply.github.com> Date: Wed, 9 Oct 2024 17:02:50 +0530 Subject: [PATCH 7/9] feat: onboard Amazon Audience (#1667) Co-authored-by: Yashasvi Bajpai <33063622+yashasvibajpai@users.noreply.github.com> --- .../amazon_audience/db-config.json | 40 +++ .../destinations/amazon_audience/schema.json | 134 ++++++++ .../amazon_audience/ui-config.json | 299 ++++++++++++++++++ .../destinations/x_audience/ui-config.json | 1 + .../destinations/amazon_audience.json | 33 ++ 5 files changed, 507 insertions(+) create mode 100644 src/configurations/destinations/amazon_audience/db-config.json create mode 100644 src/configurations/destinations/amazon_audience/schema.json create mode 100644 src/configurations/destinations/amazon_audience/ui-config.json create mode 100644 test/data/validation/destinations/amazon_audience.json diff --git a/src/configurations/destinations/amazon_audience/db-config.json b/src/configurations/destinations/amazon_audience/db-config.json new file mode 100644 index 000000000..7ea203fc4 --- /dev/null +++ b/src/configurations/destinations/amazon_audience/db-config.json @@ -0,0 +1,40 @@ +{ + "name": "AMAZON_AUDIENCE", + "displayName": "Amazon Audience", + "config": { + "auth": { "type": "OAuth", "role": "amazon_audience", "rudderScopes": ["delivery"] }, + "transformAtV1": "router", + "excludeKeys": [], + "supportedSourceTypes": ["warehouse"], + "supportedConnectionModes": { + "warehouse": ["cloud"] + }, + "isAudienceSupported": true, + "supportsBlankAudienceCreation": true, + "syncBehaviours": ["mirror"], + "disableJsonMapper": true, + "supportsVisualMapper": true, + "includeKeys": ["oneTrustCookieCategories", "consentManagement"], + "destConfig": { + "defaultConfig": [ + "rudderAccountId", + "audienceId", + "authServer", + "advertiserId", + "externalAudienceId", + "ttl", + "dataSourceCountry", + "enableHash" + ], + "warehouse": [ + "oneTrustCookieCategories", + "connectionMode", + "consentManagement", + "ketchConsentPurposes" + ] + }, + "secretKeys": [], + "supportedMessageTypes": { "cloud": ["record"] } + }, + "options": { "isBeta": true } +} diff --git a/src/configurations/destinations/amazon_audience/schema.json b/src/configurations/destinations/amazon_audience/schema.json new file mode 100644 index 000000000..e06a702c1 --- /dev/null +++ b/src/configurations/destinations/amazon_audience/schema.json @@ -0,0 +1,134 @@ +{ + "configSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "required": ["authServer"], + "properties": { + "authServer": { + "type": "string", + "enum": ["North America"], + "default": "North America" + }, + "advertiserId": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,150})$" + }, + "externalAudienceId": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,50})$" + }, + "ttl": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^[0-9]\\d*$" + }, + "enableHash": { + "type": "boolean", + "default": false + }, + "dataSourceCountry": { + "type": "array", + "items": { + "type": "object", + "properties": { + "country": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "oneTrustCookieCategories": { + "type": "object", + "properties": { + "warehouse": { + "type": "array", + "items": { + "type": "object", + "properties": { + "oneTrustCookieCategory": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + } + }, + "consentManagement": { + "type": "object", + "properties": { + "warehouse": { + "type": "array", + "items": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "enum": ["custom", "ketch", "oneTrust"], + "default": "oneTrust" + }, + "consents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "consent": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, + "allOf": [ + { + "if": { + "properties": { + "provider": { + "const": "custom" + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "resolutionStrategy": { + "type": "string", + "enum": ["and", "or"] + } + }, + "required": ["resolutionStrategy"] + } + } + ] + } + } + } + }, + "ketchConsentPurposes": { + "type": "object", + "properties": { + "warehouse": { + "type": "array", + "items": { + "type": "object", + "properties": { + "purpose": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + } + }, + "connectionMode": { + "type": "object", + "properties": { + "cloud": { "type": "string", "enum": ["cloud"] }, + "warehouse": { "type": "string", "enum": ["cloud"] } + } + } + } + } +} diff --git a/src/configurations/destinations/amazon_audience/ui-config.json b/src/configurations/destinations/amazon_audience/ui-config.json new file mode 100644 index 000000000..86ccce9c6 --- /dev/null +++ b/src/configurations/destinations/amazon_audience/ui-config.json @@ -0,0 +1,299 @@ +{ + "uiConfig": { + "baseTemplate": [ + { + "title": "Initial setup", + "note": "Review how this destination is set up", + "sections": [ + { + "groups": [ + { + "title": "Connection settings", + "note": "Update your connection settings here", + "icon": "settings", + "fields": [ + { + "configKey": "advertiserId", + "type": "nestedSelect", + "label": "Select your Account", + "apiName": "getAmazonAdvertiser", + "placeholder": "Select Advertiser Id details", + "preRequisites": { + "fields": [ + { + "configKey": "rudderAccountId", + "exists": true + } + ] + } + }, + { + "type": "singleSelect", + "label": "Authorization servers", + "note": " Support for more servers will be added soon", + "configKey": "authServer", + "options": [ + { + "name": "North America", + "value": "North America" + } + ], + "default": "North America" + } + ] + } + ] + }, + { + "groups": [ + { + "title": "Connection mode", + "note": [ + "Update how you want to route events from your source to destination. ", + { + "text": "Get help deciding", + "link": "https://www.rudderstack.com/docs/destinations/rudderstack-connection-modes/" + } + ], + "icon": "sliders", + "fields": [] + } + ] + } + ] + }, + { + "title": "Configuration settings", + "note": "Manage the settings for your destination", + "sections": [ + { + "groups": [ + { + "title": "Optional configuration settings", + "note": "Configure advanced destination-specific settings here", + "icon": "settings", + "fields": [ + { + "type": "checkbox", + "label": "Enable user data hashing", + "note": [ + "Enabling this will hash all the user data before sending it to Amazon Audience", + "Do not enable it if you already pass hash data to rudderstack" + ], + "configKey": "enableHash", + "default": false + } + ] + }, + { + "title": "Optional Audience Creation Configuration settings", + "icon": "settings", + "fields": [ + { + "configKey": "externalAudienceId", + "type": "textInput", + "label": "Type External Audience Id to use while creating Audience", + "placeholder": "Default: Rudderstack Audience", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,50})$", + "regexErrorMessage": "Invalid External Audience Id", + "default": "Rudderstack Audience" + }, + { + "configKey": "ttl", + "type": "textInput", + "label": "Time To Live", + "placeholder": "Default: 34300800(13 Months)", + "regexErrorMessage": "ttl should be in number", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^[0-9]\\d*$", + "note": [ + "Refer below link for more info", + { + "text": "Time To live", + "link": "https://advertising.amazon.com/API/docs/en-us/guides/amazon-marketing-cloud/audiences/audience-management-service#:~:text=a%20given%20invocation.-,Note,-The%20time%2Dto" + } + ], + "default": "34300800" + }, + { + "type": "tagInput", + "label": "Data Source Countries", + "configKey": "dataSourceCountry", + "tagKey": "country", + "placeholder": "e.g: US", + "note": [ + "Refer below link for more info", + { + "text": "Data Source Countries", + "link": "https://advertising.amazon.com/API/docs/en-us/guides/amazon-marketing-cloud/audiences/audience-management-service#:~:text=a%20given%20invocation.-,Note,-The%20time%2Dto" + } + ], + "default": [ + { + "country": "US" + } + ] + } + ] + } + ] + }, + { + "title": "Other settings", + "note": "Configure advanced RudderStack features here", + "icon": "otherSettings", + "groups": [ + { + "title": "OneTrust consent settings", + "note": [ + "Enter your OneTrust consent category IDs if you have them configured. The support for category names is deprecated. We recommend using the category IDs instead of the names as IDs are unique and less likely to change over time, making them a more reliable choice.", + { + "text": "Learn more ", + "link": "https://www.rudderstack.com/docs/sources/event-streams/sdks/consent-manager/onetrust/" + }, + "about RudderStack's OneTrust Consent Management feature." + ], + "fields": [ + { + "type": "tagInput", + "label": "OneTrust consent category IDs", + "note": "Input your OneTrust category IDs by pressing 'Enter' after each entry. The support for category names is deprecated. We recommend using the category IDs instead of the names as IDs are unique and less likely to change over time, making them a more reliable choice.", + "configKey": "oneTrustCookieCategories", + "tagKey": "oneTrustCookieCategory", + "placeholder": "e.g: C0001", + "default": [ + { + "oneTrustCookieCategory": "" + } + ], + "preRequisites": { + "featureFlags": [ + { + "configKey": "AMP_enable-gcm", + "value": false + }, + { + "configKey": "AMP_enable-gcm" + } + ], + "featureFlagsCondition": "or" + } + } + ] + } + ] + } + ] + } + ], + "sdkTemplate": { + "title": "Web SDK settings", + "note": "not visible in the ui", + "fields": [] + }, + "consentSettingsTemplate": { + "title": "Consent settings", + "note": "not visible in the ui", + "fields": [ + { + "type": "dynamicCustomForm", + "configKey": "consentManagement", + "default": [], + "rowFields": [ + { + "type": "singleSelect", + "label": "Consent management provider", + "configKey": "provider", + "options": [ + { + "label": "Custom", + "value": "custom" + }, + { + "label": "Ketch", + "value": "ketch" + }, + { + "label": "OneTrust", + "value": "oneTrust" + } + ], + "default": "oneTrust", + "required": true + }, + { + "type": "tagInput", + "label": "Ketch consent purpose IDs", + "note": "Input your Ketch consent purpose IDs by pressing 'Enter' after each entry.", + "configKey": "ketchConsentPurposes", + "tagKey": "purpose", + "placeholder": "e.g: marketing", + "default": [ + { + "purpose": "" + } + ], + "preRequisites": { + "featureFlags": [ + { + "configKey": "AMP_enable-gcm", + "value": false + }, + { + "configKey": "AMP_enable-gcm" + } + ], + "featureFlagsCondition": "or" + } + }, + { + "type": "singleSelect", + "label": "the required consent logic", + "configKey": "resolutionStrategy", + "options": [ + { + "label": "AND", + "value": "and" + }, + { + "label": "OR", + "value": "or" + } + ], + "required": true, + "variant": "badge", + "preRequisites": { + "fields": [ + { + "configKey": "provider", + "value": "custom" + } + ] + } + }, + { + "type": "tagInput", + "label": "Enter consent category ID’s", + "note": "Input your consent category IDs by pressing ‘Enter’ after each entry. The support for category names is deprecated. We recommend using the category IDs instead of the names as IDs are unique and less likely to change over time, making them a more reliable choice.", + "configKey": "consents", + "tagKey": "consent", + "placeholder": "e.g: Marketing", + "default": [ + { + "consent": "" + } + ] + } + ], + "preRequisites": { + "featureFlags": [ + { + "configKey": "AMP_enable-gcm", + "value": true + } + ] + } + } + ] + } + } +} diff --git a/src/configurations/destinations/x_audience/ui-config.json b/src/configurations/destinations/x_audience/ui-config.json index 2bcd94dc6..eff702d61 100644 --- a/src/configurations/destinations/x_audience/ui-config.json +++ b/src/configurations/destinations/x_audience/ui-config.json @@ -17,6 +17,7 @@ "configKey": "accountId", "type": "nestedSelect", "label": "Select your Account", + "note": "Select Account -> Account Settings -> General -> AccountId", "apiName": "getXAccounts", "placeholder": "Select account details", "preRequisites": { diff --git a/test/data/validation/destinations/amazon_audience.json b/test/data/validation/destinations/amazon_audience.json new file mode 100644 index 000000000..2033585c0 --- /dev/null +++ b/test/data/validation/destinations/amazon_audience.json @@ -0,0 +1,33 @@ +[ + { + "testTitle": "With all required configs", + "config": { + "rudderAccountId": "test-host", + "ttl": "1230", + "enableHash": true, + "dataSourceCountry": [ + { + "country": "US" + }, + { + "country": "CAN" + } + ], + "advertiserId": "test-advertiser-id", + "audienceId": "test-audience-id" + }, + "result": true + }, + { + "testTitle": "With missing accountId", + "config": { + "rudderAccountId": "test-host", + "audienceId": "test-audience-id", + "advertiserId": "" + }, + "result": false, + "err": [ + "advertiserId must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,150})$\"" + ] + } +] From 3435280b68b6dbf30bdeddc751143994ad07f3f4 Mon Sep 17 00:00:00 2001 From: Sankeerth Date: Thu, 10 Oct 2024 11:36:05 +0530 Subject: [PATCH 8/9] fix: webhook regex url (#1743) Co-authored-by: Sai Sankeerth Co-authored-by: Krishna Chaitanya --- .../destinations/webhook/schema.json | 2 +- .../destinations/webhook/ui-config.json | 2 +- .../data/validation/destinations/webhook.json | 330 +++++++++++++++++- 3 files changed, 324 insertions(+), 10 deletions(-) diff --git a/src/configurations/destinations/webhook/schema.json b/src/configurations/destinations/webhook/schema.json index 9fbeb476b..68b0d558b 100644 --- a/src/configurations/destinations/webhook/schema.json +++ b/src/configurations/destinations/webhook/schema.json @@ -517,7 +517,7 @@ }, "webhookUrl": { "type": "string", - "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|(?!.*\\.ngrok\\.io)^(https?):\\/\\/(?!localhost|127\\.0\\.0\\.1|10\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|192\\.168\\.\\d{1,3}\\.\\d{1,3}|172\\.(1[6-9]|2[0-9]|3[0-1])\\.\\d{1,3}\\.\\d{1,3}|0\\.0\\.0\\.0|\\[::1\\]|\\[fc[0-9a-fA-F]{2}:.*\\]|\\[fd[0-9a-fA-F]{2}:.*\\]|\\[::ffff:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\]).*([^\\s/$.?#].[^\\s]*)$" + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$" }, "webhookMethod": { "type": "string", diff --git a/src/configurations/destinations/webhook/ui-config.json b/src/configurations/destinations/webhook/ui-config.json index 9a7448136..d9a8383a7 100644 --- a/src/configurations/destinations/webhook/ui-config.json +++ b/src/configurations/destinations/webhook/ui-config.json @@ -9,7 +9,7 @@ "value": "webhookUrl", "required": true, "placeholder": "http://www.abcd.com", - "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|(?!.*\\.ngrok\\.io)^(https?):\\/\\/(?!localhost|127\\.0\\.0\\.1|10\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|192\\.168\\.\\d{1,3}\\.\\d{1,3}|172\\.(1[6-9]|2[0-9]|3[0-1])\\.\\d{1,3}\\.\\d{1,3}|0\\.0\\.0\\.0|\\[::1\\]|\\[fc[0-9a-fA-F]{2}:.*\\]|\\[fd[0-9a-fA-F]{2}:.*\\]|\\[::ffff:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\]).*([^\\s/$.?#].[^\\s]*)$" + "regex": "^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$" }, { "type": "singleSelect", diff --git a/test/data/validation/destinations/webhook.json b/test/data/validation/destinations/webhook.json index 59f98338b..062b3e13a 100644 --- a/test/data/validation/destinations/webhook.json +++ b/test/data/validation/destinations/webhook.json @@ -39,7 +39,10 @@ } ] }, - "result": true + "result": false, + "err": [ + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" + ] }, { "config": { @@ -62,7 +65,7 @@ }, "result": false, "err": [ - "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|(?!.*\\.ngrok\\.io)^(https?):\\/\\/(?!localhost|127\\.0\\.0\\.1|10\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|192\\.168\\.\\d{1,3}\\.\\d{1,3}|172\\.(1[6-9]|2[0-9]|3[0-1])\\.\\d{1,3}\\.\\d{1,3}|0\\.0\\.0\\.0|\\[::1\\]|\\[fc[0-9a-fA-F]{2}:.*\\]|\\[fd[0-9a-fA-F]{2}:.*\\]|\\[::ffff:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\]).*([^\\s/$.?#].[^\\s]*)$\"" + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" ] }, { @@ -86,7 +89,7 @@ }, "result": false, "err": [ - "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|(?!.*\\.ngrok\\.io)^(https?):\\/\\/(?!localhost|127\\.0\\.0\\.1|10\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|192\\.168\\.\\d{1,3}\\.\\d{1,3}|172\\.(1[6-9]|2[0-9]|3[0-1])\\.\\d{1,3}\\.\\d{1,3}|0\\.0\\.0\\.0|\\[::1\\]|\\[fc[0-9a-fA-F]{2}:.*\\]|\\[fd[0-9a-fA-F]{2}:.*\\]|\\[::ffff:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\]).*([^\\s/$.?#].[^\\s]*)$\"" + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" ] }, { @@ -110,7 +113,7 @@ }, "result": false, "err": [ - "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|(?!.*\\.ngrok\\.io)^(https?):\\/\\/(?!localhost|127\\.0\\.0\\.1|10\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|192\\.168\\.\\d{1,3}\\.\\d{1,3}|172\\.(1[6-9]|2[0-9]|3[0-1])\\.\\d{1,3}\\.\\d{1,3}|0\\.0\\.0\\.0|\\[::1\\]|\\[fc[0-9a-fA-F]{2}:.*\\]|\\[fd[0-9a-fA-F]{2}:.*\\]|\\[::ffff:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\]).*([^\\s/$.?#].[^\\s]*)$\"" + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" ] }, { @@ -134,7 +137,7 @@ }, "result": false, "err": [ - "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|(?!.*\\.ngrok\\.io)^(https?):\\/\\/(?!localhost|127\\.0\\.0\\.1|10\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|192\\.168\\.\\d{1,3}\\.\\d{1,3}|172\\.(1[6-9]|2[0-9]|3[0-1])\\.\\d{1,3}\\.\\d{1,3}|0\\.0\\.0\\.0|\\[::1\\]|\\[fc[0-9a-fA-F]{2}:.*\\]|\\[fd[0-9a-fA-F]{2}:.*\\]|\\[::ffff:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\]).*([^\\s/$.?#].[^\\s]*)$\"" + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" ] }, { @@ -158,7 +161,7 @@ }, "result": false, "err": [ - "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|(?!.*\\.ngrok\\.io)^(https?):\\/\\/(?!localhost|127\\.0\\.0\\.1|10\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|192\\.168\\.\\d{1,3}\\.\\d{1,3}|172\\.(1[6-9]|2[0-9]|3[0-1])\\.\\d{1,3}\\.\\d{1,3}|0\\.0\\.0\\.0|\\[::1\\]|\\[fc[0-9a-fA-F]{2}:.*\\]|\\[fd[0-9a-fA-F]{2}:.*\\]|\\[::ffff:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\]).*([^\\s/$.?#].[^\\s]*)$\"" + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" ] }, { @@ -182,7 +185,7 @@ }, "result": false, "err": [ - "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|(?!.*\\.ngrok\\.io)^(https?):\\/\\/(?!localhost|127\\.0\\.0\\.1|10\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|192\\.168\\.\\d{1,3}\\.\\d{1,3}|172\\.(1[6-9]|2[0-9]|3[0-1])\\.\\d{1,3}\\.\\d{1,3}|0\\.0\\.0\\.0|\\[::1\\]|\\[fc[0-9a-fA-F]{2}:.*\\]|\\[fd[0-9a-fA-F]{2}:.*\\]|\\[::ffff:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\]).*([^\\s/$.?#].[^\\s]*)$\"" + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" ] }, { @@ -239,7 +242,7 @@ }, "result": false, "err": [ - "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|(?!.*\\.ngrok\\.io)^(https?):\\/\\/(?!localhost|127\\.0\\.0\\.1|10\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|192\\.168\\.\\d{1,3}\\.\\d{1,3}|172\\.(1[6-9]|2[0-9]|3[0-1])\\.\\d{1,3}\\.\\d{1,3}|0\\.0\\.0\\.0|\\[::1\\]|\\[fc[0-9a-fA-F]{2}:.*\\]|\\[fd[0-9a-fA-F]{2}:.*\\]|\\[::ffff:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\]).*([^\\s/$.?#].[^\\s]*)$\"" + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" ] }, { @@ -657,5 +660,316 @@ "ketchConsentPurposes.web must be array", "ketchConsentPurposes.unity.0 must be object" ] + }, + { + "testTitle": "localhost with port", + "config": { + "webhookUrl": "http://127.1.2.3:8080", + "webhookMethod": "GET" + }, + "result": false, + "err": [ + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" + ] + }, + { + "testTitle": "ipv4 address with port", + "config": { + "webhookUrl": "http://192.168.1.100:8080", + "webhookMethod": "GET" + }, + "result": false, + "err": [ + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" + ] + }, + { + "testTitle": "SSRF - Internal IP address", + "config": { + "webhookUrl": "http://0.0.0.0", + "webhookMethod": "GET" + }, + "result": false, + "err": [ + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" + ] + }, + { + "testTitle": "SSRF - Private IP address", + "config": { + "webhookUrl": "http://192.168.0.1", + "webhookMethod": "GET" + }, + "result": false, + "err": [ + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" + ] + }, + { + "testTitle": "SSRF - IPv6 loopback", + "config": { + "webhookUrl": "http://[::1]", + "webhookMethod": "GET" + }, + "result": false, + "err": [ + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" + ] + }, + { + "testTitle": "SSRF - Domain with DNS rebinding", + "config": { + "webhookUrl": "http://spoofed.burpcollaborator.net", + "webhookMethod": "GET" + }, + "result": true + }, + { + "testTitle": "SSRF - URL encoding bypass attempt", + "config": { + "webhookUrl": "http://127.0.0.1%2f", + "webhookMethod": "GET" + }, + "result": false, + "err": [ + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" + ] + }, + { + "testTitle": "SSRF - Decimal IP representation", + "config": { + "webhookUrl": "http://2130706433", + "webhookMethod": "GET" + }, + "result": false, + "err": [ + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" + ] + }, + { + "testTitle": "SSRF - Octal IP representation", + "config": { + "webhookUrl": "http://0177.0000.0000.0001", + "webhookMethod": "GET" + }, + "result": false, + "err": [ + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" + ] + }, + + { + "testTitle": "SSRF - IPv6 mapped IPv4 address", + "config": { + "webhookUrl": "http://[::ffff:192.168.0.1]", + "webhookMethod": "GET" + }, + "result": false, + "err": [ + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" + ] + }, + { + "testTitle": "SSRF - Hexadecimal IP representation", + "config": { + "webhookUrl": "http://0xC0A80001", + "webhookMethod": "GET" + }, + "result": false, + "err": [ + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" + ] + }, + { + "testTitle": "SSRF - Mixed encoding", + "config": { + "webhookUrl": "http://127.0.0.1%0d%0aHost:example.com", + "webhookMethod": "GET" + }, + "result": false, + "err": [ + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" + ] + }, + { + "testTitle": "SSRF - Double encoding", + "config": { + "webhookUrl": "http://127.0.0.1%252f", + "webhookMethod": "GET" + }, + "result": false, + "err": [ + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" + ] + }, + { + "testTitle": "SSRF - IPv6 compressed", + "config": { + "webhookUrl": "http://[::127.0.0.1]", + "webhookMethod": "GET" + }, + "result": false, + "err": [ + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" + ] + }, + { + "testTitle": "SSRF - Enclosed alphanumerics", + "config": { + "webhookUrl": "http://⑫⑦.⓪.⓪.①", + "webhookMethod": "GET" + }, + "result": false, + "err": [ + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" + ] + }, + { + "testTitle": "SSRF - Punycode domain", + "config": { + "webhookUrl": "http://xn--80ak6aa92e.com", + "webhookMethod": "GET" + }, + "result": true + }, + { + "testTitle": "SSRF - URL with credentials", + "config": { + "webhookUrl": "http://user:password@example.com", + "webhookMethod": "GET" + }, + "result": false, + "err": [ + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" + ] + }, + { + "testTitle": "SSRF - Data URL scheme", + "config": { + "webhookUrl": "data:text/plain;base64,SGVsbG8sIFdvcmxkIQ==", + "webhookMethod": "GET" + }, + "result": false, + "err": [ + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" + ] + }, + { + "testTitle": "SSRF - Localhost with subdomain", + "config": { + "webhookUrl": "http://subdomain.localhost", + "webhookMethod": "GET" + }, + "result": false, + "err": [ + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" + ] + }, + { + "testTitle": "SSRF - localhost with dash", + "config": { + "webhookUrl": "http://local-host", + "webhookMethod": "GET" + }, + "result": false, + "err": [ + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" + ] + }, + { + "testTitle": "SSRF - localhost with numbers", + "config": { + "webhookUrl": "http://127.0.0.1.nip.io", + "webhookMethod": "GET" + }, + "result": true + }, + { + "testTitle": "SSRF - Dotless decimal IP", + "config": { + "webhookUrl": "http://2130706433", + "webhookMethod": "GET" + }, + "result": false, + "err": [ + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" + ] + }, + { + "testTitle": "SSRF - Dotless hex IP", + "config": { + "webhookUrl": "http://0x7f000001", + "webhookMethod": "GET" + }, + "result": false, + "err": [ + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" + ] + }, + { + "testTitle": "SSRF - IPv6 localhost", + "config": { + "webhookUrl": "http://[::1]", + "webhookMethod": "GET" + }, + "result": false, + "err": [ + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" + ] + }, + { + "testTitle": "SSRF - IPv6 localhost with zone identifier", + "config": { + "webhookUrl": "http://[::1%25en0]", + "webhookMethod": "GET" + }, + "result": false, + "err": [ + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" + ] + }, + { + "testTitle": "SSRF - Malformed IPv6", + "config": { + "webhookUrl": "http://0:0:0:0:0:ffff:127.0.0.1", + "webhookMethod": "GET" + }, + "result": false, + "err": [ + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" + ] + }, + { + "testTitle": "SSRF - IPv6 with IPv4 address", + "config": { + "webhookUrl": "http://[0:0:0:0:0:ffff:127.0.0.1]", + "webhookMethod": "GET" + }, + "result": false, + "err": [ + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" + ] + }, + { + "testTitle": "SSRF - Exotic protocols", + "config": { + "webhookUrl": "gopher://example.com/_TCP:80", + "webhookMethod": "GET" + }, + "result": false, + "err": [ + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" + ] + }, + { + "testTitle": "SSRF - URL fragment", + "config": { + "webhookUrl": "http://example.com#@evil.com/", + "webhookMethod": "GET" + }, + "result": false, + "err": [ + "webhookUrl must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(https?:\\/\\/)(?![a-zA-Z0-9-]*\\.ngrok\\.io)(?!localhost|.*\\.localhost)([a-zA-Z0-9-]{1,63}\\.)+[a-zA-Z]{2,}(\\/.*)?$\"" + ] } ] From 9ea487976ccf21785b7faf4b27aa65ad7156eb09 Mon Sep 17 00:00:00 2001 From: ItsSudip Date: Thu, 10 Oct 2024 12:10:04 +0530 Subject: [PATCH 9/9] chore: update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b91072c6..e4e151c32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,11 +9,13 @@ All notable changes to this project will be documented in this file. See [standa * add Iubenda support to ga4 destination ([#1691](https://github.com/rudderlabs/rudder-config-schema/issues/1691)) ([2ef7ae4](https://github.com/rudderlabs/rudder-config-schema/commit/2ef7ae497b3bad172024d1eeb54beb223ddf296a)) * added test cases ([#1659](https://github.com/rudderlabs/rudder-config-schema/issues/1659)) ([6339410](https://github.com/rudderlabs/rudder-config-schema/commit/6339410ecec4f6739df44383b866b82662642ae6)) +* onboard Amazon Audience ([#1667](https://github.com/rudderlabs/rudder-config-schema/issues/1667)) ([d841adf](https://github.com/rudderlabs/rudder-config-schema/commit/d841adfc5103978a6a83412a51a00f87a9b7f28f)) ### Bug Fixes * add new field for list of props ([#1734](https://github.com/rudderlabs/rudder-config-schema/issues/1734)) ([d45386b](https://github.com/rudderlabs/rudder-config-schema/commit/d45386b4081d0d910b078c073147257842b78772)) +* webhook regex url ([#1743](https://github.com/rudderlabs/rudder-config-schema/issues/174)) ([3435280](https://github.com/rudderlabs/rudder-config-schema/commit/3435280b68b6dbf30bdeddc751143994ad07f3f4)) ### [1.94.2](https://github.com/rudderlabs/rudder-config-schema/compare/v1.94.1...v1.94.2) (2024-10-04)