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

View In Hierarchy

Represent the security-related configuration for HTTP.

Method __addHostToAllowedHosts Add a host to the list if it is missing.
Method __extractHostFromUrl Extract the hostname from a URL-like value.
Method __isLocalHost Return whether the host is local-only.
Method __post_init__ Validate security-related fields.
Method __validateAllowedHosts Validate the allowed_hosts field.
Instance Variable allowed_hosts List of allowed host names or '*' to allow all hosts.

Inherited from BaseEntity:

Class Method _cachedFieldMetadata Retrieve field definitions and normalized types cached by class.
Method getFields Describe field names, normalized types, defaults, and metadata.
Method toDict Convert the dataclass instance to a recursively copied dictionary.
Class Variable __slots__ Undocumented
def __addHostToAllowedHosts(self, hosts: list[str], host: str): (source)

Add a host to the list if it is missing.

Parameters
hosts:list[str]Current allowed hosts list.
host:strHost to add.
Returns
NoneUndocumented
def __extractHostFromUrl(self, url: str) -> str: (source)

Extract the hostname from a URL-like value.

Parameters
url:strURL or host string.
Returns
strNormalized hostname, or an empty string if it cannot be parsed.
def __isLocalHost(self, host: str) -> bool: (source)

Return whether the host is local-only.

Parameters
host:strHost to evaluate.
Returns
boolTrue when the host should not be added automatically.
def __post_init__(self): (source)

Validate security-related fields.

Returns
NoneUndocumented
Raises
TypeErrorIf any field has an unexpected type.
def __validateAllowedHosts(self): (source)

Validate the allowed_hosts field.

Returns
NoneUndocumented
Raises
TypeErrorIf the value is not a list of strings or the literal '*'.
allowed_hosts: list[str] | Literal["*"] = (source)

List of allowed host names or '*' to allow all hosts.