pharo-nosql / mongotalk

A Pharo driver for MongoDB
MIT License
19 stars 13 forks source link

Mongo>>authenticateUsername:password:database: is failing #41

Closed sebastianconcept closed 3 years ago

sebastianconcept commented 5 years ago
#nextPut: was sent to nil
UndefinedObject(Object)>>doesNotUnderstand: #nextPut:
LittleEndianStream>>nextBytePut:
LittleEndianStream>>nextInt32Put:
QueryOperation(MongoOperation)>>writeHeader
QueryOperation(MongoOperation)>>write
Mongo>>cursorQuery:
MongoCursor>>execute
Mongo>>queryOne:
Mongo>>command:database:
Mongo>>authenticateUsername:password:database:

Also, the last parameter in the tests

testAuthenticationSucceeds
    self assert: (mongo authenticateUsername: 'foo' password: 'bar' database: 'baz')

is used with the mock as, a user would expect, with the database name, but the method expects aDatabase object.

A quick fix for that would be to take the database name and, inside the method, use a local database temp like:

Mongo>>authenticateUsername: user password: pass database: databaseName
|database|
database := (MongoDatabase root: self name: databaseName)
...
noha commented 5 years ago

There is no PR for this issue for a long time. Can we close this?

tinchodias commented 3 years ago

I think it was a good suggestion to have method that receives the db name instead of the object, at least as a convenience method.

But as too long time passed, and I just created #87 about authentication, I'm closing this issue.