rocket-basicauth

Tests Docs

A high-level basic access authentication request guard for Rocket.rs

Example

```rust

![feature(procmacrohygiene, decl_macro)]

[macro_use] extern crate rocket;

use rocket_basicauth::BasicAuth;

/// Hello route with auth request guard, containing a name and password

[get("/hello/")]

fn hello(auth: BasicAuth, age: u8) -> String { format!("Hello, {} year old named {}!", age, auth.name) }

fn main() { rocket::ignite().mount("/", routes![hello]).launch(); } ```

Installation

Simply add the following to your Cargo.toml file:

toml [dependencies] rocket-basicauth = "1"