Exemple #1
0
async def etcd_proxy():
    """Fixture returning a configured TraefikEtcdProxy"""
    proxy = TraefikEtcdProxy(
        public_url="http://127.0.0.1:8000",
        traefik_api_password="******",
        traefik_api_username="******",
    )
    await proxy.start()
    yield proxy
    await proxy.stop()
def external_etcd_proxy():
    proxy = TraefikEtcdProxy(
        public_url="http://127.0.0.1:8000",
        traefik_api_password="******",
        traefik_api_username="******",
        should_start=False,
    )
    traefik_process = configure_and_launch_traefik(kv_store="etcd")
    yield proxy

    traefik_process.kill()
    traefik_process.wait()
Exemple #3
0
async def no_auth_etcd_proxy():
    """
    Function returning a configured TraefikEtcdProxy.
    No etcd authentication.
    """
    proxy = TraefikEtcdProxy(
        public_url="http://127.0.0.1:8000",
        traefik_api_password="******",
        traefik_api_username="******",
        should_start=True,
    )
    await proxy.start()
    return proxy
async def no_auth_etcd_proxy():
    """
    Fixture returning a configured TraefikEtcdProxy.
    No etcd authentication.
    """
    proxy = TraefikEtcdProxy(
        public_url="http://127.0.0.1:8000",
        traefik_api_password="******",
        traefik_api_username="******",
        check_route_timeout=45,
        should_start=True,
    )
    await proxy.start()
    yield proxy
    await proxy.stop()
def auth_external_etcd_proxy():
    enable_auth_in_etcd("secret")
    proxy = TraefikEtcdProxy(
        public_url="http://127.0.0.1:8000",
        traefik_api_password="******",
        traefik_api_username="******",
        kv_password="******",
        kv_username="******",
        should_start=False,
    )
    traefik_process = configure_and_launch_traefik(kv_store="etcd",
                                                   password="******")
    yield proxy

    traefik_process.kill()
    traefik_process.wait()
    disable_auth_in_etcd("secret")
async def auth_etcd_proxy(etcd):
    """
    Fixture returning a configured TraefikEtcdProxy
    Etcd has credentials set up
    """
    enable_auth_in_etcd("secret")
    proxy = TraefikEtcdProxy(
        public_url="http://127.0.0.1:8000",
        traefik_api_password="******",
        traefik_api_username="******",
        kv_password="******",
        kv_username="******",
        should_start=True,
    )
    await proxy.start()
    yield proxy
    await proxy.stop()
    disable_auth_in_etcd("secret")