Skip to content

Commit

Permalink
Use the actual UUID bytes (vs str bytes) when checking authorization
Browse files Browse the repository at this point in the history
  • Loading branch information
AzureMarker committed Jul 17, 2020
1 parent 31432be commit 03f9f1c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion autoendpoint/src/server/extractors/authorization_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use actix_web::web::Data;
use actix_web::{FromRequest, HttpRequest};
use futures::future::LocalBoxFuture;
use futures::FutureExt;
use uuid::Uuid;

/// Verifies the request authorization via the authorization header.
///
Expand All @@ -26,7 +27,9 @@ impl FromRequest for AuthorizationCheck {
let uaid = req
.match_info()
.get("uaid")
.expect("{uaid} must be part of the path");
.expect("{uaid} must be part of the path")
.parse::<Uuid>()
.map_err(|_| ApiErrorKind::NoUser)?;
let state: Data<ServerState> = Data::extract(&req)
.into_inner()
.expect("No server state found");
Expand Down

0 comments on commit 03f9f1c

Please sign in to comment.