From 22b40378b9eae7cd0bd2a17032af0b867eb543ee Mon Sep 17 00:00:00 2001 From: Adam G <37425558+aglucky@users.noreply.github.com> Date: Sat, 14 Oct 2023 04:03:45 +0000 Subject: [PATCH 1/3] add uri encoding for mongodb connector password --- .../connectors/source-mongodb-v2/metadata.yaml | 3 +++ .../integrations/source/mongodb/MongoConnectionUtils.java | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/airbyte-integrations/connectors/source-mongodb-v2/metadata.yaml b/airbyte-integrations/connectors/source-mongodb-v2/metadata.yaml index ce4ed529f235..2d65f2282eef 100644 --- a/airbyte-integrations/connectors/source-mongodb-v2/metadata.yaml +++ b/airbyte-integrations/connectors/source-mongodb-v2/metadata.yaml @@ -22,6 +22,9 @@ data: tags: - language:java releases: + 1.0.1: + message: > + Patched bug where passwords with special characters were not being handled correctly. breakingChanges: 1.0.0: message: > diff --git a/airbyte-integrations/connectors/source-mongodb-v2/src/main/java/io/airbyte/integrations/source/mongodb/MongoConnectionUtils.java b/airbyte-integrations/connectors/source-mongodb-v2/src/main/java/io/airbyte/integrations/source/mongodb/MongoConnectionUtils.java index 8fbcc445c1a0..d1d0950d9ca2 100644 --- a/airbyte-integrations/connectors/source-mongodb-v2/src/main/java/io/airbyte/integrations/source/mongodb/MongoConnectionUtils.java +++ b/airbyte-integrations/connectors/source-mongodb-v2/src/main/java/io/airbyte/integrations/source/mongodb/MongoConnectionUtils.java @@ -4,6 +4,8 @@ package io.airbyte.integrations.source.mongodb; +import java.net.URLEncoder; + import static io.airbyte.integrations.source.mongodb.MongoConstants.DRIVER_NAME; import com.mongodb.ConnectionString; @@ -40,7 +42,7 @@ public static MongoClient createMongoClient(final MongoDbSourceConfig config) { if (config.hasAuthCredentials()) { final String authSource = config.getAuthSource(); final String user = config.getUsername(); - final String password = config.getPassword(); + final String password = URLEncoder.encode(config.getPassword(), StandardCharsets.UTF_8); mongoClientSettingsBuilder.credential(MongoCredential.createCredential(user, authSource, password.toCharArray())); } From 37bbf27e56c6855fe5512e32bec3f5931632a3f9 Mon Sep 17 00:00:00 2001 From: Adam G <37425558+aglucky@users.noreply.github.com> Date: Fri, 20 Oct 2023 20:41:34 +0000 Subject: [PATCH 2/3] update mongov2 changelog + add uri encode username --- .../connectors/source-mongodb-v2/metadata.yaml | 3 --- .../integrations/source/mongodb/MongoConnectionUtils.java | 2 +- docs/integrations/sources/mongodb-v2.md | 1 + 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/airbyte-integrations/connectors/source-mongodb-v2/metadata.yaml b/airbyte-integrations/connectors/source-mongodb-v2/metadata.yaml index 2d65f2282eef..ce4ed529f235 100644 --- a/airbyte-integrations/connectors/source-mongodb-v2/metadata.yaml +++ b/airbyte-integrations/connectors/source-mongodb-v2/metadata.yaml @@ -22,9 +22,6 @@ data: tags: - language:java releases: - 1.0.1: - message: > - Patched bug where passwords with special characters were not being handled correctly. breakingChanges: 1.0.0: message: > diff --git a/airbyte-integrations/connectors/source-mongodb-v2/src/main/java/io/airbyte/integrations/source/mongodb/MongoConnectionUtils.java b/airbyte-integrations/connectors/source-mongodb-v2/src/main/java/io/airbyte/integrations/source/mongodb/MongoConnectionUtils.java index d1d0950d9ca2..492e719d34a8 100644 --- a/airbyte-integrations/connectors/source-mongodb-v2/src/main/java/io/airbyte/integrations/source/mongodb/MongoConnectionUtils.java +++ b/airbyte-integrations/connectors/source-mongodb-v2/src/main/java/io/airbyte/integrations/source/mongodb/MongoConnectionUtils.java @@ -41,7 +41,7 @@ public static MongoClient createMongoClient(final MongoDbSourceConfig config) { if (config.hasAuthCredentials()) { final String authSource = config.getAuthSource(); - final String user = config.getUsername(); + final String user = URLEncoder.encode(config.getUsername(), StandardCharsets.UTF_8); final String password = URLEncoder.encode(config.getPassword(), StandardCharsets.UTF_8); mongoClientSettingsBuilder.credential(MongoCredential.createCredential(user, authSource, password.toCharArray())); } diff --git a/docs/integrations/sources/mongodb-v2.md b/docs/integrations/sources/mongodb-v2.md index 0f0f3b40a2b3..2e9e433867d5 100644 --- a/docs/integrations/sources/mongodb-v2.md +++ b/docs/integrations/sources/mongodb-v2.md @@ -190,6 +190,7 @@ For more information regarding configuration parameters, please see [MongoDb Doc | Version | Date | Pull Request | Subject | |:--------|:-----------|:---------------------------------------------------------| :-------------------------------------------------------------------------------------------------------- | +| 1.0.2| 2023-10-20 | [31371](https://github.com/airbytehq/airbyte/pull/31371) | Add uri encoding to username and password fields | 1.0.1 | 2023-10-03 | [31034](https://github.com/airbytehq/airbyte/pull/31034) | Fix field filtering logic related to nested documents | 1.0.0 | 2023-10-03 | [29969](https://github.com/airbytehq/airbyte/pull/29969) | General availability release using Change Data Capture (CDC) | | 0.2.5 | 2023-07-27 | [28815](https://github.com/airbytehq/airbyte/pull/28815) | Revert back to version 0.2.0 | From a041bd2987de8bf284e4527d09173c6293ab8af5 Mon Sep 17 00:00:00 2001 From: Adam G <37425558+aglucky@users.noreply.github.com> Date: Tue, 24 Oct 2023 15:55:29 +0000 Subject: [PATCH 3/3] update mongodb-v2 dockerImageTag to 1.0.4 --- airbyte-integrations/connectors/source-mongodb-v2/metadata.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airbyte-integrations/connectors/source-mongodb-v2/metadata.yaml b/airbyte-integrations/connectors/source-mongodb-v2/metadata.yaml index 6bc0987ac936..7be8499c989a 100644 --- a/airbyte-integrations/connectors/source-mongodb-v2/metadata.yaml +++ b/airbyte-integrations/connectors/source-mongodb-v2/metadata.yaml @@ -5,7 +5,7 @@ data: connectorSubtype: database connectorType: source definitionId: b2e713cd-cc36-4c0a-b5bd-b47cb8a0561e - dockerImageTag: 1.0.3 + dockerImageTag: 1.0.4 dockerRepository: airbyte/source-mongodb-v2 documentationUrl: https://docs.airbyte.com/integrations/sources/mongodb-v2 githubIssueLabel: source-mongodb-v2