Skip to content

Commit

Permalink
fix: update schem.json and add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhar-rudder committed Feb 27, 2025
1 parent a7353d7 commit 362c6e8
Show file tree
Hide file tree
Showing 2 changed files with 137 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/configurations/destinations/deltalake/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
"type": "string",
"pattern": "(^env[.].+)|^(.{1,100})$"
},
"token": {
"type": "string",
"pattern": "(^env[.].+)|^(.{1,100})$"
},
"catalog": {
"type": "string",
"pattern": "(^env[.].*)|^(.*)$"
Expand Down Expand Up @@ -910,12 +914,14 @@
"allOf": [
{
"if": {
"properties": {
"useOauth": {
"const": false
}
},
"required": ["useOauth"]
"not": {
"properties": {
"useOauth": {
"const": true
}
},
"required": ["useOauth"]
}
},
"then": {
"properties": {
Expand Down
125 changes: 125 additions & 0 deletions test/data/validation/destinations/deltalake.json
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,131 @@
},
"result": true
},
{
"testTitle": "With invalid token type",
"config": {
"host": "test-host",
"path": "test-path",
"token": true,
"port": "0000",
"bucketProvider": "S3",
"syncFrequency": "30",
"enableSSE": false,
"useRudderStorage": false,
"useSTSTokens": false,
"bucketName": "test-bucket",
"accessKeyID": "test-access-key-id",
"accessKey": "test-access-key"
},
"result": false,
"err": ["token must be string", " must match \"then\" schema", "token must be string"]
},
{
"testTitle": "With empty token",
"config": {
"host": "test-host",
"path": "test-path",
"port": "0000",
"token": "",
"bucketProvider": "S3",
"syncFrequency": "30",
"enableSSE": false,
"useRudderStorage": false,
"useSTSTokens": false,
"bucketName": "test-bucket",
"accessKeyID": "test-access-key-id",
"accessKey": "test-access-key"
},
"result": false,
"err": [
"token must match pattern \"(^env[.].+)|^(.{1,100})$\"",
" must match \"then\" schema",
"token must match pattern \"(^env[.].+)|^(.{1,100})$\""
]
},
{
"testTitle": "With valid token for PAT authentication",
"config": {
"host": "test-host",
"path": "test-path",
"port": "0000",
"token": "test-token",
"useOauth": false,
"bucketProvider": "S3",
"syncFrequency": "30",
"enableSSE": false,
"useRudderStorage": false,
"useSTSTokens": false,
"bucketName": "test-bucket",
"accessKeyID": "test-access-key-id",
"accessKey": "test-access-key"
},
"result": true
},
{
"testTitle": "With empty clientId for Oauth authentication",
"config": {
"host": "test-host",
"path": "test-path",
"port": "0000",
"token": "test-token",
"useOauth": true,
"oauthClientId": "",
"oauthClientSecret": "test-oauth-client-secret",
"bucketProvider": "S3",
"syncFrequency": "30",
"enableSSE": false,
"useRudderStorage": false,
"useSTSTokens": false,
"bucketName": "test-bucket",
"accessKeyID": "test-access-key-id",
"accessKey": "test-access-key"
},
"result": false,
"err": ["oauthClientId must match pattern \"^(.{1,100})$\"", " must match \"then\" schema"]
},
{
"testTitle": "With missing clientSecret for Oauth authentication",
"config": {
"host": "test-host",
"path": "test-path",
"port": "0000",
"token": "test-token",
"useOauth": true,
"oauthClientId": "test-oauth-client-id",
"bucketProvider": "S3",
"syncFrequency": "30",
"enableSSE": false,
"useRudderStorage": false,
"useSTSTokens": false,
"bucketName": "test-bucket",
"accessKeyID": "test-access-key-id",
"accessKey": "test-access-key"
},
"result": false,
"err": [" must have required property 'oauthClientSecret'", " must match \"then\" schema"]
},
{
"testTitle": "With valid config for Oauth authentication",
"config": {
"host": "test-host",
"path": "test-path",
"port": "0000",
"token": "test-token",
"useOauth": true,
"oauthClientId": "test-oauth-client-id",
"oauthClientSecret": "test-oauth-client-secret",
"bucketProvider": "S3",
"syncFrequency": "30",
"enableSSE": false,
"useRudderStorage": false,
"useSTSTokens": false,
"bucketName": "test-bucket",
"accessKeyID": "test-access-key-id",
"accessKey": "test-access-key"
},
"result": true
},
{
"testTitle": "With valid multiple consent management providers config",
"config": {
Expand Down

0 comments on commit 362c6e8

Please sign in to comment.