maleo-enums 0.0.13__tar.gz → 0.0.17__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {maleo_enums-0.0.13 → maleo_enums-0.0.17}/PKG-INFO +1 -1
- {maleo_enums-0.0.13 → maleo_enums-0.0.17}/maleo_enums.egg-info/PKG-INFO +1 -1
- {maleo_enums-0.0.13 → maleo_enums-0.0.17}/maleo_enums.egg-info/SOURCES.txt +1 -1
- {maleo_enums-0.0.13 → maleo_enums-0.0.17}/pyproject.toml +1 -1
- maleo_enums-0.0.17/src/connection.py +149 -0
- maleo_enums-0.0.13/src/request.py +0 -74
- {maleo_enums-0.0.13 → maleo_enums-0.0.17}/LICENSE +0 -0
- {maleo_enums-0.0.13 → maleo_enums-0.0.17}/README.md +0 -0
- {maleo_enums-0.0.13 → maleo_enums-0.0.17}/maleo_enums.egg-info/dependency_links.txt +0 -0
- {maleo_enums-0.0.13 → maleo_enums-0.0.17}/maleo_enums.egg-info/requires.txt +0 -0
- {maleo_enums-0.0.13 → maleo_enums-0.0.17}/maleo_enums.egg-info/top_level.txt +0 -0
- {maleo_enums-0.0.13 → maleo_enums-0.0.17}/setup.cfg +0 -0
- {maleo_enums-0.0.13 → maleo_enums-0.0.17}/src/__init__.py +0 -0
- {maleo_enums-0.0.13 → maleo_enums-0.0.17}/src/cardinality.py +0 -0
- {maleo_enums-0.0.13 → maleo_enums-0.0.17}/src/environment.py +0 -0
- {maleo_enums-0.0.13 → maleo_enums-0.0.17}/src/expiration.py +0 -0
- {maleo_enums-0.0.13 → maleo_enums-0.0.17}/src/order.py +0 -0
- {maleo_enums-0.0.13 → maleo_enums-0.0.17}/src/service.py +0 -0
- {maleo_enums-0.0.13 → maleo_enums-0.0.17}/src/status.py +0 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
from enum import StrEnum
|
|
2
|
+
from typing import List, Optional, Sequence, TypeVar, Union
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Scheme(StrEnum):
|
|
6
|
+
HTTP = "http"
|
|
7
|
+
HTTPS = "https"
|
|
8
|
+
WS = "ws"
|
|
9
|
+
WSS = "wss"
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
SchemeT = TypeVar("SchemeT", bound=Scheme)
|
|
13
|
+
OptionalScheme = Optional[Scheme]
|
|
14
|
+
OptionalSchemeT = TypeVar("OptionalSchemeT", bound=OptionalScheme)
|
|
15
|
+
ListOfSchemes = List[Scheme]
|
|
16
|
+
OptionalListOfSchemes = Optional[ListOfSchemes]
|
|
17
|
+
SequenceOfSchemes = Sequence[Scheme]
|
|
18
|
+
OptionalSequenceOfSchemes = Optional[SequenceOfSchemes]
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class Protocol(StrEnum):
|
|
22
|
+
HTTP = "http"
|
|
23
|
+
WEBSOCKET = "websocket"
|
|
24
|
+
|
|
25
|
+
@classmethod
|
|
26
|
+
def from_scheme(cls, scheme: Union[Scheme, str]) -> "Protocol":
|
|
27
|
+
# Normalize to Scheme if it's a string
|
|
28
|
+
if isinstance(scheme, str):
|
|
29
|
+
try:
|
|
30
|
+
scheme = Scheme(scheme)
|
|
31
|
+
except ValueError:
|
|
32
|
+
raise ValueError(f"Unknown scheme: {scheme}")
|
|
33
|
+
|
|
34
|
+
if scheme in (Scheme.HTTP, Scheme.HTTPS):
|
|
35
|
+
return cls.HTTP
|
|
36
|
+
elif scheme in (Scheme.WS, Scheme.WSS):
|
|
37
|
+
return cls.WEBSOCKET
|
|
38
|
+
raise ValueError(f"Unknown scheme: {scheme}")
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class Method(StrEnum):
|
|
42
|
+
GET = "GET"
|
|
43
|
+
POST = "POST"
|
|
44
|
+
PATCH = "PATCH"
|
|
45
|
+
PUT = "PUT"
|
|
46
|
+
DELETE = "DELETE"
|
|
47
|
+
OPTIONS = "OPTIONS"
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
MethodT = TypeVar("MethodT", bound=Method)
|
|
51
|
+
OptionalMethod = Optional[Method]
|
|
52
|
+
OptionalMethodT = TypeVar("OptionalMethodT", bound=OptionalMethod)
|
|
53
|
+
ListOfMethods = List[Method]
|
|
54
|
+
OptionalListOfMethods = Optional[ListOfMethods]
|
|
55
|
+
SequenceOfMethods = Sequence[Method]
|
|
56
|
+
OptionalSequenceOfMethods = Optional[SequenceOfMethods]
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class Header(StrEnum):
|
|
60
|
+
# --- Authentication & Authorization ---
|
|
61
|
+
AUTHORIZATION = "authorization"
|
|
62
|
+
PROXY_AUTHORIZATION = "proxy-authorization"
|
|
63
|
+
WWW_AUTHENTICATE = "www-authenticate"
|
|
64
|
+
|
|
65
|
+
# --- Content & Caching ---
|
|
66
|
+
CACHE_CONTROL = "cache-control"
|
|
67
|
+
CONTENT_DISPOSITION = "content-disposition"
|
|
68
|
+
CONTENT_ENCODING = "content-encoding"
|
|
69
|
+
CONTENT_LENGTH = "content-length"
|
|
70
|
+
CONTENT_TYPE = "content-type"
|
|
71
|
+
ETAG = "etag"
|
|
72
|
+
LAST_MODIFIED = "last-modified"
|
|
73
|
+
EXPIRES = "expires"
|
|
74
|
+
VARY = "vary"
|
|
75
|
+
|
|
76
|
+
# --- Client & Request Context ---
|
|
77
|
+
ACCEPT = "accept"
|
|
78
|
+
ACCEPT_ENCODING = "accept-encoding"
|
|
79
|
+
ACCEPT_LANGUAGE = "accept-language"
|
|
80
|
+
ACCEPT_CHARSET = "accept-charset"
|
|
81
|
+
HOST = "host"
|
|
82
|
+
ORIGIN = "origin"
|
|
83
|
+
REFERER = "referer"
|
|
84
|
+
USER_AGENT = "user-agent"
|
|
85
|
+
|
|
86
|
+
# --- Range / Conditional Requests ---
|
|
87
|
+
RANGE = "range"
|
|
88
|
+
CONTENT_RANGE = "content-range"
|
|
89
|
+
IF_MATCH = "if-match"
|
|
90
|
+
IF_NONE_MATCH = "if-none-match"
|
|
91
|
+
IF_MODIFIED_SINCE = "if-modified-since"
|
|
92
|
+
IF_UNMODIFIED_SINCE = "if-unmodified-since"
|
|
93
|
+
|
|
94
|
+
# --- Correlation / Observability ---
|
|
95
|
+
X_COMPLETED_AT = "x-completed-at"
|
|
96
|
+
X_CONNECTION_ID = "x-connection-id"
|
|
97
|
+
X_DURATION = "x-duration"
|
|
98
|
+
X_EXECUTED_AT = "x-executed-at"
|
|
99
|
+
X_OPERATION_ID = "x-operation-id"
|
|
100
|
+
X_TRACE_ID = "x-trace-id"
|
|
101
|
+
X_SPAN_ID = "x-span-id"
|
|
102
|
+
|
|
103
|
+
# --- Organization / User Context ---
|
|
104
|
+
X_ORGANIZATION_ID = "x-organization-id"
|
|
105
|
+
X_USER_ID = "x-user-id"
|
|
106
|
+
|
|
107
|
+
# --- API Keys / Clients ---
|
|
108
|
+
X_API_KEY = "x-api-key"
|
|
109
|
+
X_CLIENT_ID = "x-client-id"
|
|
110
|
+
X_CLIENT_SECRET = "x-client-secret"
|
|
111
|
+
X_SIGNATURE = "x-signature"
|
|
112
|
+
|
|
113
|
+
# --- Cookies & Sessions ---
|
|
114
|
+
COOKIE = "cookie"
|
|
115
|
+
SET_COOKIE = "set-cookie"
|
|
116
|
+
|
|
117
|
+
# --- Redirects & Responses ---
|
|
118
|
+
LOCATION = "location"
|
|
119
|
+
ALLOW = "allow"
|
|
120
|
+
RETRY_AFTER = "retry-after"
|
|
121
|
+
LINK = "link"
|
|
122
|
+
|
|
123
|
+
# --- Proxy / Networking ---
|
|
124
|
+
FORWARDED = "forwarded"
|
|
125
|
+
X_FORWARDED_FOR = "x-forwarded-for"
|
|
126
|
+
X_FORWARDED_PROTO = "x-forwarded-proto"
|
|
127
|
+
X_FORWARDED_HOST = "x-forwarded-host"
|
|
128
|
+
X_FORWARDED_PORT = "x-forwarded-port"
|
|
129
|
+
X_REAL_IP = "x-real-ip"
|
|
130
|
+
|
|
131
|
+
# --- Security ---
|
|
132
|
+
STRICT_TRANSPORT_SECURITY = "strict-transport-security"
|
|
133
|
+
CONTENT_SECURITY_POLICY = "content-security-policy"
|
|
134
|
+
X_FRAME_OPTIONS = "x-frame-options"
|
|
135
|
+
X_CONTENT_TYPE_OPTIONS = "x-content-type-options"
|
|
136
|
+
REFERRER_POLICY = "referrer-policy"
|
|
137
|
+
PERMISSIONS_POLICY = "permissions-policy"
|
|
138
|
+
|
|
139
|
+
# --- Experimental / Misc ---
|
|
140
|
+
X_NEW_AUTHORIZATION = "x-new-authorization"
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
HeaderT = TypeVar("HeaderT", bound=Header)
|
|
144
|
+
OptionalHeader = Optional[Header]
|
|
145
|
+
OptionalHeaderT = TypeVar("OptionalHeaderT", bound=OptionalHeader)
|
|
146
|
+
ListOfHeaders = List[Header]
|
|
147
|
+
OptionalListOfHeaders = Optional[ListOfHeaders]
|
|
148
|
+
SequenceOfHeaders = Sequence[Header]
|
|
149
|
+
OptionalSequenceOfHeaders = Optional[SequenceOfHeaders]
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
from enum import StrEnum
|
|
2
|
-
from typing import List, Optional, Sequence
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class Method(StrEnum):
|
|
6
|
-
GET = "GET"
|
|
7
|
-
POST = "POST"
|
|
8
|
-
PATCH = "PATCH"
|
|
9
|
-
PUT = "PUT"
|
|
10
|
-
DELETE = "DELETE"
|
|
11
|
-
OPTIONS = "OPTIONS"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
OptionalMethod = Optional[Method]
|
|
15
|
-
ListOfMethods = List[Method]
|
|
16
|
-
OptionalListOfMethods = Optional[ListOfMethods]
|
|
17
|
-
SequenceOfMethods = Sequence[Method]
|
|
18
|
-
OptionalSequenceOfMethods = Optional[SequenceOfMethods]
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class Header(StrEnum):
|
|
22
|
-
# --- Authentication & Authorization ---
|
|
23
|
-
AUTHORIZATION = "authorization"
|
|
24
|
-
PROXY_AUTHORIZATION = "proxy-authorization"
|
|
25
|
-
WWW_AUTHENTICATE = "www-authenticate"
|
|
26
|
-
|
|
27
|
-
# --- Content & Caching ---
|
|
28
|
-
CACHE_CONTROL = "cache-control"
|
|
29
|
-
CONTENT_DISPOSITION = "content-disposition"
|
|
30
|
-
CONTENT_ENCODING = "content-encoding"
|
|
31
|
-
CONTENT_LENGTH = "content-length"
|
|
32
|
-
CONTENT_TYPE = "content-type"
|
|
33
|
-
ETAG = "etag"
|
|
34
|
-
LAST_MODIFIED = "last-modified"
|
|
35
|
-
|
|
36
|
-
# --- Client & Request Context ---
|
|
37
|
-
ACCEPT = "accept"
|
|
38
|
-
ACCEPT_ENCODING = "accept-encoding"
|
|
39
|
-
ACCEPT_LANGUAGE = "accept-language"
|
|
40
|
-
HOST = "host"
|
|
41
|
-
ORIGIN = "origin"
|
|
42
|
-
REFERER = "referer"
|
|
43
|
-
USER_AGENT = "user-agent"
|
|
44
|
-
|
|
45
|
-
# --- Correlation / Observability ---
|
|
46
|
-
X_OPERATION_ID = "x-operation-id"
|
|
47
|
-
X_PROCESS_TIME = "x-process-time"
|
|
48
|
-
X_REQUEST_ID = "x-request-id"
|
|
49
|
-
X_REQUESTED_AT = "x-requested-at"
|
|
50
|
-
X_RESPONDED_AT = "x-responded-at"
|
|
51
|
-
X_TRACE_ID = "x-trace-id"
|
|
52
|
-
X_SPAN_ID = "x-span-id"
|
|
53
|
-
|
|
54
|
-
# --- Organization / User Context ---
|
|
55
|
-
X_ORGANIZATION_ID = "x-organization-id"
|
|
56
|
-
X_USER_ID = "x-user-id"
|
|
57
|
-
|
|
58
|
-
# --- API Keys / Clients ---
|
|
59
|
-
X_API_KEY = "x-api-key"
|
|
60
|
-
X_CLIENT_ID = "x-client-id"
|
|
61
|
-
X_CLIENT_SECRET = "x-client-secret"
|
|
62
|
-
X_SIGNATURE = "x-signature"
|
|
63
|
-
|
|
64
|
-
# --- Experimental / Misc ---
|
|
65
|
-
X_FORWARDED_FOR = "x-forwarded-for"
|
|
66
|
-
X_NEW_AUTHORIZATION = "x-new-authorization"
|
|
67
|
-
X_REAL_IP = "x-real-ip"
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
OptionalHeader = Optional[Header]
|
|
71
|
-
ListOfHeaders = List[Header]
|
|
72
|
-
OptionalListOfHeaders = Optional[ListOfHeaders]
|
|
73
|
-
SequenceOfHeaders = Sequence[Header]
|
|
74
|
-
OptionalSequenceOfHeaders = Optional[SequenceOfHeaders]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|