refactor: demo server (clean, refactor, docs)

This commit is contained in:
cduvray 2023-01-30 23:44:25 +01:00
parent 43f2523ec6
commit 6ff5d88ae9
5 changed files with 56 additions and 170 deletions

View file

@ -57,7 +57,7 @@ fn response_wwwauth(status: StatusCode, bearer: &str) -> Response<BoxBody> {
let h = if bearer.is_empty() {
"Bearer".to_owned()
} else {
format!("Bearer {}", bearer)
format!("Bearer {bearer}")
};
res.headers_mut().insert(header::WWW_AUTHENTICATE, h.parse().unwrap());

View file

@ -9,7 +9,7 @@ pub struct OidcDiscovery {
}
pub async fn discover_jwks(issuer: &str) -> Result<String, InitError> {
let discovery_url = format!("{}/.well-known/openid-configuration", issuer);
let discovery_url = format!("{issuer}/.well-known/openid-configuration");
reqwest::Client::new()
.get(discovery_url)
.send()