Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3355818
D12415.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
D12415.diff
View Options
diff --git a/services/blob/src/http/mod.rs b/services/blob/src/http/mod.rs
--- a/services/blob/src/http/mod.rs
+++ b/services/blob/src/http/mod.rs
@@ -1,8 +1,10 @@
use crate::{config::CONFIG, service::BlobService};
-use actix_web::{web, App, HttpServer};
+use actix_web::{web, App, HttpResponse, HttpServer};
use anyhow::Result;
-use comm_lib::auth::AuthService;
+use comm_lib::{
+ auth::AuthService, http::auth::get_comm_authentication_middleware,
+};
use tracing::info;
mod errors;
@@ -21,6 +23,7 @@
CONFIG.http_port
);
HttpServer::new(move || {
+ let auth_middleware = get_comm_authentication_middleware();
App::new()
.wrap(tracing_actix_web::TracingLogger::default())
.wrap(comm_lib::http::cors_config(
@@ -28,12 +31,15 @@
))
.app_data(auth_service.to_owned())
.app_data(web::Data::new(blob_service.to_owned()))
+ .route("/health", web::get().to(HttpResponse::Ok))
.service(
web::resource("/blob/{holder}")
+ .wrap(auth_middleware.clone())
.route(web::get().to(handlers::blob::get_blob_handler)),
)
.service(
web::resource("/blob")
+ .wrap(auth_middleware)
.route(web::put().to(handlers::blob::upload_blob_handler))
.route(web::post().to(handlers::blob::assign_holder_handler))
.route(web::delete().to(handlers::blob::remove_holder_handler)),
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 3:39 PM (22 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2576595
Default Alt Text
D12415.diff (1 KB)
Attached To
Mode
D12415: [blob] Hide endpoints behind auth middleware
Attached
Detach File
Event Timeline
Log In to Comment