Skip to main content

Module projection

Module projection 

Source
Expand description

Broadcast projection registry and key management.

A ProjectedContext tracks the per-epoch broadcast keys needed to decrypt messages from a broadcast context that this node projects over HTTP. The projection endpoints serve decrypted content at:

  • GET /scp/broadcast/<routing_id_hex>/feed
  • GET /scp/broadcast/<routing_id_hex>/messages/<blob_id_hex>

Where routing_id = SHA-256(context_id) per spec section 5.14.6.

§Activation

Projection is opt-in per context via ApplicationNode::enable_broadcast_projection and deactivated via ApplicationNode::disable_broadcast_projection.

See spec sections 18.11.2 and 18.11.5.

Structs§

FeedMessage
A single decrypted broadcast message in a FeedResponse.
FeedQuery
Query parameters for GET /scp/broadcast/<routing_id>/feed.
FeedResponse
JSON response body for GET /scp/broadcast/<routing_id>/feed.
ProjectedContext
A broadcast context whose messages are projected (decrypted and served) by this node’s HTTP endpoints.

Functions§

broadcast_projection_router
Returns an axum Router serving both broadcast projection endpoints.
compute_routing_id
Computes the 32-byte routing ID for a broadcast context.
feed_handler
Axum handler for GET /scp/broadcast/<routing_id>/feed.
hex_decode
Decodes a hex string into a 32-byte array.
hex_encode
Encodes a 32-byte array as a lowercase hex string (64 characters).
message_handler
Axum handler for GET /scp/broadcast/<routing_id>/messages/<blob_id>.
unix_to_iso8601
Formats a Unix timestamp (seconds since epoch) as an ISO 8601 UTC string.
validate_projection_policy
Validates that a projection policy is consistent with the context’s admission mode.