1 | import { Cluster } from './cluster';
|
2 | import { CppManagementRbacGroup, CppManagementRbacOrigin, CppManagementRbacRole, CppManagementRbacRoleAndDescription, CppManagementRbacRoleAndOrigins, CppManagementRbacUser, CppManagementRbacUserAndMetadata } from './binding';
|
3 | import { NodeCallback } from './utilities';
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | export declare class Origin {
|
10 | |
11 |
|
12 |
|
13 | type: string;
|
14 | |
15 |
|
16 |
|
17 | name?: string;
|
18 | |
19 |
|
20 |
|
21 | constructor(data: Origin);
|
22 | /**
|
23 | * @internal
|
24 | */
|
25 | static _fromCppData(data: CppManagementRbacOrigin): Origin;
|
26 | }
|
27 | /**
|
28 | * Contains information about a role.
|
29 | *
|
30 | * @category Management
|
31 | */
|
32 | export declare class Role {
|
33 | |
34 |
|
35 |
|
36 | name: string;
|
37 | |
38 |
|
39 |
|
40 | bucket: string | undefined;
|
41 | |
42 |
|
43 |
|
44 | scope: string | undefined;
|
45 | |
46 |
|
47 |
|
48 | collection: string | undefined;
|
49 | |
50 |
|
51 |
|
52 | constructor(data: Role);
|
53 | /**
|
54 | * @internal
|
55 | */
|
56 | static _fromCppData(data: CppManagementRbacRole): Role;
|
57 | /**
|
58 | * @internal
|
59 | */
|
60 | static _toCppData(data: Role): CppManagementRbacRole;
|
61 | }
|
62 | /**
|
63 | * Contains information about a role along with its description.
|
64 | *
|
65 | * @category Management
|
66 | */
|
67 | export declare class RoleAndDescription extends Role {
|
68 | |
69 |
|
70 |
|
71 | displayName: string;
|
72 | |
73 |
|
74 |
|
75 | description: string;
|
76 | |
77 |
|
78 |
|
79 | constructor(data: RoleAndDescription);
|
80 | /**
|
81 | * @internal
|
82 | */
|
83 | static _fromCppData(data: CppManagementRbacRoleAndDescription): RoleAndDescription;
|
84 | }
|
85 | /**
|
86 | * Contains information about a role along with its origin.
|
87 | *
|
88 | * @category Management
|
89 | */
|
90 | export declare class RoleAndOrigin extends Role {
|
91 | |
92 |
|
93 |
|
94 | origins: Origin[];
|
95 | |
96 |
|
97 |
|
98 | constructor(data: RoleAndOrigin);
|
99 | /**
|
100 | * @internal
|
101 | */
|
102 | static _fromCppData(data: CppManagementRbacRoleAndOrigins): RoleAndOrigin;
|
103 | }
|
104 | /**
|
105 | * Specifies information about a user.
|
106 | *
|
107 | * @category Management
|
108 | */
|
109 | export interface IUser {
|
110 | |
111 |
|
112 |
|
113 | username: string;
|
114 | |
115 |
|
116 |
|
117 | displayName?: string;
|
118 | |
119 |
|
120 |
|
121 | groups?: string[];
|
122 | |
123 |
|
124 |
|
125 | roles?: (Role | string)[];
|
126 | |
127 |
|
128 |
|
129 | password?: string;
|
130 | }
|
131 |
|
132 |
|
133 |
|
134 |
|
135 |
|
136 | export declare class User implements IUser {
|
137 | |
138 |
|
139 |
|
140 | username: string;
|
141 | |
142 |
|
143 |
|
144 | displayName?: string;
|
145 | |
146 |
|
147 |
|
148 | groups: string[];
|
149 | |
150 |
|
151 |
|
152 | roles: Role[];
|
153 | |
154 |
|
155 |
|
156 | password: undefined;
|
157 | |
158 |
|
159 |
|
160 | constructor(data: User);
|
161 | /**
|
162 | * @internal
|
163 | */
|
164 | static _fromCppData(data: CppManagementRbacUser): User;
|
165 | /**
|
166 | * @internal
|
167 | */
|
168 | static _toCppData(data: IUser): CppManagementRbacUser;
|
169 | }
|
170 | /**
|
171 | * Contains information about a user along with some additional meta-data
|
172 | * about that user.
|
173 | *
|
174 | * @category Management
|
175 | */
|
176 | export declare class UserAndMetadata extends User {
|
177 | |
178 |
|
179 |
|
180 | domain: string;
|
181 | |
182 |
|
183 |
|
184 | effectiveRoles: RoleAndOrigin[];
|
185 | |
186 |
|
187 |
|
188 | passwordChanged?: Date;
|
189 | |
190 |
|
191 |
|
192 | externalGroups: string[];
|
193 | |
194 |
|
195 |
|
196 |
|
197 |
|
198 |
|
199 | get effectiveRolesAndOrigins(): RoleAndOrigin[];
|
200 | |
201 |
|
202 |
|
203 | constructor(data: UserAndMetadata);
|
204 | /**
|
205 | * @internal
|
206 | */
|
207 | static _fromCppData(data: CppManagementRbacUserAndMetadata): UserAndMetadata;
|
208 | }
|
209 | /**
|
210 | * Specifies information about a group.
|
211 | *
|
212 | * @category Management
|
213 | */
|
214 | export interface IGroup {
|
215 | |
216 |
|
217 |
|
218 | name: string;
|
219 | |
220 |
|
221 |
|
222 | description?: string;
|
223 | |
224 |
|
225 |
|
226 | roles?: (Role | string)[];
|
227 | |
228 |
|
229 |
|
230 | ldapGroupReference?: string;
|
231 | }
|
232 |
|
233 |
|
234 |
|
235 |
|
236 |
|
237 | export declare class Group {
|
238 | |
239 |
|
240 |
|
241 | name: string;
|
242 | |
243 |
|
244 |
|
245 | description: string;
|
246 | |
247 |
|
248 |
|
249 | roles: Role[];
|
250 | |
251 |
|
252 |
|
253 | ldapGroupReference: string | undefined;
|
254 | |
255 |
|
256 |
|
257 | constructor(data: Group);
|
258 | /**
|
259 | * @internal
|
260 | */
|
261 | static _fromCppData(data: CppManagementRbacGroup): Group;
|
262 | /**
|
263 | * @internal
|
264 | */
|
265 | static _toCppData(data: IGroup): CppManagementRbacGroup;
|
266 | }
|
267 | /**
|
268 | * @category Management
|
269 | */
|
270 | export interface GetUserOptions {
|
271 | |
272 |
|
273 |
|
274 | domainName?: string;
|
275 | |
276 |
|
277 |
|
278 | timeout?: number;
|
279 | }
|
280 |
|
281 |
|
282 |
|
283 | export interface GetAllUsersOptions {
|
284 | |
285 |
|
286 |
|
287 | domainName?: string;
|
288 | |
289 |
|
290 |
|
291 | timeout?: number;
|
292 | }
|
293 |
|
294 |
|
295 |
|
296 | export interface UpsertUserOptions {
|
297 | |
298 |
|
299 |
|
300 | domainName?: string;
|
301 | |
302 |
|
303 |
|
304 | timeout?: number;
|
305 | }
|
306 |
|
307 |
|
308 |
|
309 | export interface ChangePasswordOptions {
|
310 | |
311 |
|
312 |
|
313 | timeout?: number;
|
314 | }
|
315 |
|
316 |
|
317 |
|
318 | export interface DropUserOptions {
|
319 | |
320 |
|
321 |
|
322 | domainName?: string;
|
323 | |
324 |
|
325 |
|
326 | timeout?: number;
|
327 | }
|
328 |
|
329 |
|
330 |
|
331 | export interface GetRolesOptions {
|
332 | |
333 |
|
334 |
|
335 | timeout?: number;
|
336 | }
|
337 |
|
338 |
|
339 |
|
340 | export interface GetGroupOptions {
|
341 | |
342 |
|
343 |
|
344 | timeout?: number;
|
345 | }
|
346 |
|
347 |
|
348 |
|
349 | export interface GetAllGroupsOptions {
|
350 | |
351 |
|
352 |
|
353 | timeout?: number;
|
354 | }
|
355 |
|
356 |
|
357 |
|
358 | export interface UpsertGroupOptions {
|
359 | |
360 |
|
361 |
|
362 | timeout?: number;
|
363 | }
|
364 |
|
365 |
|
366 |
|
367 | export interface DropGroupOptions {
|
368 | |
369 |
|
370 |
|
371 | timeout?: number;
|
372 | }
|
373 |
|
374 |
|
375 |
|
376 |
|
377 |
|
378 |
|
379 | export declare class UserManager {
|
380 | private _cluster;
|
381 | |
382 |
|
383 |
|
384 | constructor(cluster: Cluster);
|
385 | /**
|
386 | * Returns a specific user by their username.
|
387 | *
|
388 | * @param username The username of the user to fetch.
|
389 | * @param options Optional parameters for this operation.
|
390 | * @param callback A node-style callback to be invoked after execution.
|
391 | */
|
392 | getUser(username: string, options?: GetUserOptions, callback?: NodeCallback<UserAndMetadata>): Promise<UserAndMetadata>;
|
393 | /**
|
394 | * Returns a list of all existing users.
|
395 | *
|
396 | * @param options Optional parameters for this operation.
|
397 | * @param callback A node-style callback to be invoked after execution.
|
398 | */
|
399 | getAllUsers(options?: GetAllUsersOptions, callback?: NodeCallback<UserAndMetadata[]>): Promise<UserAndMetadata[]>;
|
400 | /**
|
401 | * Creates or updates an existing user.
|
402 | *
|
403 | * @param user The user to update.
|
404 | * @param options Optional parameters for this operation.
|
405 | * @param callback A node-style callback to be invoked after execution.
|
406 | */
|
407 | upsertUser(user: IUser, options?: UpsertUserOptions, callback?: NodeCallback<void>): Promise<void>;
|
408 | /**
|
409 | * Change password for the currently authenticatd user.
|
410 | *
|
411 | * @param newPassword The new password to be applied.
|
412 | * @param options Optional parameters for this operation.
|
413 | * @param callback A node-style callback to be invoked after execution.
|
414 | */
|
415 | changePassword(newPassword: string, options?: ChangePasswordOptions, callback?: NodeCallback<void>): Promise<void>;
|
416 | /**
|
417 | * Drops an existing user.
|
418 | *
|
419 | * @param username The username of the user to drop.
|
420 | * @param options Optional parameters for this operation.
|
421 | * @param callback A node-style callback to be invoked after execution.
|
422 | */
|
423 | dropUser(username: string, options?: DropUserOptions, callback?: NodeCallback<void>): Promise<void>;
|
424 | /**
|
425 | * Returns a list of roles available on the server.
|
426 | *
|
427 | * @param options Optional parameters for this operation.
|
428 | * @param callback A node-style callback to be invoked after execution.
|
429 | */
|
430 | getRoles(options?: GetRolesOptions, callback?: NodeCallback<Role[]>): Promise<Role[]>;
|
431 | /**
|
432 | * Returns a group by it's name.
|
433 | *
|
434 | * @param groupName The name of the group to retrieve.
|
435 | * @param options Optional parameters for this operation.
|
436 | * @param callback A node-style callback to be invoked after execution.
|
437 | */
|
438 | getGroup(groupName: string, options?: GetGroupOptions, callback?: NodeCallback<Group>): Promise<Group>;
|
439 | /**
|
440 | * Returns a list of all existing groups.
|
441 | *
|
442 | * @param options Optional parameters for this operation.
|
443 | * @param callback A node-style callback to be invoked after execution.
|
444 | */
|
445 | getAllGroups(options?: GetAllGroupsOptions, callback?: NodeCallback<Group[]>): Promise<Group[]>;
|
446 | /**
|
447 | * Creates or updates an existing group.
|
448 | *
|
449 | * @param group The group to update.
|
450 | * @param options Optional parameters for this operation.
|
451 | * @param callback A node-style callback to be invoked after execution.
|
452 | */
|
453 | upsertGroup(group: IGroup, options?: UpsertGroupOptions, callback?: NodeCallback<void>): Promise<void>;
|
454 | /**
|
455 | * Drops an existing group.
|
456 | *
|
457 | * @param groupName The name of the group to drop.
|
458 | * @param options Optional parameters for this operation.
|
459 | * @param callback A node-style callback to be invoked after execution.
|
460 | */
|
461 | dropGroup(groupName: string, options?: DropGroupOptions, callback?: NodeCallback<void>): Promise<void>;
|
462 | }
|