Files
mongodb-memory-server/docs/api/interfaces/mongo-memory-server-automaticauth.md
hasezoey 582c5ce7d7 feat: change authentication to only happen when "enable" is "true"
BREAKING CHANGE:
Authentication now is only created when "{ enable: true }" is given
also "disable" has been removed
2023-06-09 18:25:35 +02:00

54 lines
1.3 KiB
Markdown

---
id: mongo-memory-server-automaticauth
title: 'AutomaticAuth'
---
API Documentation of `AutomaticAuth`-Interface
## Values
### enable
Typings: `enable?: boolean`
Default: `false`
Enable or disable Authentication creation.
### extraUsers
Typings: `extraUsers?: CreateUser[]`
Default: `[]`
Add extra users after the root user has been created, uses [`CreateUser`](./mongo-memory-server-createuser.md).
### customRootName
Typings: `customRootName?: string`
Default: `mongodb-memory-server-root`
Set a Custom Root User Name.
### customRootPwd
Typings: `customRootPwd?: string`
Default: `rootuser`
Set a Custom Root User Password.
### force
Typings: `force?: boolean`
Default: `false`
Force to run `createAuth`, by default `createAuth` is only run when the instance is new.
### keyfileContent
Typings: `keyfileContent?: string`
Default: `0123456789`
Set custom content for the keyfile.
This field only has a effect in a [`MongoMemoryReplSet`](../classes/mongo-memory-replset.md).
A Keyfile is required in ReplSet's since ~5.0 for other replset instances to connect to eachother without having to use a password, and keyfiles only work for authenticating other instances, not clients, for more see [MongoDB Keyfile Documentation](https://www.mongodb.com/docs/manual/tutorial/enforce-keyfile-access-control-in-existing-replica-set/).