Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3357907
D10932.id36580.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D10932.id36580.diff
View Options
diff --git a/services/reports/src/service.rs b/services/reports/src/service.rs
--- a/services/reports/src/service.rs
+++ b/services/reports/src/service.rs
@@ -203,7 +203,7 @@
#[inline]
fn from_request(
req: &actix_web::HttpRequest,
- _payload: &mut actix_web::dev::Payload,
+ payload: &mut actix_web::dev::Payload,
) -> Self::Future {
use actix_web::error::{ErrorForbidden, ErrorInternalServerError};
use actix_web::HttpMessage;
@@ -227,14 +227,16 @@
});
let request_auth_value =
- req.extensions().get::<AuthorizationCredential>().cloned();
+ AuthorizationCredential::from_request(req, payload);
Box::pin(async move {
let auth_service = auth_service?;
let base_service = base_service?;
+ let credential = request_auth_value.await.ok();
+
// This is Some for endpoints hidden behind auth validation middleware
- let auth_token = match request_auth_value {
+ let auth_token = match credential {
Some(token @ AuthorizationCredential::UserToken(_)) => token,
Some(_) => {
// Reports service shouldn't be called by other services
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 25, 2:27 AM (20 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2578024
Default Alt Text
D10932.id36580.diff (1 KB)
Attached To
Mode
D10932: [reports] Always create AuthorizationCredential directly
Attached
Detach File
Event Timeline
Log In to Comment