-
Notifications
You must be signed in to change notification settings - Fork 285
Expand file tree
/
Copy path__init__.py
More file actions
47 lines (43 loc) · 1.41 KB
/
__init__.py
File metadata and controls
47 lines (43 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
"""A middleware processes request data and calls `next()` method
if the execution chain should continue running the following middleware.
Middleware can be used globally before all listener executions.
It's also possible to run a middleware only for a particular listener.
"""
# Don't add async module imports here
from .authorization import (
SingleTeamAuthorization,
MultiTeamsAuthorization,
)
from .custom_middleware import CustomMiddleware
from .ignoring_self_events import IgnoringSelfEvents
from .middleware import Middleware
from .request_verification import RequestVerification
from .ssl_check import SslCheck
from .url_verification import UrlVerification
from .attaching_function_token import AttachingFunctionToken
from .attaching_agent_kwargs import AttachingAgentKwargs
builtin_middleware_classes = [
SslCheck,
RequestVerification,
SingleTeamAuthorization,
MultiTeamsAuthorization,
IgnoringSelfEvents,
UrlVerification,
AttachingFunctionToken,
# Assistant, # to avoid circular imports
]
for cls in builtin_middleware_classes:
Middleware.register(cls) # type: ignore[arg-type]
__all__ = [
"SingleTeamAuthorization",
"MultiTeamsAuthorization",
"CustomMiddleware",
"IgnoringSelfEvents",
"Middleware",
"RequestVerification",
"SslCheck",
"UrlVerification",
"AttachingFunctionToken",
"AttachingAgentKwargs",
"builtin_middleware_classes",
]