| 1 |
import uuid |
| 2 |
from collections import namedtuple |
| 3 |
|
| 4 |
_ErrorData = namedtuple("_ErrorData", ("error_id", "json", "metadata_include")) |
| 5 |
|
| 6 |
_error_id = str(uuid.uuid1()) |
| 7 |
UNAUTHORIZED_AUTH_RESPONSE = _ErrorData( |
| 8 |
_error_id, |
| 9 |
{ |
| 10 |
"errors": [ |
| 11 |
{ |
| 12 |
"status": "401", |
| 13 |
"id": _error_id, |
| 14 |
"code": "UNAUTHORIZED", |
| 15 |
"detail": "Call must be authenticated", |
| 16 |
"title": "Unauthorized", |
| 17 |
} |
| 18 |
], |
| 19 |
"error_description": "Unauthorized", |
| 20 |
"error": "unauthorized", |
| 21 |
}, |
| 22 |
{ |
| 23 |
"http_status": 401, |
| 24 |
"code": "UNAUTHORIZED", |
| 25 |
"message": "Call must be authenticated", |
| 26 |
}, |
| 27 |
) |
| 28 |
|
| 29 |
_error_id = str(uuid.uuid1()) |
| 30 |
FORBIDDEN_AUTH_RESPONSE = _ErrorData( |
| 31 |
_error_id, |
| 32 |
{ |
| 33 |
"errors": [ |
| 34 |
{ |
| 35 |
"status": "403", |
| 36 |
"id": _error_id, |
| 37 |
"code": "FORBIDDEN", |
| 38 |
"detail": "Call must be authenticated", |
| 39 |
"title": "Unauthorized", |
| 40 |
} |
| 41 |
], |
| 42 |
"error_description": "Unauthorized", |
| 43 |
"error": "unauthorized", |
| 44 |
}, |
| 45 |
{ |
| 46 |
"http_status": 403, |
| 47 |
"code": "FORBIDDEN", |
| 48 |
"message": "Call must be authenticated", |
| 49 |
}, |
| 50 |
) |