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 CORSMiddleware: (source)

Constructor: CORSMiddleware(config)

View In Hierarchy

Undocumented

Method __applyCredentials Write the Access-Control-Allow-Credentials header if needed.
Method __applyOrigin Write the Access-Control-Allow-Origin (and Vary) headers.
Method __init__ Initialize the middleware with the given CORS configuration.
Method __isAllowedOrigin Validate whether an origin is allowed.
Method __isPreflight Determine whether the request is a CORS preflight.
Method __mergeVary Append a directive to the Vary header without overwriting it.
Method after Apply CORS headers to actual (non-preflight) responses.
Method before Intercept preflight requests and return an early response.
Constant ALL_METHODS Undocumented
Class Variable __slots__ Undocumented
Instance Variable __allow_all_headers Undocumented
Instance Variable __allow_all_methods Undocumented
Instance Variable __allow_all_origins Undocumented
Instance Variable __allow_credentials Undocumented
Instance Variable __allow_headers_value Undocumented
Instance Variable __allow_methods_value Undocumented
Instance Variable __allow_origins Undocumented
Instance Variable __expose_headers_value Undocumented
Instance Variable __max_age_value Undocumented
Instance Variable __origin_regex Undocumented
def __applyCredentials(self, response: Response): (source)

Write the Access-Control-Allow-Credentials header if needed.

Parameters
response:ResponseThe response object to modify.
Returns
NoneUndocumented
def __applyOrigin(self, response: Response, origin: str): (source)

Write the Access-Control-Allow-Origin (and Vary) headers.

Parameters
response:ResponseThe response object to modify.
origin:strThe Origin header value from the request.
Returns
NoneUndocumented
def __init__(self, config: dict): (source)

Initialize the middleware with the given CORS configuration.

Parameters
config:dictA dictionary whose keys must match Cors fields.
Returns
NoneUndocumented
def __isAllowedOrigin(self, origin: str) -> bool: (source)

Validate whether an origin is allowed.

Parameters
origin:strThe Origin header value from the request.
Returns
boolTrue when the origin is permitted, False otherwise.
def __isPreflight(self, method: str, headers: object) -> bool: (source)

Determine whether the request is a CORS preflight.

Parameters
method:strThe HTTP method of the incoming request.
headers:objectThe parsed request headers (supports in operator).
Returns
boolTrue for preflight requests (OPTIONS + ACRM header).
def __mergeVary(self, response: Response, value: str): (source)

Append a directive to the Vary header without overwriting it.

Parameters
response:ResponseThe response object to modify.
value:strThe directive to add (e.g. "origin").
Returns
NoneUndocumented
def after(self, adapter: TransportAdapter, response: Response) -> Response: (source)

Apply CORS headers to actual (non-preflight) responses.

Parameters
adapter:TransportAdapterUnified transport abstraction for the current request.
response:ResponseThe response produced by the application.
Returns
ResponseThe same response object, enriched with CORS headers.
def before(self, adapter: TransportAdapter) -> Response | None: (source)

Intercept preflight requests and return an early response.

Parameters
adapter:TransportAdapterUnified transport abstraction for the current request.
Returns
Response | NoneA 204 No Content preflight response, or None when the request is not a valid CORS preflight.
ALL_METHODS: str = (source)

Undocumented

Value
'DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT'
__slots__: tuple[str, ...] = (source)

Undocumented

__allow_all_headers = (source)

Undocumented

__allow_all_methods = (source)

Undocumented

__allow_all_origins = (source)

Undocumented

__allow_credentials = (source)

Undocumented

__allow_headers_value = (source)

Undocumented

__allow_methods_value = (source)

Undocumented

__allow_origins = (source)

Undocumented

__expose_headers_value = (source)

Undocumented

__max_age_value: str | None = (source)

Undocumented

__origin_regex: Pattern[str] | None = (source)

Undocumented