1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-04-16 07:52:06 +02:00
2022-09-11 21:55:40 +01:00

26 lines
616 B
Rust

//! Challenge for the "Bearer" HTTP Authentication Scheme.
mod builder;
mod challenge;
mod errors;
pub use self::{builder::BearerBuilder, challenge::Bearer, errors::Error};
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn to_bytes() {
let b = Bearer::build()
.error(Error::InvalidToken)
.error_description("Subject 8740827c-2e0a-447b-9716-d73042e4039d not found")
.finish();
assert_eq!(
"Bearer error=\"invalid_token\" error_description=\"Subject 8740827c-2e0a-447b-9716-d73042e4039d not found\"",
format!("{}", b)
);
}
}