Skip to content

Commit 9e93c3d

Browse files
authored
Add shadow user creation to docs (#4164)
1 parent 4e53164 commit 9e93c3d

File tree

3 files changed

+64
-7
lines changed

3 files changed

+64
-7
lines changed

docs/v3/source/includes/api_resources/_users.erb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,26 @@
1818
}
1919
<% end %>
2020

21+
<% content_for :single_user_with_custom_origin do %>
22+
{
23+
"guid": "3a5d3d89-3f89-4f05-8188-8a2b298c79d5",
24+
"created_at": "2019-03-08T01:06:19Z",
25+
"updated_at": "2019-03-08T01:06:19Z",
26+
"username": "some-user",
27+
"presentation_name": "some-user",
28+
"origin": "some-origin",
29+
"metadata": {
30+
"labels": {},
31+
"annotations":{}
32+
},
33+
"links": {
34+
"self": {
35+
"href": "https://api.example.org/v3/users/3a5d3d89-3f89-4f05-8188-8a2b298c79d5"
36+
}
37+
}
38+
}
39+
<% end %>
40+
2141
<% content_for :single_user_with_metadata do %>
2242
{
2343
"guid": "3a5d3d89-3f89-4f05-8188-8a2b298c79d5",

docs/v3/source/includes/resources/roles/_create.md.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ For a user to be assigned a space role, the user must already have an organizati
8585

8686
If the associated user is valid but does not exist in Cloud Controller's database, a user resource will be created automatically.
8787

88+
If CAPI property `cc.allow_user_creation_by_org_manager` is enabled, the organization role is being created by username + origin and the user does not exist in UAA yet, the user will be created.
89+
The origin must be different from `uaa` in this case.
90+
8891
#### Definition
8992
`POST /v3/roles`
9093

docs/v3/source/includes/resources/users/_create.md.erb

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ Controller database.
55

66
Generally, the GUID should match the GUID of an already-created user in the
77
UAA database, though this is not required.
8+
Creating a user by guid is only permitted by admins.
9+
10+
If CAPI property `cc.allow_user_creation_by_org_manager` is enabled, a UAA user will be automatically created if it does not exist yet.
11+
The UAA user will be only created when `username` and `origin` have been provided instead of a guid. Additionally `origin` must be different from `uaa`.
12+
Admins and OrgManagers can make use of the UAA user creation.
813

914
```
1015
Example Request
@@ -31,19 +36,48 @@ Content-Type: application/json
3136
<%= yield_content :single_user %>
3237
```
3338

39+
```
40+
Example Request (by username and origin)
41+
```
42+
43+
```shell
44+
curl "https://api.example.org/v3/users" \
45+
-X POST \
46+
-H "Authorization: bearer [token]" \
47+
-H "Content-type: application/json" \
48+
-d '{
49+
"username": "some-user",
50+
"origin": "some-origin"
51+
}'
52+
```
53+
54+
```
55+
Example Response
56+
```
57+
58+
```http
59+
HTTP/1.1 201 Created
60+
Content-Type: application/json
61+
62+
<%= yield_content :single_user_with_custom_origin %>
63+
```
64+
3465
#### Definition
3566
`POST /v3/users`
3667

3768
#### Required parameters
3869

3970
Name | Type | Description
40-
------- | ------- | -----------
41-
**guid** | _string_ | Unique identifier for the user. For UAA users this will match the user ID of an existing UAA user's GUID; in the case of UAA clients, this will match the UAA client ID |
42-
**metadata.labels** | [_label object_](#links) | Labels applied to the user |
43-
**metadata.annotations** | [_annotation object_](#links) | Annotations added to the user |
71+
------- | ------- |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
72+
**guid** | _string_ | Unique identifier for the user. For UAA users this will match the user ID of an existing UAA user's GUID; in the case of UAA clients, this will match the UAA client ID |
73+
**username** | _string_ | Username of the user to be created. This can only be provided together with `origin`. |
74+
**origin** | _string_ | Origin of the user to be created. This can only be provided together with `username` and cannot be `uaa`. |
75+
**metadata.labels** | [_label object_](#links) | Labels applied to the user |
76+
**metadata.annotations** | [_annotation object_](#links) | Annotations added to the user |
4477

4578
#### Permitted roles
4679

47-
|
48-
----- |
49-
Admin |
80+
Role | Notes
81+
----- |----------------------------------------------------------------------------------------------------------------------------
82+
Admin | |
83+
OrgManager | can only create users by `username` and `origin` and when CAPI property `cc.allow_user_creation_by_org_manager` is enabled |

0 commit comments

Comments
 (0)