Skip to content

Commit 173b530

Browse files
authored
spec: add 401 unauthorized error (#43)
Add 401 error model so the server can differentiate between AnthN errors (401) and AuthZ errors (403)
1 parent b60641f commit 173b530

5 files changed

Lines changed: 173 additions & 35 deletions

File tree

java/lance-catalog-apache-client/api/openapi.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ paths:
4545
$ref: '#/components/responses/ListNamespacesResponse'
4646
"400":
4747
$ref: '#/components/responses/BadRequestErrorResponse'
48+
"401":
49+
$ref: '#/components/responses/UnauthorizedResponse'
4850
"403":
4951
$ref: '#/components/responses/ForbiddenResponse'
5052
"406":
@@ -72,6 +74,8 @@ paths:
7274
$ref: '#/components/responses/CreateNamespaceResponse'
7375
"400":
7476
$ref: '#/components/responses/BadRequestErrorResponse'
77+
"401":
78+
$ref: '#/components/responses/UnauthorizedResponse'
7579
"403":
7680
$ref: '#/components/responses/ForbiddenResponse'
7781
"406":
@@ -100,6 +104,8 @@ paths:
100104
description: "Success, no content"
101105
"400":
102106
$ref: '#/components/responses/BadRequestErrorResponse'
107+
"401":
108+
$ref: '#/components/responses/UnauthorizedResponse'
103109
"403":
104110
$ref: '#/components/responses/ForbiddenResponse'
105111
"404":
@@ -123,6 +129,8 @@ paths:
123129
$ref: '#/components/responses/GetNamespaceResponse'
124130
"400":
125131
$ref: '#/components/responses/BadRequestErrorResponse'
132+
"401":
133+
$ref: '#/components/responses/UnauthorizedResponse'
126134
"403":
127135
$ref: '#/components/responses/ForbiddenResponse'
128136
"404":
@@ -146,6 +154,8 @@ paths:
146154
description: "Success, no content"
147155
"400":
148156
$ref: '#/components/responses/BadRequestErrorResponse'
157+
"401":
158+
$ref: '#/components/responses/UnauthorizedResponse'
149159
"403":
150160
$ref: '#/components/responses/ForbiddenResponse'
151161
"404":
@@ -231,6 +241,19 @@ components:
231241
\ request body format or other forms of request validation failure, such as\
232242
\ invalid json. Usually serves application/json content, although in some\
233243
\ cases simple text/plain content might be returned by the server's middleware."
244+
UnauthorizedResponse:
245+
content:
246+
application/json:
247+
example:
248+
type: /errors/unauthorized-request
249+
title: No valid authentication credentials for the operation
250+
status: 401
251+
detail: ""
252+
instance: /v1/namespaces
253+
schema:
254+
$ref: '#/components/schemas/ErrorModel'
255+
description: Unauthorized. The request lacks valid authentication credentials
256+
for the operation.
234257
ForbiddenResponse:
235258
content:
236259
application/json:

java/lance-catalog-apache-client/docs/NamespaceApi.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ No authorization required
7575
|-------------|-------------|------------------|
7676
| **200** | Represents a successful call to create a namespace. Returns the namespace created, as well as any properties that were stored for the namespace, including those the server might have added. Implementations are not required to support namespace properties. | - |
7777
| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - |
78+
| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - |
7879
| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - |
7980
| **406** | Not Acceptable / Unsupported Operation. The server does not support this operation. | - |
8081
| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - |
@@ -143,6 +144,7 @@ No authorization required
143144
|-------------|-------------|------------------|
144145
| **204** | Success, no content | - |
145146
| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - |
147+
| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - |
146148
| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - |
147149
| **404** | A server-side problem that means can not find the specified resource. | - |
148150
| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - |
@@ -214,6 +216,7 @@ No authorization required
214216
|-------------|-------------|------------------|
215217
| **200** | Returns a namespace, as well as any properties stored on the namespace if namespace properties are supported by the server. | - |
216218
| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - |
219+
| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - |
217220
| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - |
218221
| **404** | A server-side problem that means can not find the specified resource. | - |
219222
| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - |
@@ -279,6 +282,7 @@ No authorization required
279282
|-------------|-------------|------------------|
280283
| **200** | A list of namespaces | - |
281284
| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - |
285+
| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - |
282286
| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - |
283287
| **406** | Not Acceptable / Unsupported Operation. The server does not support this operation. | - |
284288
| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - |
@@ -349,6 +353,7 @@ No authorization required
349353
|-------------|-------------|------------------|
350354
| **200** | Success, no content | - |
351355
| **400** | Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure, such as invalid json. Usually serves application/json content, although in some cases simple text/plain content might be returned by the server's middleware. | - |
356+
| **401** | Unauthorized. The request lacks valid authentication credentials for the operation. | - |
352357
| **403** | Forbidden. Authenticated user does not have the necessary permissions. | - |
353358
| **404** | A server-side problem that means can not find the specified resource. | - |
354359
| **503** | The service is not ready to handle the request. The client should wait and retry. The service may additionally send a Retry-After header to indicate when to retry. | - |

0 commit comments

Comments
 (0)