You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by Chetan Mehrotra <ch...@gmail.com> on 2014/01/23 11:45:00 UTC

Re: svn commit: r1560611 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/ oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/ oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ oak-jcr/src/t...

On Thu, Jan 23, 2014 at 2:35 PM,  <th...@apache.org> wrote:
> +        mongo = new MongoClient(mongoURI);
> +        db = mongo.getDB(mongoURI.getDatabase());

The database referred in the URI is used by Mongo for determining the
user database against which credentials if passed needs to be
validated.

------------------
/database
Optional. The name of the database to authenticate if the connection
string includes authentication credentials in the form of
username:password@. If /database is not specified and the connection
string includes credentials, the driver will authenticate to the admin
database.
------------------

So far we do not make use of credentials so database field can be
used. But better to manage it in a separate way.

Chetan Mehrotra
[1] http://docs.mongodb.org/manual/reference/connection-string/

Re: svn commit: r1560611 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/ oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/ oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ oak-jcr/src/t...

Posted by Chetan Mehrotra <ch...@gmail.com>.
On Fri, Apr 25, 2014 at 11:04 PM, Jukka Zitting <ju...@gmail.com> wrote:
> The credentials in any case need to be valid for the database that
> holds the repository, so I don't see why we couldn't use it for this
> purpose.

As per the doc the database name tells mongo driver the name of DB in
which user details are stored. Typically in SQL database the admin
user tables are managed in a dedicated schema. Probably similar scheme
is followed in Mongo side also.

Probably we can modify the logic to use the db name present as part of
url if no db name is explicitly provided via 'oak.mongo.db'


Chetan Mehrotra

Re: svn commit: r1560611 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/ oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/ oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ oak-jcr/src/t...

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Thu, Jan 23, 2014 at 5:45 AM, Chetan Mehrotra
<ch...@gmail.com> wrote:
> On Thu, Jan 23, 2014 at 2:35 PM,  <th...@apache.org> wrote:
>> +        mongo = new MongoClient(mongoURI);
>> +        db = mongo.getDB(mongoURI.getDatabase());
>
> The database referred in the URI is used by Mongo for determining the
> user database against which credentials if passed needs to be
> validated.

The credentials in any case need to be valid for the database that
holds the repository, so I don't see why we couldn't use it for this
purpose.

BR,

Jukka Zitting