1use bulwark_security::request::context::{Method, RequestContext};
2
3fn main() {
4 let ctx = RequestContext::new(Method::POST, "/login");
6
7 log_request(&ctx);
8
9 if is_login(&ctx) {
10 println!("Login request detected");
11 } else {
12 println!("Not a login request");
13 }
14}
15
16fn log_request(ctx: &RequestContext) {
17 println!("Incoming Request");
18 println!(" Method : {:?}", ctx.method);
19 println!(" Path : {}", ctx.path);
20}
21
22fn is_login(ctx: &RequestContext) -> bool {
23 ctx.method == Method::POST && ctx.path == "/login"
24}