Skip to content

Commit 2acab4f

Browse files
committed
chore(docs): Add HTTP status codes 401/403 to docs in api/server
1 parent 0c4c63b commit 2acab4f

File tree

3 files changed

+67
-1
lines changed

3 files changed

+67
-1
lines changed

src/docs/src/api/server/authn.rst

+2
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ To obtain the first token and thus authenticate a user for the first time, the
113113
:code 200: Successfully authenticated
114114
:code 302: Redirect after successful authentication
115115
:code 401: Username or password wasn't recognized
116+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
116117

117118
**Request**:
118119

@@ -198,6 +199,7 @@ To obtain the first token and thus authenticate a user for the first time, the
198199
:>json object info: Server authentication configuration
199200
:code 200: Successfully authenticated.
200201
:code 401: Username or password wasn't recognized.
202+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
201203

202204
**Request**:
203205

src/docs/src/api/server/common.rst

+60-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
:>header Content-Type: - :mimetype:`application/json`
3434
- :mimetype:`text/plain; charset=utf-8`
3535
:code 200: Request completed successfully
36+
:code 401: Unauthorized request to a protected API
37+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
3638

3739
**Request**:
3840

@@ -103,6 +105,7 @@
103105
:>json number updated_on: Unix timestamp of last operation update
104106
:code 200: Request completed successfully
105107
:code 401: CouchDB Server Administrator privileges required
108+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
106109

107110
**Request**:
108111

@@ -206,6 +209,8 @@
206209
:>header Content-Type: - :mimetype:`application/json`
207210
- :mimetype:`text/plain; charset=utf-8`
208211
:code 200: Request completed successfully
212+
:code 401: Unauthorized request to a protected API
213+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
209214

210215
**Request**:
211216

@@ -264,6 +269,8 @@
264269
:>header Content-Type: - :mimetype:`application/json`
265270
- :mimetype:`text/plain; charset=utf-8`
266271
:code 200: Request completed successfully
272+
:code 401: Unauthorized request to a protected API
273+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
267274

268275
**Request**:
269276

@@ -324,6 +331,8 @@
324331
:<json array keys: Array of database names to be requested
325332
:code 200: Request completed successfully
326333
:code 400: Missing keys or exceeded keys in request
334+
:code 401: Unauthorized request to a protected API
335+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
327336

328337
**Request**:
329338

@@ -431,6 +440,8 @@
431440
:>json string state: Current ``state`` of the node and/or cluster (see
432441
below)
433442
:code 200: Request completed successfully
443+
:code 401: Unauthorized request to a protected API
444+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
434445

435446
The ``state`` returned indicates the current node or cluster state, and
436447
is one of the following:
@@ -525,8 +536,11 @@
525536
:<json array ensure_dbs_exist: List of system databases to ensure exist
526537
on the node/cluster. Defaults to
527538
``["_users","_replicator"]``.
539+
:code 200: Request completed successfully
540+
:code 401: Unauthorized request to a protected API
541+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
528542

529-
*No example request/response included here. For a worked example, please
543+
*No example request/response included here. For a working example, please
530544
see* :ref:`cluster/setup/api`.
531545

532546
.. _api/server/db_updates:
@@ -574,6 +588,7 @@
574588
:>json string last_seq: The last sequence ID reported.
575589
:code 200: Request completed successfully
576590
:code 401: CouchDB Server Administrator privileges required
591+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
577592

578593
The ``results`` field of database updates:
579594

@@ -633,6 +648,8 @@
633648
:>header Content-Type: - :mimetype:`application/json`
634649
- :mimetype:`text/plain; charset=utf-8`
635650
:code 200: Request completed successfully
651+
:code 401: Unauthorized request to a protected API
652+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
636653

637654
**Request**:
638655

@@ -732,6 +749,7 @@
732749
:code 202: Continuous replication request has been accepted
733750
:code 400: Invalid JSON data
734751
:code 401: CouchDB Server Administrator privileges required
752+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
735753
:code 404: Either the source or target DB is not found or attempt to
736754
cancel unknown replication task
737755
:code 500: JSON specification was invalid
@@ -1065,6 +1083,8 @@ error.
10651083
:>json string start_time: Timestamp of when the replication was started
10661084
:code 200: Request completed successfully
10671085
:code 401: CouchDB Server Administrator privileges required
1086+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
1087+
10681088

10691089
**Request**:
10701090

@@ -1219,6 +1239,7 @@ error.
12191239
replication is not making progress.
12201240
:code 200: Request completed successfully
12211241
:code 401: CouchDB Server Administrator privileges required
1242+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
12221243

12231244
The ``info`` field of a scheduler doc:
12241245

@@ -1364,6 +1385,7 @@ error.
13641385
replication is not making progress.
13651386
:code 200: Request completed successfully
13661387
:code 401: CouchDB Server Administrator privileges required
1388+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
13671389

13681390
The ``info`` field of a scheduler doc:
13691391

