Skip to content

Commit

Permalink
Support authSource in liquibase-mongodb
Browse files Browse the repository at this point in the history
  • Loading branch information
loicmathieu committed Jul 8, 2022
1 parent 4805844 commit 983f047
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -39,12 +39,15 @@ public Liquibase createLiquibase() {
"Config property 'quarkus.mongodb.database' must be defined when no database " +
"exist in the connection string"));
}
if (mongoClientConfig.credentials.authSource.isPresent()) {
connectionString += "?authSource=" + mongoClientConfig.credentials.authSource.get();
}

Database database = DatabaseFactory.getInstance().openDatabase(connectionString,
this.mongoClientConfig.credentials.username.orElse(null),
this.mongoClientConfig.credentials.password.orElse(null),
null, resourceAccessor);

;
if (database != null) {
liquibaseMongodbConfig.liquibaseCatalogName.ifPresent(database::setLiquibaseCatalogName);
liquibaseMongodbConfig.liquibaseSchemaName.ifPresent(database::setLiquibaseSchemaName);
Expand Down

0 comments on commit 983f047

Please sign in to comment.