You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/02/11 14:20:26 UTC
[GitHub] [camel] djcoleman opened a new pull request #6936: CAMEL-17564: Added authSource param to MongoDB connection endpoint
djcoleman opened a new pull request #6936:
URL: https://github.com/apache/camel/pull/6936
The authSource parameter allows you to connect to a MongoDB database as a user whose credentials are stored in a database other than the default "admin". So if you have a user called test-user in registered in the test database, you can use the following endpoint:
"mongodb:mongo?hosts=localhost:27017&username=test-user&password=testpwd&authSource=test&..."
- [X] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes. See CAMEL-17564
- [X] Each commit in the pull request should have a meaningful subject line and body.
- [X] If you're unsure, you can format the pull request title like `[CAMEL-XXX] Fixes bug in camel-file component`, where you replace `CAMEL-XXX` with the appropriate JIRA issue.
- [X] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [X] Run `mvn clean install -Psourcecheck` in your module with source check enabled to make sure basic checks pass and there are no checkstyle violations. A more thorough check will be performed on your pull request automatically.
Below are the contribution guidelines:
https://github.com/apache/camel/blob/main/CONTRIBUTING.md
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] orpiske merged pull request #6936: CAMEL-17564: Added authSource param to MongoDB connection endpoint
Posted by GitBox <gi...@apache.org>.
orpiske merged pull request #6936:
URL: https://github.com/apache/camel/pull/6936
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] orpiske commented on pull request #6936: CAMEL-17564: Added authSource param to MongoDB connection endpoint
Posted by GitBox <gi...@apache.org>.
orpiske commented on pull request #6936:
URL: https://github.com/apache/camel/pull/6936#issuecomment-1038961115
I've talked to @djcoleman, I'll add the instance of later on. Merging.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] orpiske commented on a change in pull request #6936: CAMEL-17564: Added authSource param to MongoDB connection endpoint
Posted by GitBox <gi...@apache.org>.
orpiske commented on a change in pull request #6936:
URL: https://github.com/apache/camel/pull/6936#discussion_r804716091
##########
File path: components/camel-mongodb/src/test/java/org/apache/camel/component/mongodb/integration/MongoDbCredentialsFromUriConnectionIT.java
##########
@@ -41,6 +50,22 @@ protected CamelContext createCamelContext() throws Exception {
return ctx;
}
+ @Test
+ public void testCountOperationAuthUser() {
+ // Test that the collection has 0 documents in it
+ assertEquals(0, testCollection.countDocuments());
+ Object result = template.requestBody("direct:testAuthSource", "irrelevantBody");
+ assertTrue(result instanceof Long, "Result is not of type Long");
Review comment:
I think you can use `assertInstanceOf` for greater readability.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org