You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
KAFKA-404: Support for extending MongoClient to allow for users to add custom auth such as AWS IAM / Assume Role (#161)
* Custom Auth Provider Plug point changes
* added display names to tests
* static analysis fixes.
* driver version changed back to what it was.
* Changelog updated.
* documentation changes, version change.
* readme modified.
---------
Co-authored-by: nilaysundarkar <[email protected]>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+11
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,17 @@
2
2
3
3
## Changelog
4
4
5
+
## 1.13.0
6
+
7
+
### Improvements
8
+
-[KAFKA-404](https://jira.mongodb.org/browse/KAFKA-404) Support for extending MongoClient to allow for users to add custom auth such as AWS IAM / Assume Role.
9
+
10
+
## 1.12.0
11
+
12
+
### Improvements
13
+
-[KAFKA-374](https://jira.mongodb.org/browse/KAFKA-374) Implement an error handler to address specific scenarios.
Copy file name to clipboardExpand all lines: README.md
+137
Original file line number
Diff line number
Diff line change
@@ -76,3 +76,140 @@ A couple of manual configuration steps are required to run the code in IntelliJ:
76
76
- Run the `compileBuildConfig` task: eg: `./gradlew compileBuildConfig` or via Gradle > mongo-kafka > Tasks > other > compileBuildConfig
77
77
- Set `compileBuildConfig` to execute Before Build. via Gradle > Tasks > other > right click compileBuildConfig - click on "Execute Before Build"
78
78
- Delegate all build actions to Gradle: Settings > Build, Execution, Deployment > Build Tools > Gradle > Runner - tick "Delegate IDE build/run actions to gradle"
79
+
80
+
## Custom Auth Provider Interface
81
+
82
+
The `com.mongodb.kafka.connect.util.custom.credentials.CustomCredentialProvider` interface can be implemented to provide an object of type `com.mongodb.MongoCredential` which gets wrapped in the MongoClient that is constructed for the sink and source connector.
83
+
The following properties need to be set -
84
+
85
+
```
86
+
mongo.custom.auth.mechanism.enable - set to true.
87
+
mongo.custom.auth.mechanism.providerClass - qualified class name of the implementation class
88
+
```
89
+
Additional properties and can be set as required within the implementation class.
90
+
The init and validate methods of the implementation class get called when the connector initializes.
91
+
92
+
### Example
93
+
When using MONGODB-AWS authentication mechanism for atlas, one can specify the following configuration -
Here the `sample.AwsAssumeRoleCredentialProvider` must be available on the classpath. `mongodbaws.auth.mechanism.roleArn` is an example of custom properties that can be read by `sample.AwsAssumeRoleCredentialProvider`.
102
+
103
+
### Sample code for implementing Custom role provider
0 commit comments