mod#
- exception rizemind.authentication.mod.NoAccountAuthenticationModError[source]#
Bases:
RizemindExceptionNo account configuration is available in the context state.
- exception rizemind.authentication.mod.NoSwarmAuthenticationModError[source]#
Bases:
RizemindExceptionNo swarm configuration is available in the context state.
- exception rizemind.authentication.mod.WrongSwarmAuthenticationModError(expected: ChecksumAddress | None, received: ChecksumAddress)[source]#
Bases:
RizemindExceptionThe requested swarm domain does not match the configured domain.
- rizemind.authentication.mod.authentication_mod(msg: Message, ctx: Context, call_next: Callable[[Message, Context], Message]) Message[source]#
Handle authentication for GET_PROPERTIES messages.
Invokes the next callable to populate the context, then, for messages carrying training-auth instructions, verifies the swarm domain and returns a signed authentication response.
- Parameters:
msg – Incoming message to process.
ctx – Flower context carrying client state.
call_next – Next app callable to delegate to.
- Returns:
The resulting message. If authentication applies, this is a GET_PROPERTIES response containing the signature; otherwise, the delegated reply.
- Raises:
NoAccountAuthenticationModError – Account configuration is missing from context.
NoSwarmAuthenticationModError – Swarm configuration is missing from context.
WrongSwarmAuthenticationModError – Request domain differs from the configured swarm domain.