Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add uri encoding for mongodb connector password🐛 #31371

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -39,8 +41,8 @@ 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 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()));
}

Expand Down
3 changes: 2 additions & 1 deletion docs/integrations/sources/mongodb-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ For more information regarding configuration parameters, please see [MongoDb Doc
## Changelog

| Version | Date | Pull Request | Subject |
|:--------|:-----------|:---------------------------------------------------------|:----------------------------------------------------------------------------------------------------------|
|:--------|:-----------|:---------------------------------------------------------| :-------------------------------------------------------------------------------------------------------- |
| 1.0.4 | 2023-10-20 | [31371](https://github.com/airbytehq/airbyte/pull/31371) | Add uri encoding to username and password fields |
| 1.0.3 | 2023-10-19 | [31629](https://github.com/airbytehq/airbyte/pull/31629) | Allow discover operation use of disk file when an operation goes over max allowed mem |
| 1.0.2 | 2023-10-19 | [31596](https://github.com/airbytehq/airbyte/pull/31596) | Allow use of temp disk file when an operation goes over max allowed mem |
| 1.0.1 | 2023-10-03 | [31034](https://github.com/airbytehq/airbyte/pull/31034) | Fix field filtering logic related to nested documents |
Expand Down
Loading