Skip to main content

Module dev_api

Module dev_api 

Source
Expand description

Dev API handlers for local development and diagnostics.

Provides the /scp/dev/v1 endpoint family: health, identity, relay status, and context management. All requests require bearer token authentication (spec section 18.10.2). The token is validated using constant-time comparison to prevent timing side-channel attacks.

§Endpoints

MethodPathHandler
GET/scp/dev/v1/healthhealth_handler
GET/scp/dev/v1/identityidentity_handler
GET/scp/dev/v1/relay/statusrelay_status_handler
GET/scp/dev/v1/contextslist_contexts_handler
GET/scp/dev/v1/contexts/{id}get_context_handler
POST/scp/dev/v1/contextscreate_context_handler
DELETE/scp/dev/v1/contexts/{id}delete_context_handler

See spec section 18.10 for the full dev API specification.

Structs§

ContextResponse
Response body for context endpoints (GET /scp/dev/v1/contexts and GET /scp/dev/v1/contexts/{id}).
CreateContextRequest
Request body for POST /scp/dev/v1/contexts.
HealthResponse
Response body for GET /scp/dev/v1/health.
IdentityResponse
Response body for GET /scp/dev/v1/identity.
RelayStatusResponse
Response body for GET /scp/dev/v1/relay/status.

Functions§

bearer_auth_middleware
Axum middleware that validates bearer token authentication.
create_context_handler
Handler for POST /scp/dev/v1/contexts.
delete_context_handler
Handler for DELETE /scp/dev/v1/contexts/{id}.
dev_router
get_context_handler
Handler for GET /scp/dev/v1/contexts/{id}.
health_handler
Handler for GET /scp/dev/v1/health.
identity_handler
Handler for GET /scp/dev/v1/identity.
list_contexts_handler
Handler for GET /scp/dev/v1/contexts.
localhost_host_middleware
Axum middleware that rejects requests with non-localhost Host headers.
relay_status_handler
Handler for GET /scp/dev/v1/relay/status.
security_headers_middleware
Axum middleware that sets security response headers on every dev API response.