@@ -1472,6 +1494,7 @@ error.
14721494
replication is not making progress.
14731495
:code 200: Request completed successfully
14741496
:code 401: CouchDB Server Administrator privileges required
1497+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
14751498

14761499
The ``info`` field of a scheduler doc:
14771500

@@ -1559,6 +1582,8 @@ error.
15591582
:>header Content-Type: - :mimetype:`application/json`
15601583
- :mimetype:`text/plain; charset=utf-8`
15611584
:code 200: Request completed successfully
1585+
:code 401: Unauthorized request to a protected API
1586+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
15621587

15631588
**Request**:
15641589

@@ -1613,6 +1638,8 @@ error.
16131638
:>header Content-Type: - :mimetype:`application/json`
16141639
- :mimetype:`text/plain; charset=utf-8`
16151640
:code 200: Request completed successfully
1641+
:code 401: Unauthorized request to a protected API
1642+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
16161643

16171644
**Request**:
16181645

@@ -1733,6 +1760,10 @@ containing only the requested individual statistic.
17331760
determined by `Prometheus <https://prometheus.io/docs/introduction/overview/>`_.
17341761
The format version is 2.0.
17351762

1763+
:code 200: Request completed successfully
1764+
:code 401: Unauthorized request to a protected API
1765+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
1766+
17361767
**Request**:
17371768

17381769
.. code-block:: http
@@ -1935,6 +1966,7 @@ See :ref:`Configuration of Prometheus Endpoint <config/prometheus>` for details.
19351966

19361967
:code 200: Request completed successfully
19371968
:code 401: CouchDB Server Administrator privileges required
1969+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
19381970

19391971
**Request**:
19401972

@@ -2043,6 +2075,8 @@ See :ref:`Configuration of Prometheus Endpoint <config/prometheus>` for details.
20432075
:>header Content-Type: - :mimetype:`application/json`
20442076
- :mimetype:`text/plain; charset=utf-8`
20452077
:code 200: Request completed successfully
2078+
:code 401: Unauthorized request to a protected API
2079+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
20462080

20472081
**Request**:
20482082

@@ -2083,6 +2117,8 @@ See :ref:`Configuration of Prometheus Endpoint <config/prometheus>` for details.
20832117
it is not meant to be used in production
20842118

20852119
:code 200: Request completed successfully
2120+
:code 401: Unauthorized request to a protected API
2121+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
20862122

20872123
.. _api/server/versions:
20882124

@@ -2107,6 +2143,8 @@ See :ref:`Configuration of Prometheus Endpoint <config/prometheus>` for details.
21072143
- :mimetype:`text/plain`
21082144
:>header Content-Type: - :mimetype:`application/json`
21092145
:code 200: Request completed successfully
2146+
:code 401: Unauthorized request to a protected API
2147+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
21102148

21112149
**Request**:
21122150

@@ -2172,6 +2210,8 @@ See :ref:`Configuration of Prometheus Endpoint <config/prometheus>` for details.
21722210
:param text: Analyzer token you want to test
21732211
:code 200: Request completed successfully
21742212
:code 400: Request body is wrong (malformed or missing one of the mandatory fields)
2213+
:code 401: Unauthorized request to a protected API
2214+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
21752215
:code 500: A server error (or other kind of error) occurred
21762216

21772217
**Request**:
@@ -2219,6 +2259,8 @@ See :ref:`Configuration of Prometheus Endpoint <config/prometheus>` for details.
22192259
:param text: Analyzer token you want to test
22202260
:code 200: Request completed successfully
22212261
:code 400: Request body is wrong (malformed or missing one of the mandatory fields)
2262+
:code 401: Unauthorized request to a protected API
2263+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
22222264
:code 500: A server error (or other kind of error) occurred
22232265

22242266
**Request**:
@@ -2261,6 +2303,8 @@ See :ref:`Configuration of Prometheus Endpoint <config/prometheus>` for details.
22612303
:>header Content-Type: :mimetype:`text/html`
22622304
:>header Last-Modified: Static files modification timestamp
22632305
:code 200: Request completed successfully
2306+
:code 401: Unauthorized request to a protected API
2307+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
22642308

22652309
.. _api/server/up:
22662310

@@ -2279,6 +2323,8 @@ See :ref:`Configuration of Prometheus Endpoint <config/prometheus>` for details.
22792323

22802324
:>header Content-Type: :mimetype:`application/json`
22812325
:code 200: Request completed successfully
2326+
:code 401: Unauthorized request to a protected API
2327+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
22822328
:code 404: The server is unavailable for requests at this time.
22832329

22842330
**Response**:
@@ -2319,6 +2365,8 @@ See :ref:`Configuration of Prometheus Endpoint <config/prometheus>` for details.
23192365
:code 200: Request completed successfully
23202366
:code 400: Requested more UUIDs than is :config:option:`allowed
23212367
<uuids/max_count>` to retrieve
2368+
:code 401: Unauthorized request to a protected API
2369+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
23222370

