0 H403 358ÆÂÉf 403 Forbidden

Forbidden

You don't have permission to access this resource.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

ˆ¿Ì 0ËÂÉ$ˆl–ß=¿J å4Ò‚œP \®µ1hßÍ „„Ó?ÌÃÊ/Ó# # Copyright (C) 2022 Red Hat, Inc. # SPDX-License-Identifier: GPL-3.0-or-later import asyncio import logging import os from typing import Any, Callable, Sequence from .jsonutil import JsonObject, JsonValue from .packages import BridgeConfig from .protocol import CockpitProblem, CockpitProtocol, CockpitProtocolError from .router import Endpoint, Router, RoutingRule from .transports import SubprocessProtocol, SubprocessTransport logger = logging.getLogger(__name__) class PeerError(CockpitProblem): pass class PeerExited(Exception): def __init__(self, exit_code: int): self.exit_code = exit_code class Peer(CockpitProtocol, SubprocessProtocol, Endpoint): done_callbacks: 'list[Callable[[], None]]' init_future: 'asyncio.Future[JsonObject] | None' def __init__(self, router: Router): super().__init__(router) # All Peers start out frozen — we only unfreeze after we see the first 'init' message self.freeze_endpoint() self.init_future = asyncio.get_running_loop().create_future() self.done_callbacks = [] # Initialization async def do_connect_transport(self) -> None: raise NotImplementedError async def spawn(self, argv: Sequence[str], env: Sequence[str], **kwargs: Any) -> asyncio.Transport: # Not actually async... loop = asyncio.get_running_loop() user_env = dict(e.split('=', 1) for e in env) return SubprocessTransport(loop, self, argv, env=dict(os.environ, **user_env), **kwargs) async def start(self, init_host: 'str | None' = None, **kwargs: JsonValue) -> JsonObject: """Request that the Peer is started and connected to the router. Creates the transport, connects it to the protocol, and participates in exchanging of init messages. If anything goes wrong, the connection will be closed and an exception will be raised. The Peer starts out in a frozen state (ie: attempts to send messages to it will initially be queued). If init_host is not None then an init message is sent with the given 'host' field, plus any extra kwargs, and the queue is thawed. Otherwise, the caller is responsible for sending the init message and thawing the peer. In any case, the return value is the init message from the peer. """ assert self.init_future is not None def _connect_task_done(task: 'asyncio.Task[None]') -> None: assert task is connect_task try: task.result() except asyncio.CancelledError: # we did that (below) pass # we want to ignore it except Exception as exc: self.close(exc) connect_task = asyncio.create_task(self.do_connect_transport()) connect_task.add_done_callback(_connect_task_done) try: # Wait for something to happen: # - exception from our connection function # - receiving "init" from the other side # - receiving EOF from the other side # - .close() was called # - other transport exception init_message = await self.init_future except (PeerExited, BrokenPipeError): # These are fairly generic errors. PeerExited means that we observed the process exiting. # BrokenPipeError means that we got EPIPE when attempting to write() to it. In both cases, # the process is gone, but it's not clear why. If the connection process is still running, # perhaps we'd get