Source code for harp_apps.proxy.settings

from functools import cached_property

from harp.config import ApplicationSettingsMixin, Configurable, Stateful

from .endpoint import Endpoint, EndpointSettings
from .remote import Remote, RemoteEndpoint, RemoteEndpointSettings, RemoteProbe, RemoteProbeSettings, RemoteSettings

__all__ = [
    "Endpoint",
    "EndpointSettings",
    "Proxy",
    "ProxySettings",
    "Remote",
    "RemoteEndpoint",
    "RemoteEndpointSettings",
    "RemoteProbe",
    "RemoteProbeSettings",
    "RemoteSettings",
]


class BaseProxySettings(Configurable):
    pass


[docs] class ProxySettings(ApplicationSettingsMixin, BaseProxySettings): """ Configuration parser for ``proxy`` settings. .. code-block:: yaml endpoints: # see ProxyEndpoint - ... """ endpoints: list[EndpointSettings] = []
[docs] class Proxy(Stateful[ProxySettings]):
[docs] @cached_property def endpoints(self) -> list[Endpoint]: return [Endpoint(settings=settings) for settings in self.settings.endpoints]