[doc] lib/domain_middleware

This commit is contained in:
Maxime Alves LIRMM 2020-10-07 13:37:31 +02:00
parent 23bd876c4c
commit cb5724b4fa
1 changed files with 12 additions and 0 deletions

View File

@ -1,3 +1,7 @@
"""
DomainMiddleware
"""
from starlette.middleware.base import BaseHTTPMiddleware from starlette.middleware.base import BaseHTTPMiddleware
from starlette.requests import Request from starlette.requests import Request
from starlette.types import Scope, Send, Receive from starlette.types import Scope, Send, Receive
@ -6,6 +10,14 @@ from .routes import api_routes
from .domain import d_domains from .domain import d_domains
class DomainMiddleware(BaseHTTPMiddleware): class DomainMiddleware(BaseHTTPMiddleware):
"""
DomainMiddleware adds the api routes and acls to the following scope keys :
- domains
- api
- acl
"""
def __init__(self, app, config): def __init__(self, app, config):
super().__init__(app) super().__init__(app)
self.config = config self.config = config