23232371
**Request**:
23242372

@@ -2398,6 +2446,8 @@ You can verify the change by obtaining a list of UUIDs:
23982446

23992447
:>header Content-Type: :mimetype:`image/x-icon`
24002448
:code 200: Request completed successfully
2449+
:code 401: Unauthorized request to a protected API
2450+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
24012451
:code 404: The requested content could not be found
24022452

24032453
.. _api/server/reshard:
@@ -2428,6 +2478,7 @@ You can verify the change by obtaining a list of UUIDs:
24282478

24292479
:code 200: Request completed successfully
24302480
:code 401: CouchDB Server Administrator privileges required
2481+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
24312482

24322483
**Request**:
24332484

@@ -2468,6 +2519,7 @@ You can verify the change by obtaining a list of UUIDs:
24682519

24692520
:code 200: Request completed successfully
24702521
:code 401: CouchDB Server Administrator privileges required
2522+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
24712523

24722524
**Request**:
24732525

@@ -2510,6 +2562,7 @@ You can verify the change by obtaining a list of UUIDs:
25102562
:code 200: Request completed successfully
25112563
:code 400: Invalid request. Could be a bad or missing state name.
25122564
:code 401: CouchDB Server Administrator privileges required
2565+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
25132566

25142567
**Request**:
25152568

@@ -2554,6 +2607,7 @@ You can verify the change by obtaining a list of UUIDs:
25542607

25552608
:code 200: Request completed successfully
25562609
:code 401: CouchDB Server Administrator privileges required
2610+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
25572611

25582612
**Request**:
25592613

@@ -2634,6 +2688,7 @@ You can verify the change by obtaining a list of UUIDs:
26342688

26352689
:code 200: Request completed successfully
26362690
:code 401: CouchDB Server Administrator privileges required
2691+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
26372692

26382693
**Request**:
26392694

@@ -2722,6 +2777,7 @@ You can verify the change by obtaining a list of UUIDs:
27222777
:code 201: One or more jobs were successfully created
27232778
:code 400: Invalid request. Parameter validation might have failed.
27242779
:code 401: CouchDB Server Administrator privileges required
2780+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
27252781
:code 404: Db, node, range or shard was not found
27262782

27272783
**Request**:
@@ -2769,6 +2825,7 @@ You can verify the change by obtaining a list of UUIDs:
27692825

27702826
:code 200: The job was removed successfully
27712827
:code 401: CouchDB Server Administrator privileges required
2828+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
27722829
:code 404: The job was not found
27732830

27742831
**Request**:
@@ -2804,6 +2861,7 @@ You can verify the change by obtaining a list of UUIDs:
28042861

28052862
:code 200: Request completed successfully
28062863
:code 401: CouchDB Server Administrator privileges required
2864+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
28072865
:code 404: The job was not found
28082866

28092867
**Request**:
@@ -2848,6 +2906,7 @@ You can verify the change by obtaining a list of UUIDs:
28482906
:code 200: Request completed successfully
28492907
:code 400: Invalid request. Could be a bad state name, for example.
28502908
:code 401: CouchDB Server Administrator privileges required
2909+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
28512910
:code 404: The job was not found
28522911

28532912
**Request**:

src/docs/src/api/server/configuration.rst

+5
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ interact with the local node's configuration.
4242
- :mimetype:`text/plain; charset=utf-8`
4343
:code 200: Request completed successfully
4444
:code 401: CouchDB Server Administrator privileges required
45+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
4546

4647
**Request**
4748

@@ -133,6 +134,7 @@ interact with the local node's configuration.
133134
- :mimetype:`text/plain; charset=utf-8`
134135
:code 200: Request completed successfully
135136
:code 401: CouchDB Server Administrator privileges required
137+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
136138

137139
**Request**:
138140

@@ -179,6 +181,7 @@ interact with the local node's configuration.
179181
- :mimetype:`text/plain; charset=utf-8`
180182
:code 200: Request completed successfully
181183
:code 401: CouchDB Server Administrator privileges required
184+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
182185

183186
**Request**:
184187

@@ -224,6 +227,7 @@ interact with the local node's configuration.
224227
:code 200: Request completed successfully
225228
:code 400: Invalid JSON request body
226229
:code 401: CouchDB Server Administrator privileges required
230+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
227231
:code 500: Error setting configuration
228232

229233
**Request**:
@@ -265,6 +269,7 @@ interact with the local node's configuration.
265269
- :mimetype:`text/plain; charset=utf-8`
266270
:code 200: Request completed successfully
267271
:code 401: CouchDB Server Administrator privileges required
272+
:code 403: Insufficient permissions / :ref:`Too many requests with invalid credentials<error/403>`
268273
:code 404: Specified configuration option not found
269274

270275
**Request**:

0 commit comments

Comments
 (0)