systemprompt-api 0.21.1

Axum-based HTTP server and API gateway for systemprompt.io AI governance infrastructure. Exposes governed agents, MCP, A2A, and admin endpoints with rate limiting and RBAC.
Documentation
//! OAuth response body shapes.
//!
//! Copyright (c) systemprompt.io — Business Source License 1.1.
//! See <https://systemprompt.io> for licensing details.

use axum::http::StatusCode;
use axum::response::{IntoResponse, Json, Response};
use serde::Serialize;

pub fn single_response<T: Serialize>(data: T) -> Response {
    (
        StatusCode::OK,
        Json(serde_json::json!({
            "data": data
        })),
    )
        .into_response()
}

pub fn created_response(body: serde_json::Value, location: String) -> Response {
    (StatusCode::CREATED, [("Location", location)], Json(body)).into_response()
}