Source code for harp_apps.proxy.settings
from typing import Optional
from harp.config.settings.base import BaseSetting, settings_dataclass
[docs]
@settings_dataclass
class ProxyEndpointSetting(BaseSetting):
name: str
port: int
url: str
description: Optional[str] = None
[docs]
@settings_dataclass
class ProxySettings(BaseSetting):
endpoints: Optional[list[ProxyEndpointSetting]]
def __post_init__(self):
if self.endpoints is None:
self.endpoints = []
self.endpoints = [
endpoint if isinstance(endpoint, ProxyEndpointSetting) else ProxyEndpointSetting(**endpoint)
for endpoint in self.endpoints
]