| Crates.io | guarantee |
| lib.rs | guarantee |
| version | 0.1.0 |
| created_at | 2026-01-07 05:37:23.159394+00 |
| updated_at | 2026-01-07 05:37:23.159394+00 |
| description | guarantee is a tee-secured web application framework that focuses on security. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 2027578 |
| size | 54,661 |
A lightweight, boilerplate-free Rust library designed for building HTTP services inside Trusted Execution Environments (TEEs), specifically targeting Intel SGX (via the Fortanix EDP).
This template provides a custom, dependency-light HTTP server and router, allowing you to build secure enclaves with minimal overhead.
Arc<HandlerState<T>>.x86_64-fortanix-unknown-sgx out of the box.To build and run this project, you need:
Rust Nightly: Required for some SGX features.
rustup toolchain install nightly
rustup default nightly
SGX Target:
rustup target add x86_64-fortanix-unknown-sgx
Fortanix SGX Runner (Optional, for running locally):
cargo install ftxsgx-runner-cargo
The project is structured as a library (src/lib.rs) which exports core modules:
server: The TCP/HTTP server implementation.http: Request/Response parsing and Router.state: Generic state container.handlers: Example handlers.This template includes examples demonstrating different use cases.
A simple "Hello World" style example.
cargo build --example health
To run it (if you have the runner installed/configured):
cargo run --example health
Demonstrates using the generic HandlerState<T> to share atomic state between requests.
cargo build --example counter
() if stateless).use tee_template::http::router::Router;
use tee_template::state::HandlerState;
use std::sync::Arc;
// Define your state type
type AppState = AtomicUsize;
let my_state = AtomicUsize::new(0);
let state = Arc::new(HandlerState::new(Some(my_state)));
let mut router = Router::new(state);
router.register("/my-endpoint", my_handler);
HttpServer::new("0.0.0.0:8080", router)?.run()?;
This project is licensed under the MIT License - see the LICENSE file for details.