Rocket.rs basic authentication

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

About

Recently, I’ve created a simple library called rocket-basicauth which allows a high-level interface to basic access authentication using request guards, as an extension for the Rocket.rs web framework ✨

Demonstration

Here is the jist of the entire functionality of this library:

/// Hello route with `auth` request guard
#[get("/hello/<age>")]
fn hello(auth: BasicAuth, age: u8) -> String {
    format!("Hello, {} year old named {}!", age, auth.name)
}

This example excludes the use rocket; imports and main function setups and just shows the crux of this library; the “BasicAuth” structure, documented here.

Here are some links to find out more about this quick library: