Structures¶
This package provides many common structures generally used in Command,
Reply or Event.
Enumerations¶
These classes are used to enumerate various items such as list of purposes, error reasons, available flags, authentication methods, etc…
- class aiostem.structures.AuthMethod[source]¶
Bases:
StrEnumKnown authentication methods on the control port..
- NULL = 'NULL'¶
No authentication is required.
- HASHEDPASSWORD = 'HASHEDPASSWORD'¶
A simple password authentication (hashed in the configuration file).
- COOKIE = 'COOKIE'¶
Provide the content of a cookie we read on the file-system.
- SAFECOOKIE = 'SAFECOOKIE'¶
Provide a proof that we know the value of the cookie on the file-system.
- class aiostem.structures.CircuitBuildFlags[source]¶
Bases:
StrEnumKnown flags when building a new circuit.
- ONEHOP_TUNNEL = 'ONEHOP_TUNNEL'¶
One-hop circuit, used for tunneled directory conns.
- IS_INTERNAL = 'IS_INTERNAL'¶
Internal circuit, not to be used for exiting streams.
- NEED_CAPACITY = 'NEED_CAPACITY'¶
This circuit must use only high-capacity nodes.
- NEED_UPTIME = 'NEED_UPTIME'¶
This circuit must use only high-uptime nodes.
- class aiostem.structures.CircuitCloseReason[source]¶
Bases:
StrEnumKnown reasons why a circuit can be closed.
- NONE = 'NONE'¶
No reason given.
- PROTOCOL = 'PROTOCOL'¶
Tor protocol violation.
- INTERNAL = 'INTERNAL'¶
Internal error.
- REQUESTED = 'REQUESTED'¶
A client sent a TRUNCATE command.
- HIBERNATING = 'HIBERNATING'¶
Not currently operating; trying to save bandwidth.
- RESOURCELIMIT = 'RESOURCELIMIT'¶
Out of memory, sockets, or circuit IDs.
- CONNECTFAILED = 'CONNECTFAILED'¶
Unable to reach relay.
- OR_IDENTITY = 'OR_IDENTITY'¶
Connected to relay, but its OR identity was not as expected.
- CHANNEL_CLOSED = 'CHANNEL_CLOSED'¶
The OR connection that was carrying this circuit died.
- FINISHED = 'FINISHED'¶
The circuit has expired for being dirty or old.
- TIMEOUT = 'TIMEOUT'¶
Circuit construction took too long.
- DESTROYED = 'DESTROYED'¶
The circuit was destroyed w/o client TRUNCATE.
- NOSUCHSERVICE = 'NOSUCHSERVICE'¶
Request for unknown hidden service.
- NOPATH = 'NOPATH'¶
Not enough nodes to make circuit.
- MEASUREMENT_EXPIRED = 'MEASUREMENT_EXPIRED'¶
As “TIMEOUT”, except that we had left the circuit open for measurement purposes.
This is to see how long it would take to finish.
- IP_NOW_REDUNDANT = 'IP_NOW_REDUNDANT'¶
Closing a circuit to an introduction point that has become redundant.
Since some other circuit opened in parallel with it has succeeded.
- class aiostem.structures.CircuitEvent[source]¶
Bases:
StrEnumList of existing circuit events.
- CANNIBALIZED = 'CANNIBALIZED'¶
Circuit cannibalized.
- PURPOSE_CHANGED = 'PURPOSE_CHANGED'¶
Circuit purpose or HS-related state changed.
- class aiostem.structures.CircuitHiddenServicePow[source]¶
Bases:
objectHidden service PoW effort attached to a circuit.
- class aiostem.structures.CircuitHiddenServiceState[source]¶
Bases:
StrEnumState of a hidden service circuit.
- HSCI_CONNECTING = 'HSCI_CONNECTING'¶
- HSCI_INTRO_SENT = 'HSCI_INTRO_SENT'¶
- HSCI_DONE = 'HSCI_DONE'¶
- HSCR_CONNECTING = 'HSCR_CONNECTING'¶
- HSCR_ESTABLISHED_IDLE = 'HSCR_ESTABLISHED_IDLE'¶
- HSCR_ESTABLISHED_WAITING = 'HSCR_ESTABLISHED_WAITING'¶
- HSCR_JOINED = 'HSCR_JOINED'¶
- HSSI_CONNECTING = 'HSSI_CONNECTING'¶
- HSSI_ESTABLISHED = 'HSSI_ESTABLISHED'¶
- HSSR_CONNECTING = 'HSSR_CONNECTING'¶
- HSSR_JOINED = 'HSSR_JOINED'¶
- class aiostem.structures.CircuitPurpose[source]¶
Bases:
StrEnumAll possible purposes for circuits.
- CIRCUIT_PADDING = 'CIRCUIT_PADDING'¶
Circuit kept open for padding.
- CONFLUX_LINKED = 'CONFLUX_LINKED'¶
Linked conflux circuit.
- CONFLUX_UNLINKED = 'CONFLUX_UNLINKED'¶
Unlinked conflux circuit.
- CONTROLLER = 'CONTROLLER'¶
Circuit made by controller.
- GENERAL = 'GENERAL'¶
General-purpose client.
- HS_CLIENT_INTRO = 'HS_CLIENT_INTRO'¶
Hidden service client, connection to an introduction point.
- HS_CLIENT_HSDIR = 'HS_CLIENT_HSDIR'¶
Hidden service client, fetching HS descriptor.
- HS_CLIENT_REND = 'HS_CLIENT_REND'¶
Hidden service client, connection to a rendezvous point.
- HS_SERVICE_INTRO = 'HS_SERVICE_INTRO'¶
Hidden service, introduction point.
- HS_SERVICE_HSDIR = 'HS_SERVICE_HSDIR'¶
Hidden service, uploading HS descriptor.
- HS_SERVICE_REND = 'HS_SERVICE_REND'¶
Hidden service, connection as a rendezvous point.
- HS_VANGUARDS = 'HS_VANGUARDS'¶
Hidden service, pre-built vanguard circuit.
- MEASURE_TIMEOUT = 'MEASURE_TIMEOUT'¶
Measuring circuit timeout.
- PATH_BIAS_TESTING = 'PATH_BIAS_TESTING'¶
Path-bias testing circuit.
- SERVER = 'SERVER'¶
A controller should never see these, actually.
- TESTING = 'TESTING'¶
Testing circuit.
- class aiostem.structures.CircuitStatus[source]¶
Bases:
StrEnumAll possible statuses for a circuit.
- LAUNCHED = 'LAUNCHED'¶
Circuit ID assigned to new circuit.
- BUILT = 'BUILT'¶
All hops finished, can now accept streams.
- GUARD_WAIT = 'GUARD_WAIT'¶
All hops finished, waiting to see if a circuit with a better guard will be usable.
- EXTENDED = 'EXTENDED'¶
One more hop has been completed.
- FAILED = 'FAILED'¶
Circuit closed (was not built).
- CLOSED = 'CLOSED'¶
Circuit closed (was built).
- class aiostem.structures.DescriptorPurpose[source]¶
Bases:
StrEnumAll possible purposes for a descriptor.
- CONTROLLER = 'controller'¶
- GENERAL = 'general'¶
- BRIDGE = 'bridge'¶
- class aiostem.structures.Feature[source]¶
Bases:
StrEnumAll known features Tor supports.
- EXTENDED_EVENTS = 'EXTENDED_EVENTS'¶
Ask for extended information while receiving events.
- class aiostem.structures.GuardEventStatus[source]¶
Bases:
StrEnumPossible statuses for a
GUARDevent.- NEW = 'NEW'¶
This node was not previously used as a guard.
Now we have picked it as one.
- DROPPED = 'DROPPED'¶
This node is one we previously picked as a guard.
We no longer consider it to be a member of our guard list.
- UP = 'UP'¶
The guard now seems to be reachable.
- DOWN = 'DOWN'¶
The guard now seems to be unreachable.
- BAD = 'BAD'¶
This node is now unusable as a guard.
Because of flags set in the consensus and/or values in the configuration.
- BAD_L2 = 'BAD_L2'¶
This node is removed from the layer2 guard set.
This layer2 guard has expired or got removed from the consensus.
- GOOD = 'GOOD'¶
This node is now usable as a guard.
Because of flags set in the consensus and/or values in the configuration.
- class aiostem.structures.LivenessStatus[source]¶
Bases:
StrEnumPossible values for
EventNetworkLiveness.status.- DOWN = 'DOWN'¶
Network or service is down.
- UP = 'UP'¶
Network or service is up and running.
- class aiostem.structures.LogSeverity[source]¶
Bases:
StrEnumPossible severities for all kind of log events.
- DEBUG = 'DEBUG'¶
- INFO = 'INFO'¶
- NOTICE = 'NOTICE'¶
- WARNING = 'WARN'¶
- ERROR = 'ERROR'¶
- class aiostem.structures.OrConnCloseReason[source]¶
Bases:
StrEnumAll possible reasons why an OR connection is closed.
- DONE = 'DONE'¶
The OR connection has shut down cleanly.
- CONNECTREFUSED = 'CONNECTREFUSED'¶
We got an ECONNREFUSED while connecting to the target OR.
- IDENTITY = 'IDENTITY'¶
We connected to the OR, but found that its identity was not what we expected.
- CONNECTRESET = 'CONNECTRESET'¶
We got an ECONNRESET or similar IO error from the connection with the OR.
- TIMEOUT = 'TIMEOUT'¶
We got an ETIMEOUT or similar IO error from the connection with the OR.
- NOROUTE = 'NOROUTE'¶
We got an ENETUNREACH, EHOSTUNREACH, or similar error while connecting to the OR.
- IOERROR = 'IOERROR'¶
We got some other IO error on our connection to the OR.
- RESOURCELIMIT = 'RESOURCELIMIT'¶
We don’t have enough OS resources (file descriptors, etc.) to connect to the OR.
- TLS_ERROR = 'TLS_ERROR'¶
Problem in TLS protocol.
- MISC = 'MISC'¶
The OR connection closed for some other reason.
- PT_MISSING = 'PT_MISSING'¶
No pluggable transport was available.
- class aiostem.structures.OrConnStatus[source]¶
Bases:
StrEnumAll possible statuses used in
ORCONN.- NEW = 'NEW'¶
We have received a new incoming OR connection, and are starting the server handshake.
- LAUNCHED = 'LAUNCHED'¶
We have launched a new outgoing OR connection, and are starting the client handshake.
- CONNECTED = 'CONNECTED'¶
The OR connection has been connected and the handshake is done.
- FAILED = 'FAILED'¶
Our attempt to open the OR connection failed.
- CLOSED = 'CLOSED'¶
The OR connection closed in an unremarkable way.
- class aiostem.structures.RemapSource[source]¶
Bases:
StrEnumAll known remapping sources.
- CACHE = 'CACHE'¶
Tor client decided to remap the address because of a cached answer.
- EXIT = 'EXIT'¶
The remote node we queried gave us the new address as a response.
- class aiostem.structures.RouterFlags[source]¶
Bases:
StrEnumAll possible flags for an onion router.
- AUTHORITY = 'Authority'¶
Is a directory authority.
- BAD_EXIT = 'BadExit'¶
Is believed to be useless as an exit node
- EXIT = 'Exit'¶
Supports commonly used exit ports.
- FAST = 'Fast'¶
Is suitable for high-bandwidth circuits.
- GUARD = 'Guard'¶
Is suitable for use as an entry guard.
- HSDIR = 'HSDir'¶
Is considered a v2 hidden service directory.
- MIDDLE_ONLY = 'MiddleOnly'¶
Is considered unsuitable for usage other than as a middle relay.
- NO_ED_CONSENSUS = 'NoEdConsensus'¶
Any Ed25519 key in the descriptor does not reflect authority consensus.
- STABLE = 'Stable'¶
Is suitable for long-lived circuits.
- STALE_DESC = 'StaleDesc'¶
Should upload a new descriptor because the old one is too old.
- RUNNING = 'Running'¶
Is currently usable over all its published ORPorts.
- VALID = 'Valid'¶
Has been ‘validated’.
- V2DIR = 'V2Dir'¶
Implements the v2 directory protocol or higher.
- class aiostem.structures.Signal[source]¶
Bases:
StrEnumAll possible signals that can be sent to Tor.
- RELOAD = 'RELOAD'¶
Reload configuration items.
- SHUTDOWN = 'SHUTDOWN'¶
Controlled shutdown, if server is an OP, exit immediately.
- DUMP = 'DUMP'¶
Dump stats, log information about open connections and circuits.
- DEBUG = 'DEBUG'¶
Debug, switch all open logs to log level debug.
- HALT = 'HALT'¶
Immediate shutdown, clean up and exit now.
- CLEARDNSCACHE = 'CLEARDNSCACHE'¶
Forget the client-side cached IP addresses for all host names.
- NEWNYM = 'NEWNYM'¶
Switch to clean circuits, so new requests don’t share any circuits with old ones.
- HEARTBEAT = 'HEARTBEAT'¶
Make Tor dump an unscheduled Heartbeat message to log.
- DORMANT = 'DORMANT'¶
Tell Tor to become “dormant”.
- ACTIVE = 'ACTIVE'¶
Tell Tor to stop being “dormant”.
- class aiostem.structures.StreamClientProtocol[source]¶
Bases:
StrEnumAll known client protocols for a stream.
- SOCKS4 = 'SOCKS4'¶
Connecting using SocksV4.
- SOCKS5 = 'SOCKS5'¶
Connecting using SocksV5.
- TRANS = 'TRANS'¶
Transparent connections redirected by pf or netfilter.
- NATD = 'NATD'¶
Transparent connections redirected by natd.
- DNS = 'DNS'¶
DNS requests.
- HTTPCONNECT = 'HTTPCONNECT'¶
HTTP CONNECT tunnel connections.
- METRICS = 'METRICS'¶
Metrics query connections.
- UNKNOWN = 'UNKNOWN'¶
Unknown client protocol type.
- class aiostem.structures.StreamCloseReason[source]¶
Bases:
StrEnumAll reasons provided to close a stream (as a string).
- MISC = 'MISC'¶
Catch-all for unlisted reasons.
- RESOLVEFAILED = 'RESOLVEFAILED'¶
Couldn’t look up hostname.
- CONNECTREFUSED = 'CONNECTREFUSED'¶
Remote host refused connection.
- EXITPOLICY = 'EXITPOLICY'¶
Relay refuses to connect to host or port.
- DESTROY = 'DESTROY'¶
Circuit is being destroyed.
- DONE = 'DONE'¶
Anonymized TCP connection was closed.
- TIMEOUT = 'TIMEOUT'¶
Anonymized TCP connection was closed while connecting.
- NOROUTE = 'NOROUTE'¶
Routing error while attempting to contact destination.
- HIBERNATING = 'HIBERNATING'¶
Relay is temporarily hibernating.
- INTERNAL = 'INTERNAL'¶
Internal error at the relay.
- RESOURCELIMIT = 'RESOURCELIMIT'¶
Relay has no resources to fulfill request.
- CONNRESET = 'CONNRESET'¶
Connection was unexpectedly reset.
- TORPROTOCOL = 'TORPROTOCOL'¶
Sent when closing connection because of Tor protocol violations.
- NOTDIRECTORY = 'NOTDIRECTORY'¶
Client sent
RELAY_BEGIN_DIRto a non-directory relay.
- PRIVATE_ADDR = 'PRIVATE_ADDR'¶
The client tried to connect to a private address like 127.0.0.1 or 10.0.0.1 over Tor.
- END = 'END'¶
We received a RELAY_END message from the other side of this stream.
- class aiostem.structures.StreamCloseReasonInt[source]¶
Bases:
IntEnumAll reasons provided to close a stream.
- MISC = 1¶
Catch-all for unlisted reasons.
- RESOLVEFAILED = 2¶
Couldn’t look up hostname.
- CONNECTREFUSED = 3¶
Remote host refused connection.
- EXITPOLICY = 4¶
Relay refuses to connect to host or port.
- DESTROY = 5¶
Circuit is being destroyed.
- DONE = 6¶
Anonymized TCP connection was closed.
- TIMEOUT = 7¶
Anonymized TCP connection was closed while connecting.
- NOROUTE = 8¶
Routing error while attempting to contact destination.
- HIBERNATING = 9¶
Relay is temporarily hibernating.
- INTERNAL = 10¶
Internal error at the relay.
- RESOURCELIMIT = 11¶
Relay has no resources to fulfill request.
- CONNRESET = 12¶
Connection was unexpectedly reset.
- TORPROTOCOL = 13¶
Sent when closing connection because of Tor protocol violations.
- NOTDIRECTORY = 14¶
Client sent
RELAY_BEGIN_DIRto a non-directory relay.
- class aiostem.structures.StreamPurpose[source]¶
Bases:
StrEnumAll known purposes for a stream.
- DIR_FETCH = 'DIR_FETCH'¶
This stream is generated internally to Tor for fetching directory information.
- DIR_UPLOAD = 'DIR_UPLOAD'¶
An internal stream for uploading information to a directory authority.
- DIRPORT_TEST = 'DIRPORT_TEST'¶
A stream we’re using to test our own directory port to make sure it’s reachable.
- DNS_REQUEST = 'DNS_REQUEST'¶
A user-initiated DNS request.
- USER = 'USER'¶
This stream is handling user traffic.
I can also be internal to Tor, but it doesn’t match one of the other purposes.
- class aiostem.structures.StreamStatus[source]¶
Bases:
StrEnumAll possible statuses for a stream.
- classmethod __bool__()¶
classes/types should always be True.
- NEW = 'NEW'¶
New request to connect.
- NEWRESOLVE = 'NEWRESOLVE'¶
New request to resolve an address.
- REMAP = 'REMAP'¶
Address re-mapped to another.
- SENTCONNECT = 'SENTCONNECT'¶
Sent a connect message along a circuit.
- SENTRESOLVE = 'SENTRESOLVE'¶
Sent a resolve message along a circuit.
- SUCCEEDED = 'SUCCEEDED'¶
Received a reply; stream established.
- FAILED = 'FAILED'¶
Stream failed and not be retried.
- CLOSED = 'CLOSED'¶
Stream closed.
- DETACHED = 'DETACHED'¶
Detached from circuit; can still be retried.
- CONTROLLER_WAIT = 'CONTROLLER_WAIT'¶
Waiting for controller to use
ATTACHSTREAM.
- XOFF_SENT = 'XOFF_SENT'¶
XOFF has been sent for this stream.
- XOFF_RECV = 'XOFF_RECV'¶
XOFF has been received for this stream.
- XON_SENT = 'XON_SENT'¶
XON has been sent for this stream.
- XON_RECV = 'XON_RECV'¶
XON has been received for this stream.
Helper classes¶
These are annotated structures generally built from a single string.
- class aiostem.structures.LongServerName[source]¶
A Tor Server name and its optional nickname.
- fingerprint: Base16Bytes¶
Server fingerprint as a 20 bytes value.
- nickname: str | None¶
Server nickname (optional).
- classmethod from_string(server: str) Self[source]¶
Build a new instance from a single string.
- Returns:
Self– An instance of this class properly parsed from the provided string.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class aiostem.structures.PortRange[source]¶
Bases:
GenericRange[Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Gt(gt=0), Lt(lt=65536)])]]A range of ports.
- min: RangeVal¶
Minimum value in the range (inclusive).
- max: RangeVal¶
Maximum value in the range (inclusive).
- class aiostem.structures.RouterStatus[source]¶
Router status V3 item.
-
flags:
Set[Annotated[RouterFlags|str]]¶ Router status flags describing router properties.
-
ip:
IPv4Address¶ Current IPv4 address.
-
addresses:
Sequence[TcpAddressPort] |None¶ Other known onion routing addresses
-
port_policy:
PortPolicy|None¶ Port policy for outgoing streams.
-
flags:
- class aiostem.structures.StreamTarget[source]¶
Describe the target of a stream.
-
host:
IPv4Address|IPv6Address|str¶ Target server for the stream.
-
node:
LongServerName|None¶ Exit node (if any).
-
host:
- class aiostem.structures.TcpAddressPort[source]¶
Describe a TCP target with a host and a port.
- host: AnyAddress¶
Target host for the TCP connection.
- port: AnyPort¶
Target port for the TCP connection.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class aiostem.structures.VersionRange[source]¶
A range of versions numbers.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class aiostem.structures.VirtualPortTarget[source]¶
Target for an onion virtual port.
-
target:
TcpAddressPort¶ Local target for this virtual port.
-
target:
- aiostem.structures.VirtualPort¶
A virtual port parser and serializer from/to a
VirtualPortTarget.alias of
Annotated[VirtualPortTarget,TrBeforeStringSplit(maxsplit=1, separator=,, dict_keys=(‘port’, ‘target’), when_used=always)]
Ed25519 certificates¶
- class aiostem.structures.Ed25519Certificate[source]¶
-
Tor’s representation of an ed25519 certificate.
- version: PositiveInt¶
Version of the certificate as used by Tor.
- abstractmethod classmethod bytes_to_mapping(value: bytes) Mapping[str, Any][source]¶
Build a new instance from bytes.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class aiostem.structures.Ed25519CertificateV1[source]¶
Bases:
Ed25519CertificateVersion 1 of tor’s representation of an ed25519 certificate.
- ED25519_KEY_LENGTH: ClassVar[int] = 32¶
Length of the Ed25519 public key.
- ED25519_SIGNATURE_LENGTH: ClassVar[int] = 64¶
Length of the Ed25519 signature.
- version: Literal[1]¶
Version of the certificate as used by Tor.
- purpose: Ed25519CertPurpose¶
Purpose of this ed25519 certificate.
- expiration: DatetimeUTC¶
Expiration date for this certificate.
- key: Ed25519PublicKeyBase64 | None¶
Ed25519 public key.
- extensions: Sequence[Ed25519CertExtension]¶
List of ed25519 extensions used along with this certificate.
- signature: Base64Bytes¶
Ed25519 certificate signature.
- signed_content: Base64Bytes¶
Raw content of everything covered by the signature.
- classmethod bytes_to_mapping(data: bytes) Mapping[str, Any][source]¶
Build a new instance from bytes.
- property can_validate: bool¶
Whether this certificate can be validated.
This returns
Falsewhen any extension we do not understand has aAFFECTS_VALIDATIONflag.
- property signing_key: Ed25519PublicKey | None¶
Get the signing key used with this certificate.
This works by looking up for this key in the parsed extensions. This key can then be used to check for this certificate’s signature.
- Returns:
The public key used to verify this certificate, if any.
- raise_for_invalid_signature(key: Ed25519PublicKey) None[source]¶
Check this certificate’s signature.
- Parameters:
key (
Ed25519PublicKey) – A public key to check this certificate against.- Raises:
CryptographyError – When the signature is invalid.
- Return type:
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class aiostem.structures.Ed25519CertPurpose[source]¶
Bases:
IntEnumAll types of ed25519 certificates.
- LINK = 1¶
Link key certificate certified by RSA1024 identity.
- IDENTITY = 2¶
RSA1024 Identity certificate, self-signed.
- AUTHENTICATE = 3¶
RSA1024 AUTHENTICATE cell link certificate, signed with RSA1024 key.
- ED25519_SIGNING = 4¶
Ed25519 signing key, signed with identity key.
- LINK_CERT = 5¶
TLS link certificate signed with ed25519 signing key.
- ED25519_AUTHENTICATE = 6¶
Ed25519 AUTHENTICATE cell key, signed with ed25519 signing key.
- ED25519_IDENTITY = 7¶
Ed25519 identity, signed with RSA identity.
- HS_V3_DESC_SIGNING = 8¶
Hidden service V3 signing key.
- HS_V3_INTRO_AUTH = 9¶
Hidden service V3 intro authentication key.
- NTOR_ONION_KEY = 10¶
ntor-onion-key-crosscertin a server descriptor.
- HS_V3_NTOR_ENC = 11¶
Cross-certification of the encryption key using the descriptor signing key.
- class aiostem.structures.Ed25519CertExtensionFlags[source]¶
Bases:
IntFlagAvailable flags on a Ed25519CertExtension.
- AFFECTS_VALIDATION = 1¶
The extension affects whether the certificate is valid.
- class aiostem.structures.Ed25519CertExtensionType[source]¶
Bases:
IntEnumAvailable types of Ed25519CertExtension.
- HAS_SIGNING_KEY = 4¶
There is a signing key bundled with this certificate.
- class aiostem.structures.BaseEd25519CertExtension[source]¶
-
Describe a single ed25519 certificate extension.
- type: Ed25519CertExtensionType | NonNegativeInt¶
Type of the current extension.
- flags: Ed25519CertExtensionFlags¶
Set of flags for this extension.
- classmethod bytes_to_mapping_list(raw: bytes) Sequence[Mapping[str, Any]][source]¶
Parse and extract extension structures from
raw.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class aiostem.structures.Ed25519CertExtensionSigningKey[source]¶
Bases:
BaseEd25519CertExtensionDescribe an unknown ed25519 certificate extension.
- type: Literal[Ed25519CertExtensionType.HAS_SIGNING_KEY]¶
Type of extension.
- key: Ed25519PublicKeyBase64¶
Public ed25519 signing key as part of this extension.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class aiostem.structures.Ed25519CertExtensionUnkown[source]¶
Bases:
BaseEd25519CertExtensionDescribe an unknown ed25519 certificate extension.
- data: Base64Bytes¶
Raw data for this mysterious unknown extension.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
General status¶
- class aiostem.structures.StatusActionGeneral[source]¶
Bases:
StrEnumPossible actions for a
STATUS_GENERALevent.Note
BAD_LIBEVENThas been removed sinceTor 0.2.7.1.See also
- BUG = 'BUG'¶
Tor has encountered a situation that its developers never expected.
See also
- DIR_ALL_UNREACHABLE = 'DIR_ALL_UNREACHABLE'¶
Tor believes that none of the known directory servers are reachable.
- CLOCK_JUMPED = 'CLOCK_JUMPED'¶
Tor spent enough time without CPU cycles that it has closed all its circuits.
See also
- CLOCK_SKEW = 'CLOCK_SKEW'¶
A lock skew has been detected by Tor.
See also
- DANGEROUS_VERSION = 'DANGEROUS_VERSION'¶
Tor has found that directory servers don’t recommend its version of the Tor software.
See also
- TOO_MANY_CONNECTIONS = 'TOO_MANY_CONNECTIONS'¶
Tor has reached its ulimit -n on file descriptors or sockets.
See also
- class aiostem.structures.StatusGeneralBug[source]¶
Arguments for action
StatusActionGeneral.BUG.
- class aiostem.structures.StatusGeneralClockJumped[source]¶
Arguments for action
StatusActionGeneral.CLOCK_JUMPED.
- class aiostem.structures.StatusGeneralClockSkew[source]¶
Arguments for action
StatusActionGeneral.CLOCK_SKEW.-
source:
Annotated[ClockSkewSource]¶ Source of the clock skew event.
-
source:
- class aiostem.structures.StatusGeneralDangerousVersionReason[source]¶
Bases:
StrEnumAll reasons why we can get a dangerous version notice.
- NEW = 'NEW'¶
- OBSOLETE = 'OBSOLETE'¶
- RECOMMENDED = 'RECOMMENDED'¶
- class aiostem.structures.StatusGeneralDangerousVersion[source]¶
Arguments for action
StatusActionGeneral.DANGEROUS_VERSION.-
reason:
StatusGeneralDangerousVersionReason¶ Tell why is this a dangerous version.
-
reason:
Client status¶
These dataclass() structures are specific for each action of each event.
- class aiostem.structures.StatusActionClient[source]¶
Bases:
StrEnumPossible actions for a
STATUS_CLIENTevent.See also
- BOOTSTRAP = 'BOOTSTRAP'¶
Tor has made some progress at establishing a connection to the Tor network.
See also
- CIRCUIT_ESTABLISHED = 'CIRCUIT_ESTABLISHED'¶
Tor is able to establish circuits for client use.
- CIRCUIT_NOT_ESTABLISHED = 'CIRCUIT_NOT_ESTABLISHED'¶
We are no longer confident that we can build circuits.
See also
- CONSENSUS_ARRIVED = 'CONSENSUS_ARRIVED'¶
Tor has received and validated a new consensus networkstatus.
- DANGEROUS_PORT = 'DANGEROUS_PORT'¶
A stream was initiated to a port that’s commonly used for vuln-plaintext protocols.
See also
- DANGEROUS_SOCKS = 'DANGEROUS_SOCKS'¶
A connection was made to Tor’s SOCKS port without support for hostnames.
See also
- ENOUGH_DIR_INFO = 'ENOUGH_DIR_INFO'¶
Tor now knows enough network-status documents and enough server descriptors.
- NOT_ENOUGH_DIR_INFO = 'NOT_ENOUGH_DIR_INFO'¶
We fell below the desired threshold directory information.
- SOCKS_BAD_HOSTNAME = 'SOCKS_BAD_HOSTNAME'¶
Some application gave us a funny-looking hostname.
See also
- SOCKS_UNKNOWN_PROTOCOL = 'SOCKS_UNKNOWN_PROTOCOL'¶
A connection was made to Tor’s SOCKS port and did not speak the SOCKS protocol.
See also
- class aiostem.structures.StatusClientBootstrap[source]¶
Arguments for action
StatusActionClient.BOOTSTRAP.-
progress:
Annotated[int]¶ A number between 0 and 100 for how far through the bootstrapping process we are.
-
count:
Annotated[int] |None¶ Tells how many bootstrap problems there have been so far at this phase.
-
hostaddr:
TcpAddressPort|None¶ An address and port combination, where ‘address’ is an ipv4 or ipv6 address.
-
progress:
- class aiostem.structures.StatusClientCircuitNotEstablished[source]¶
Arguments for action
StatusActionClient.CIRCUIT_ESTABLISHED.
- class aiostem.structures.StatusClientDangerousPort[source]¶
Arguments for action
StatusActionClient.DANGEROUS_PORT.
- class aiostem.structures.StatusClientDangerousSocks[source]¶
Arguments for action
StatusActionClient.DANGEROUS_SOCKS.-
address:
TcpAddressPort¶ The address and port implied in this connection.
-
address:
- class aiostem.structures.StatusClientSocksUnknownProtocol[source]¶
Arguments for action
StatusActionClient.SOCKS_UNKNOWN_PROTOCOL.This class is currently unused as the quotes are buggy. Additionally the escaping is performed as
CSTRING, which we do not handle.
- class aiostem.structures.StatusClientSocksBadHostname[source]¶
Arguments for action
StatusActionClient.SOCKS_BAD_HOSTNAME.
Server status¶
- class aiostem.structures.ClockSkewSource[source]¶
Source of a clock skew, properly parsed.
Note
This is to be used with
StatusGeneralClockSkew.-
address:
TcpAddressPort|None¶ Optional address of the source (
NonewithCONSENSUS).
-
address:
- class aiostem.structures.StatusActionServer[source]¶
Bases:
StrEnumPossible actions for a
STATUS_SERVERevent.See also
Note
SERVER_DESCRIPTOR_STATUSwas never implemented.- EXTERNAL_ADDRESS = 'EXTERNAL_ADDRESS'¶
Our best idea for our externally visible IP has changed to ‘IP’.
See also
- CHECKING_REACHABILITY = 'CHECKING_REACHABILITY'¶
We’re going to start testing the reachability of our external OR port or directory port.
See also
- REACHABILITY_SUCCEEDED = 'REACHABILITY_SUCCEEDED'¶
We successfully verified the reachability of our external OR port or directory port.
See also
- GOOD_SERVER_DESCRIPTOR = 'GOOD_SERVER_DESCRIPTOR'¶
We successfully uploaded our server descriptor to one of the directory authorities.
- NAMESERVER_STATUS = 'NAMESERVER_STATUS'¶
One of our name servers has changed status.
See also
- NAMESERVER_ALL_DOWN = 'NAMESERVER_ALL_DOWN'¶
All of our nameservers have gone down.
- DNS_HIJACKED = 'DNS_HIJACKED'¶
Our DNS provider is providing an address when it should be saying
NOTFOUND.
- DNS_USELESS = 'DNS_USELESS'¶
Our DNS provider is giving a hijacked address instead of well-known websites.
- BAD_SERVER_DESCRIPTOR = 'BAD_SERVER_DESCRIPTOR'¶
A directory authority rejected our descriptor.
See also
- ACCEPTED_SERVER_DESCRIPTOR = 'ACCEPTED_SERVER_DESCRIPTOR'¶
A single directory authority accepted our descriptor.
See also
- REACHABILITY_FAILED = 'REACHABILITY_FAILED'¶
We failed to connect to our external OR port or directory port successfully.
See also
- HIBERNATION_STATUS = 'HIBERNATION_STATUS'¶
Our bandwidth based accounting status has changed.
See also
- class aiostem.structures.ExternalAddressResolveMethod[source]¶
Bases:
StrEnumHow the external method was resolved.
- NONE = 'NONE'¶
- CONFIGURED = 'CONFIGURED'¶
- CONFIGURED_ORPORT = 'CONFIGURED_ORPORT'¶
- GETHOSTNAME = 'GETHOSTNAME'¶
- INTERFACE = 'INTERFACE'¶
- RESOLVED = 'RESOLVED'¶
- class aiostem.structures.StatusServerExternalAddress[source]¶
Arguments for action
StatusActionServer.EXTERNAL_ADDRESS.-
address:
IPv4Address|IPv6Address¶ Our external IP address.
-
method:
ExternalAddressResolveMethod¶ How we found out our external IP address.
-
address:
- class aiostem.structures.StatusServerCheckingReachability[source]¶
Arguments for action
StatusActionServer.CHECKING_REACHABILITY.-
or_address:
TcpAddressPort|None¶ Checking reachability to this onion routing address that is our own.
-
or_address:
- class aiostem.structures.StatusServerReachabilitySucceeded[source]¶
Arguments for action
StatusActionServer.REACHABILITY_SUCCEEDED.-
or_address:
TcpAddressPort|None¶ Reachability succeeded to our onion routing address.
-
or_address:
- class aiostem.structures.StatusServerReachabilityFailed[source]¶
Arguments for action
StatusActionServer.REACHABILITY_FAILED.-
or_address:
TcpAddressPort|None¶ Reachability failed to our onion routing address.
-
or_address:
- class aiostem.structures.StatusServerNameserverStatus[source]¶
Arguments for action
StatusActionServer.NAMESERVER_STATUS.-
status:
LivenessStatus¶ This is its status.
-
status:
- class aiostem.structures.StatusServerBadServerDescriptor[source]¶
Arguments for action
StatusActionServer.BAD_SERVER_DESCRIPTOR.-
dir_auth:
TcpAddressPort¶ Directory that rejected our descriptor as an address and port.
-
dir_auth:
- class aiostem.structures.StatusServerAcceptedServerDescriptor[source]¶
Arguments for action
StatusActionServer.ACCEPTED_SERVER_DESCRIPTOR.-
dir_auth:
TcpAddressPort¶ Directory that accepted our server descriptor as an address and port.
-
dir_auth:
- class aiostem.structures.StatusServerHibernationStatus[source]¶
Arguments for action
StatusActionServer.HIBERNATION_STATUS.