cts-common 0.4.1

Common types and traits used across the CipherStash ecosystem
Documentation
use crate::WorkspaceId;
use serde::{Deserialize, Serialize};

#[derive(Debug, Serialize, Deserialize)]
pub struct CreateWorkspaceResponse {
    pub id: WorkspaceId,
}

#[cfg(feature = "server")]
pub(super) mod server {
    use super::*;
    use axum::{response::IntoResponse, Json};

    impl IntoResponse for CreateWorkspaceResponse {
        fn into_response(self) -> axum::response::Response {
            (http::StatusCode::CREATED, Json(self)).into_response()
        }
    }
}