| Crates.io | this-env |
| lib.rs | this-env |
| version | 0.1.32 |
| created_at | 2025-06-25 04:39:50.010374+00 |
| updated_at | 2025-11-14 00:18:03.012594+00 |
| description | This.Env Data Formatter |
| homepage | https://neurons.me |
| repository | https://github.com/neurons-me/this.env |
| max_upload_size | |
| id | 1725315 |
| size | 129,191 |
Light‑weight environment recognition & trust middleware for Rust. Goal: Let your application decide and learn where it is running (localhost, extensions, remote web, CLI, …) and how much it should trust that origin – before you execute business‑logic.
A smart middleware system that inspects incoming HTTP requests and evaluates their environment (origin, IP, headers, cookies, etc.) to determine whether the request should be Approved, Blocked, or Pending Approval. It is ideal for building decentralized permission systems and real-time trust evaluation.
use this_env::actixMiddleware; // import
// Inside your Actix `App` builder
App::new()
.wrap(actixMiddleware::default()) // 1‑line, sensible defaults
.configure(routes::config);
We pass the port to the ActixMiddleware configuration so that this.env can differentiate its database and runtime context per running instance/port.
##### Custom rules
use this_env::{ThisEnvMiddleware, ThisEnvMiddlewareConfig};
let mw_config = ThisEnvMiddlewareConfig {
port: port_clone.clone(),
instance: instance_clone.clone(),
..Default::default()
};
HttpServer::new(move || {
let mw_config_clone = mw_config.clone();
App::new()
.app_data(state.clone())
.wrap(cors_permissive())
.wrap(ThisEnvMiddleware::new(mw_config_clone))
.configure(router::config)
.service(Files::new("/", "./static").index_file("html/index.html"))
})
Middleware endpoints like /__env/logs are special internal routes exposed by this.env middleware for introspection and management.
This.Env Middleware Home Dashboard.
Maintained by neurons.me — crafted with ☕ by suiGn.