1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
|
# Copyright (C) 2020-present MongoDB, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the Server Side Public License, version 1,
# as published by MongoDB, Inc.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# Server Side Public License for more details.
#
# You should have received a copy of the Server Side Public License
# along with this program. If not, see
# <http://www.mongodb.com/licensing/server-side-public-license>.
#
# As a special exception, the copyright holders give permission to link the
# code of portions of this program with the OpenSSL library under certain
# conditions as described in each individual source file and distribute
# linked combinations including the program with the OpenSSL library. You
# must comply with the Server Side Public License in all respects for
# all of the code used other than as permitted herein. If you modify file(s)
# with this exception, you may extend this exception to your version of the
# file(s), but you are not obligated to do so. If you do not wish to do so,
# delete this exception statement from your version. If you delete this
# exception statement from all source files in the program, then also delete
# it in the license file.
#
global:
cpp_namespace: "mongo"
imports:
- "mongo/idl/basic_types.idl"
- "mongo/db/auth/auth_types.idl"
- "mongo/db/auth/address_restriction.idl"
server_parameters:
enforceUserClusterSeparation:
description: "Prevents creation of users whose names would be interpreted as cluster members"
set_at: startup
cpp_varname: "gEnforceUserClusterSeparation"
cpp_vartype: bool
default: true
structs:
dropAllUsersFromDatabaseReply:
description: "Response for dropAllUsersFromDatabase command"
strict: false
fields:
n:
description: "Number of users dropped from database"
type: int
cpp_name: count
dropAllRolesFromDatabaseReply:
description: "Response for dropAllRolesFromDatabase command"
strict: false
fields:
n:
description: "Number of roles dropped from database"
type: int
cpp_name: count
UMCTransactionFailPoint:
description: Data for umcTransaction failpoint
fields:
commitDelayMS:
type: int
default: 0
validator: { gte: 0 }
commands:
createUser:
description: "Create a user"
namespace: type
type: string
cpp_name: CreateUserCommand
strict: true
fields:
pwd:
description: "Initial user password"
type: string
optional: true
customData:
description: "Any arbitrary data"
type: object
optional: true
roles:
description: "Initial roles to grant to the user"
type: array<RoleNameOrString>
digestPassword:
description: "True if the server should digest the password, false for pre-digested"
type: bool
default: true
writeConcern:
description: "The level of write concern for the creation operation"
type: object
optional: true
authenticationRestrictions:
description: "Authentication restrictions to enforce on the user"
type: array<address_restriction>
optional: true
mechanisms:
description: "List of valid authentication mechanisms for the user"
type: array<string>
optional: true
updateUser:
description: "Modify a user"
namespace: type
type: string
cpp_name: UpdateUserCommand
strict: true
fields:
pwd:
description: "New user password"
type: string
optional: true
customData:
description: "Any arbitrary data"
type: object
optional: true
roles:
description: "New set of roles for the user"
type: array<RoleNameOrString>
optional: true
digestPassword:
description: "True if the server should digest the password, false for pre-digested"
type: bool
default: true
writeConcern:
description: "The level of write concern for the update operation"
type: object
optional: true
authenticationRestrictions:
description: "Authentication restrictions to enforce on the user"
type: array<address_restriction>
optional: true
mechanisms:
description: "List of valid authentication mechanisms for the user"
type: array<string>
optional: true
dropUser:
description: "Drop a single user"
namespace: type
type: string
cpp_name: DropUserCommand
strict: true
dropAllUsersFromDatabase:
description: "Drop all users in the database"
namespace: ignored
cpp_name: DropAllUsersFromDatabaseCommand
strict: true
grantRolesToUser:
description: "Grant additional roles to a user"
namespace: type
type: string
cpp_name: GrantRolesToUserCommand
strict: true
fields:
roles:
description: "Roles to grant to the user"
type: array<RoleNameOrString>
revokeRolesFromUser:
description: "Revoke previously assigned roles from a user"
namespace: type
type: string
cpp_name: RevokeRolesFromUserCommand
strict: true
fields:
roles:
description: "Roles to revoke from the user"
type: array<RoleNameOrString>
createRole:
description: "Create a new role"
namespace: type
type: string
cpp_name: CreateRoleCommand
strict: true
fields:
privileges:
description: "Actions explicitly granted to this role"
type: array<Privilege>
roles:
description: "Roles to inherit additional privileges from"
type: array<RoleNameOrString>
authenticationRestrictions:
description: "Authentication restrictions to enforce on the user"
type: array<address_restriction>
optional: true
updateRole:
description: "Update an existing role"
namespace: type
type: string
cpp_name: UpdateRoleCommand
strict: true
fields:
privileges:
description: "Actions explicitly granted to this role"
type: array<Privilege>
optional: true
roles:
description: "Roles to inherit additional privileges from"
type: array<RoleNameOrString>
optional: true
authenticationRestrictions:
description: "Authentication restrictions to enforce on the user"
type: array<address_restriction>
optional: true
grantPrivilegesToRole:
description: "Grants privileges to a role"
namespace: type
type: string
cpp_name: GrantPrivilegesToRoleCommand
strict: true
fields:
privileges:
description: "Privileges to grant to this role"
type: array<Privilege>
revokePrivilegesFromRole:
description: "Grants privileges to a role"
namespace: type
type: string
cpp_name: RevokePrivilegesFromRoleCommand
strict: true
fields:
privileges:
description: "Privileges to revoke from this role"
type: array<Privilege>
grantRolesToRole:
description: "Grant roles to a role"
namespace: type
type: string
cpp_name: GrantRolesToRoleCommand
strict: true
fields:
roles:
description: "Roles to grant to this role"
type: array<RoleNameOrString>
revokeRolesFromRole:
description: "Revoke roles from a role"
namespace: type
type: string
cpp_name: RevokeRolesFromRoleCommand
strict: true
fields:
roles:
description: "Roles to revoke from this role"
type: array<RoleNameOrString>
dropRole:
description: >-
Drops a single role. Before deleting the role completely it must remove it
from any users or roles that reference it. If any errors occur in the middle
of that process it's possible to be left in a state where the role has been
removed from some user/roles but otherwise still exists.
namespace: type
type: string
cpp_name: DropRoleCommand
strict: true
dropAllRolesFromDatabase:
description: >-
Drops all roles from the given database. Before deleting the roles completely
it must remove them from any users or other roles that reference them. If any
errors occur in the middle of that process it's possible to be left in a state
where the roles have been removed from some user/roles but otherwise still exist.
namespace: ignored
cpp_name: DropAllRolesFromDatabaseCommand
strict: true
|