Skip to content

Commit

Permalink
feat(NODE-4795): deprecate addUser helper (#3624)
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed Apr 6, 2023
1 parent 8d76a71 commit 53a0aae
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/admin.ts
Expand Up @@ -106,6 +106,8 @@ export class Admin {
* @param username - The username for the new user
* @param passwordOrOptions - An optional password for the new user, or the options for the command
* @param options - Optional settings for the command
* @deprecated Use the createUser command in `db.command()` instead.
* @see https://www.mongodb.com/docs/manual/reference/command/createUser/
*/
async addUser(
username: string,
Expand Down
2 changes: 2 additions & 0 deletions src/db.ts
Expand Up @@ -405,6 +405,8 @@ export class Db {
* @param username - The username for the new user
* @param passwordOrOptions - An optional password for the new user, or the options for the command
* @param options - Optional settings for the command
* @deprecated Use the createUser command in `db.command()` instead.
* @see https://www.mongodb.com/docs/manual/reference/command/createUser/
*/
async addUser(
username: string,
Expand Down
10 changes: 8 additions & 2 deletions src/operations/add_user.ts
Expand Up @@ -9,7 +9,10 @@ import { Callback, emitWarningOnce, getTopology } from '../utils';
import { CommandOperation, CommandOperationOptions } from './command';
import { Aspect, defineAspects } from './operation';

/** @public */
/**
* @public
* @deprecated Use the createUser command directly instead.
*/
export interface RoleSpecification {
/**
* A role grants privileges to perform sets of actions on defined resources.
Expand All @@ -20,7 +23,10 @@ export interface RoleSpecification {
db: string;
}

/** @public */
/**
* @public
* @deprecated Use the createUser command directly instead.
*/
export interface AddUserOptions extends CommandOperationOptions {
/** Roles associated with the created user */
roles?: string | string[] | RoleSpecification | RoleSpecification[];
Expand Down

0 comments on commit 53a0aae

Please sign in to comment.