ORIONIS API REFERENCE

THE ORIONIS API

Build with clarity.

Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.

class documentation

class IHttpEndpointPolicy(ABC): (source)

Known subclasses: orionis.mcp.transport.policy.McpHttpPolicy

View In Hierarchy

Customize endpoint framing without replacing routing or middleware.

Method before Validate protocol connection metadata before admission and middleware.
Async Method exception Report a failure and provide the endpoint's sanitized response.
Method isExpectedFailure Classify a protocol rejection before global failure observation.
Async Method response Adapt middleware and handler responses to the endpoint's wire format.
Class Variable __slots__ Declare that this class introduces no additional instance slots.
Class Variable monitor_disconnects Monitor disconnects flag used by IHttpEndpointPolicy.
def before(self, adapter: TransportAdapter) -> Response | None: (source)

Validate protocol connection metadata before admission and middleware.

Parameters
adapter:orionis.http.adapters.request.contracts.transport.TransportAdapterValue supplied for adapter.
Returns
orionis.http.Response | NoneResult of the operation described above.
async def exception(self, exception: Exception, request: Request | TransportAdapter) -> Response: (source)

Report a failure and provide the endpoint's sanitized response.

Parameters
exception:ExceptionException being inspected or reported.
request:Request | TransportAdapterCurrent request and its trusted execution context.
Returns
orionis.http.ResponseResult of the operation described above.
def isExpectedFailure(self, exception: Exception) -> bool: (source)

Classify a protocol rejection before global failure observation.

Parameters
exception:ExceptionOriginal exception that the endpoint will translate.
Returns
boolFalse unless the policy recognizes an expected client failure.
async def response(self, response: Response) -> Response: (source)

Adapt middleware and handler responses to the endpoint's wire format.

Parameters
response:orionis.http.ResponseValue supplied for response.
Returns
orionis.http.ResponseResult of the operation described above.
__slots__: tuple = (source)

Declare that this class introduces no additional instance slots.

monitor_disconnects: ClassVar[bool] = (source)

Monitor disconnects flag used by IHttpEndpointPolicy.