Some checks failed
Test execution / Test-all (push) Failing after 1m12s
Verify that incoming paths exist when a collection is created a token has write-access to the collection. Checks that incoming-label is set for the token. Add tests for incoming path validation.
67 lines
1.4 KiB
Python
67 lines
1.4 KiB
Python
from enum import Enum
|
|
from typing import (
|
|
Any,
|
|
Union,
|
|
)
|
|
|
|
from starlette.status import (
|
|
HTTP_200_OK,
|
|
HTTP_201_CREATED,
|
|
HTTP_300_MULTIPLE_CHOICES,
|
|
HTTP_400_BAD_REQUEST,
|
|
HTTP_401_UNAUTHORIZED,
|
|
HTTP_403_FORBIDDEN,
|
|
HTTP_404_NOT_FOUND,
|
|
HTTP_406_NOT_ACCEPTABLE,
|
|
HTTP_409_CONFLICT,
|
|
HTTP_500_INTERNAL_SERVER_ERROR,
|
|
HTTP_503_SERVICE_UNAVAILABLE,
|
|
)
|
|
from starlette.status import (
|
|
HTTP_413_REQUEST_ENTITY_TOO_LARGE as HTTP_413_CONTENT_TOO_LARGE,
|
|
)
|
|
from starlette.status import (
|
|
HTTP_422_UNPROCESSABLE_ENTITY as HTTP_422_UNPROCESSABLE_CONTENT,
|
|
)
|
|
|
|
__all__ = [
|
|
'Format',
|
|
'HTTP_200_OK',
|
|
'HTTP_201_CREATED',
|
|
'HTTP_300_MULTIPLE_CHOICES',
|
|
'HTTP_400_BAD_REQUEST',
|
|
'HTTP_401_UNAUTHORIZED',
|
|
'HTTP_403_FORBIDDEN',
|
|
'HTTP_404_NOT_FOUND',
|
|
'HTTP_406_NOT_ACCEPTABLE',
|
|
'HTTP_409_CONFLICT',
|
|
'HTTP_413_CONTENT_TOO_LARGE',
|
|
'HTTP_422_UNPROCESSABLE_CONTENT',
|
|
'HTTP_500_INTERNAL_SERVER_ERROR',
|
|
'HTTP_503_SERVICE_UNAVAILABLE',
|
|
'JSON',
|
|
'YAML',
|
|
'config_file_name',
|
|
'reserved_collection_names',
|
|
]
|
|
|
|
|
|
class Format(str, Enum):
|
|
json = 'json'
|
|
ttl = 'ttl'
|
|
|
|
|
|
JSON = Union[dict[str, Any], list[Any], str, int, float, None]
|
|
YAML = JSON
|
|
|
|
config_file_name = '.dumpthings.yaml'
|
|
|
|
dump_things_private_collection_name = '__dump_things__'
|
|
|
|
|
|
reserved_collection_names = (
|
|
'collections',
|
|
'tokens',
|
|
'admin_tokens',
|
|
dump_things_private_collection_name,
|
|
)
|