-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathmodels.py
More file actions
40 lines (29 loc) · 1.17 KB
/
models.py
File metadata and controls
40 lines (29 loc) · 1.17 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
import logging
from typing import Dict, List, TypedDict, Union
LOG = logging.getLogger(__name__)
class ProxyServiceConfig(TypedDict, total=False):
# list of regexes identifying resources to be proxied requests to
resources: Union[str, List[str]]
# list of operation names (regexes) that should be proxied
operations: List[str]
# whether only read requests should be forwarded
read_only: bool
# whether invoke/execute operations (e.g., Lambda invocations) should be forwarded
# (only relevant when read_only is True, since execute has side-effects and is not a read operation)
execute: bool
class ProxyConfig(TypedDict, total=False):
# maps service name to service proxy configs
services: Dict[str, ProxyServiceConfig]
# bind host for the proxy (defaults to 127.0.0.1)
bind_host: str
class ProxyInstance(TypedDict):
"""Represents a proxy instance"""
# port of the proxy on the host
port: int
# configuration for the proxy
config: ProxyConfig
class AddProxyRequest(ProxyInstance):
"""
Represents a request to register a new local proxy instance with the extension inside LocalStack.
"""
env_vars: dict