File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
packages/mongodb-memory-server-core/src Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -656,7 +656,7 @@ export class MongoMemoryServer extends EventEmitter {
656656
657657 /**
658658 * Create Users and restart instance to enable auth
659- * This Function assumes "this.opts.auth" is defined / enabled
659+ * This Function assumes "this.opts.auth" is already processed into "this.auth"
660660 * @param data Used to get "ip" and "port"
661661 * @internal
662662 */
@@ -680,7 +680,7 @@ export class MongoMemoryServer extends EventEmitter {
680680 pwd : 'rootuser' ,
681681 mechanisms : [ 'SCRAM-SHA-256' ] ,
682682 customData : {
683- createBy : 'mongodb-memory-server' ,
683+ createdBy : 'mongodb-memory-server' ,
684684 as : 'ROOTUSER' ,
685685 } ,
686686 roles : [ 'root' ] ,
@@ -708,7 +708,11 @@ export class MongoMemoryServer extends EventEmitter {
708708 await db . command ( {
709709 createUser : user . createUser ,
710710 pwd : user . pwd ,
711- customData : user . customData ?? { } ,
711+ customData : {
712+ ...user . customData ,
713+ createdBy : 'mongodb-memory-server' ,
714+ as : 'EXTRAUSER' ,
715+ } ,
712716 roles : user . roles ,
713717 authenticationRestrictions : user . authenticationRestrictions ?? [ ] ,
714718 mechanisms : user . mechanisms ?? [ 'SCRAM-SHA-256' ] ,
You can’t perform that action at this time.
0 commit comments