-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
GridFS ensures two indexes before doing some operations. It tries to avoid calling createIndex on a secondary, but doesn't recover if it gets a "not authorized" error.
This needs a drivers-wide spec, eventually part of the GridFS Spec. It may be reasonable to catch OperationFailure and ignore it for "not authorized" or the appropriate error codes.
class TestGridfsAuth(IntegrationTest): @client_context.require_auth def test_gridfs_readonly(self): # "self.client" is logged in as root. Make a read-only user. auth_db = self.client.test_gridfs_readonly auth_db.add_user('readonly', 'pw', roles=['read']) self.addCleanup(remove_all_users, auth_db) db = rs_or_single_client_noauth().test_gridfs_readonly db.authenticate('readonly', 'pw') gridfs.GridFS(db).list()
- related to
-
PYTHON-960 GridFS spec compliance
- Closed