Skip to content

Commit 145bc30

Browse files
authored
DOC-9755 -- Rest API fix user response model (#642)
https://issues.couchbase.com/browse/DOC-9755
1 parent 3e3548d commit 145bc30

File tree

1 file changed

+67
-71
lines changed

1 file changed

+67
-71
lines changed

modules/ROOT/assets/attachments/rest-api-admin.yaml

Lines changed: 67 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -2261,16 +2261,14 @@ paths:
22612261
-- Sync Gateway Application
22622262
-- Sync Gateway Application Read Only
22632263
2264-
Without `Application` or `Application Read Only` users will be unable to see dynamc user or role data.
2264+
Without `Application` or `Application Read Only` users will be unable to see dynamic user or role data.
22652265
parameters:
22662266
- $ref: '#/parameters/db'
22672267
- $ref: '#/parameters/name'
22682268

22692269
responses:
22702270
200:
2271-
description: 200 OK – Returns information about the specified user
2272-
schema:
2273-
$ref: '#/definitions/user'
2271+
$ref: '#/responses/200-User'
22742272
401:
22752273
$ref: '#/responses/Unauthorized'
22762274

@@ -2445,23 +2443,36 @@ responses:
24452443
schema:
24462444
$ref: '#/definitions/bootstrap_config_model'
24472445

2448-
'200-user':
2449-
description: OK
2446+
'200-User':
2447+
description: 200 OK - Returns information about the specified user
24502448
schema:
2451-
$ref: '#/definitions/user'
2449+
$ref: '#/definitions/User-response'
2450+
example:
2451+
{
2452+
"name": "jim",
2453+
"admin_channels" : [
2454+
"!",
2455+
"jim.roberts@gmail,com"
2456+
],
2457+
"all-Channels": [
2458+
"!",
2459+
"jim. roberts@gmail,com"
2460+
],
2461+
"email": "[email protected]"
2462+
}
24522463

24532464
'200-resync':
24542465
description: OK
24552466
schema:
24562467
$ref: '#/definitions/Resync-response'
2457-
example:
2458-
{
2459-
"status": "completed",
2460-
"start_time": "2022-01-05T15:05:27.521824Z",
2461-
"last_error": "",
2462-
"docs_changed": 0,
2463-
"docs_processed": 0
2464-
}
2468+
example:
2469+
{
2470+
"status": "completed",
2471+
"start_time": "2022-01-05T15:05:27.521824Z",
2472+
"last_error": "",
2473+
"docs_changed": 0,
2474+
"docs_processed": 0
2475+
}
24652476

24662477
'400-resync-post-stopped':
24672478
description: 400 - Database _resync not running
@@ -3368,20 +3379,6 @@ definitions:
33683379
sync:
33693380
$ref: '#/definitions/sync_function'
33703381

3371-
# users:
3372-
# type: object
3373-
# title: user
3374-
# description: |+
3375-
# Defines the user(s) for this Sync Gateway database
3376-
# $ref: "#/definitions/user"
3377-
3378-
# roles:
3379-
# type: object
3380-
# title: role
3381-
# description: |+
3382-
# Defines the role(s) for this Sync Gateway database
3383-
# $ref: "#/definitions/role"
3384-
33853382
guest:
33863383
type: object
33873384
description: |+
@@ -4694,7 +4691,7 @@ definitions:
46944691
channel(doc.channels);
46954692
}
46964693
4697-
user:
4694+
User:
46984695
type: object
46994696
title: "User Configuration Model"
47004697
description: |+
@@ -4773,6 +4770,43 @@ definitions:
47734770
type: string
47744771
description: Role name
47754772

4773+
User-response:
4774+
type: object
4775+
properties:
4776+
name:
4777+
type: string
4778+
description: |+
4779+
The user name (the same name used in the URL path).
4780+
4781+
admin_channels:
4782+
4783+
description: |+
4784+
The channels that the user is able to access.
4785+
items:
4786+
type: string
4787+
description: |+
4788+
Channel name
4789+
4790+
all_channels:
4791+
type: array
4792+
description: |+
4793+
Shows the channels the user can access, as granted by the sync function.
4794+
4795+
readOnly: true
4796+
items:
4797+
type: string
4798+
description: Channel name
4799+
4800+
email:
4801+
type: string
4802+
description: |+
4803+
Email address of the user.
4804+
disabled:
4805+
type: boolean
4806+
description: |+
4807+
This property is usually not included.
4808+
If the value is `true`, access for the account is disabled and the user will not be able to login.
4809+
47764810
47774811
AllDatabases:
47784812
type: array
@@ -5195,45 +5229,7 @@ definitions:
51955229
ok:
51965230
type: boolean
51975231
description: Indicates whether the operation was successful
5198-
User:
5199-
type: object
5200-
properties:
5201-
name:
5202-
type: string
5203-
description: The user name (the same name used in the URL path). The valid characters for a user name are alphanumeric ASCII characters and the underscore character. The name property is required in a POST request. You don’t need to include it in a PUT request because the user name is specified in the URL.
5204-
password:
5205-
type: string
5206-
description: Password of the user that will be created. Required, unless the `allow_empty_password` Sync Gateway per-database configuration value is set to `true`, in which case the password can be omitted.
5207-
admin_channels:
5208-
type: array
5209-
description: The channels that the user is explicitly granted access to through the Admin REST API.
5210-
items:
5211-
type: string
5212-
description: Channel name
5213-
admin_roles:
5214-
type: array
5215-
description: The roles that the user is explicitly granted access to through the Admin REST API.
5216-
items:
5217-
type: string
5218-
description: Role name
5219-
all_channels:
5220-
type: array
5221-
description: Like the `admin_channels` property, but also includes channels the user is given access to by other documents via a sync function. This is a derived property and changes to it are ignored.
5222-
items:
5223-
type: string
5224-
description: Channel name
5225-
email:
5226-
type: string
5227-
description: Email of the user that will be created.
5228-
disabled:
5229-
type: boolean
5230-
description: This property is usually not included. If the value is set to `true`, access for the account is disabled and the user will not be able to login.
5231-
roles:
5232-
type: array
5233-
description: Like the `admin_roles` property, but also includes roles the user is given access to by other documents via a sync function. This is a derived property and changes to it are ignored. It contains an array of role name strings.
5234-
items:
5235-
type: string
5236-
description: Role name
5232+
52375233
ChangesFeedRow:
52385234
type: object
52395235
properties:
@@ -6904,7 +6900,7 @@ parameters:
69046900
name: body
69056901
description: Request body
69066902
schema:
6907-
$ref: '#/definitions/user'
6903+
$ref: '#/definitions/User'
69086904

69096905

69106906

@@ -7341,7 +7337,7 @@ parameters:
73417337
name: user configuration data
73427338
description: Provision the user configuration data in JSON format in the body
73437339
schema:
7344-
$ref: '#/definitions/user'
7340+
$ref: '#/definitions/User'
73457341

73467342
upgrade_preview:
73477343
in: query

0 commit comments

Comments
 (0)