From 729335014fb208630b396e9c73eac29e5e6d1422 Mon Sep 17 00:00:00 2001 From: maulanasdqn Date: Fri, 10 Apr 2026 00:11:01 +0700 Subject: [PATCH] fix: use correct Swagger security scheme name across all modules Changed "bearer_auth" to "Bearer" in utoipa security annotations for QR and Hackathon handlers to match the registered SecurityAddon scheme name. Fixes Swagger UI not sending Authorization header. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../campaigns/infrastructure/http/handlers.rs | 10 +++++----- .../qr/users/infrastructure/http/handlers.rs | 10 +++++----- .../src/admin/infrastructure/http/handlers.rs | 20 +++++++++---------- .../src/chat/infrastructure/http/handlers.rs | 6 +++--- .../infrastructure/http/handlers.rs | 6 +++--- .../infrastructure/http/handlers.rs | 8 ++++---- .../storage/infrastructure/http/handlers.rs | 8 ++++---- .../infrastructure/http/handlers.rs | 12 +++++------ .../src/teams/infrastructure/http/handlers.rs | 12 +++++------ .../src/users/infrastructure/http/handlers.rs | 4 ++-- 10 files changed, 48 insertions(+), 48 deletions(-) diff --git a/imphnen-cms/src/qr/campaigns/infrastructure/http/handlers.rs b/imphnen-cms/src/qr/campaigns/infrastructure/http/handlers.rs index 1fc37eb..8b7688e 100644 --- a/imphnen-cms/src/qr/campaigns/infrastructure/http/handlers.rs +++ b/imphnen-cms/src/qr/campaigns/infrastructure/http/handlers.rs @@ -38,7 +38,7 @@ use crate::qr::{ (status = 403, description = "Forbidden - admin only") ), tag = "QR - Campaigns", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn create_campaign_handler( Extension(service): Extension>, @@ -80,7 +80,7 @@ pub async fn create_campaign_handler( (status = 403, description = "Forbidden - admin only") ), tag = "QR - Campaigns", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn list_campaigns_handler( Extension(service): Extension>, @@ -118,7 +118,7 @@ pub async fn list_campaigns_handler( (status = 403, description = "Forbidden - admin only") ), tag = "QR - Campaigns", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn activate_campaign_handler( Extension(service): Extension>, @@ -145,7 +145,7 @@ pub async fn activate_campaign_handler( (status = 403, description = "Forbidden - admin only") ), tag = "QR - Campaigns", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn delete_campaign_handler( Extension(service): Extension>, @@ -174,7 +174,7 @@ pub async fn delete_campaign_handler( (status = 401, description = "Unauthorized") ), tag = "QR - Campaigns", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn process_image_handler( Extension(service): Extension>, diff --git a/imphnen-cms/src/qr/users/infrastructure/http/handlers.rs b/imphnen-cms/src/qr/users/infrastructure/http/handlers.rs index 3ad9e9d..38b81a8 100644 --- a/imphnen-cms/src/qr/users/infrastructure/http/handlers.rs +++ b/imphnen-cms/src/qr/users/infrastructure/http/handlers.rs @@ -35,7 +35,7 @@ use crate::qr::{ (status = 401, description = "Unauthorized") ), tag = "QR - Users", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn get_me_handler( Extension(service): Extension>, @@ -66,7 +66,7 @@ pub async fn get_me_handler( (status = 401, description = "Unauthorized") ), tag = "QR - Users", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn update_me_handler( Extension(service): Extension>, @@ -113,7 +113,7 @@ pub async fn update_me_handler( (status = 403, description = "Forbidden - admin only") ), tag = "QR - Users", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn list_users_handler( Extension(service): Extension>, @@ -151,7 +151,7 @@ pub async fn list_users_handler( (status = 403, description = "Forbidden - admin only") ), tag = "QR - Users", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn update_role_handler( Extension(service): Extension>, @@ -179,7 +179,7 @@ pub async fn update_role_handler( (status = 403, description = "Forbidden - admin only") ), tag = "QR - Users", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn delete_user_handler( Extension(service): Extension>, diff --git a/imphnen-hackathon/src/admin/infrastructure/http/handlers.rs b/imphnen-hackathon/src/admin/infrastructure/http/handlers.rs index d0a9d38..00e1dca 100644 --- a/imphnen-hackathon/src/admin/infrastructure/http/handlers.rs +++ b/imphnen-hackathon/src/admin/infrastructure/http/handlers.rs @@ -41,7 +41,7 @@ use uuid::Uuid; (status = 403, description = "Forbidden - admin only") ), tag = "Hackathon - Admin", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn admin_list_users( Extension(service): Extension>, @@ -81,7 +81,7 @@ pub async fn admin_list_users( (status = 404, description = "User not found") ), tag = "Hackathon - Admin", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn admin_get_user( Extension(service): Extension>, @@ -102,7 +102,7 @@ pub async fn admin_get_user( (status = 403, description = "Forbidden - admin only") ), tag = "Hackathon - Admin", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn admin_set_admin( Extension(service): Extension>, @@ -123,7 +123,7 @@ pub async fn admin_set_admin( (status = 403, description = "Forbidden - admin only") ), tag = "Hackathon - Admin", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn admin_delete_user( Extension(service): Extension>, @@ -160,7 +160,7 @@ pub async fn admin_delete_user( (status = 403, description = "Forbidden - admin only") ), tag = "Hackathon - Admin", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn admin_list_teams( Extension(service): Extension>, @@ -188,7 +188,7 @@ pub async fn admin_list_teams( (status = 403, description = "Forbidden - admin only") ), tag = "Hackathon - Admin", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn admin_delete_team( Extension(service): Extension>, @@ -225,7 +225,7 @@ pub async fn admin_delete_team( (status = 403, description = "Forbidden - admin only") ), tag = "Hackathon - Admin", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn admin_list_submissions( Extension(service): Extension>, @@ -253,7 +253,7 @@ pub async fn admin_list_submissions( (status = 403, description = "Forbidden - admin only") ), tag = "Hackathon - Admin", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn admin_set_winner( Extension(service): Extension>, @@ -275,7 +275,7 @@ pub async fn admin_set_winner( (status = 403, description = "Forbidden - admin only") ), tag = "Hackathon - Admin", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn admin_remove_winner( Extension(service): Extension>, @@ -305,7 +305,7 @@ pub async fn admin_remove_winner( (status = 403, description = "Forbidden - admin only") ), tag = "Hackathon - Admin", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn admin_list_winners( Extension(service): Extension>, diff --git a/imphnen-hackathon/src/chat/infrastructure/http/handlers.rs b/imphnen-hackathon/src/chat/infrastructure/http/handlers.rs index c5750f3..1b39c93 100644 --- a/imphnen-hackathon/src/chat/infrastructure/http/handlers.rs +++ b/imphnen-hackathon/src/chat/infrastructure/http/handlers.rs @@ -43,7 +43,7 @@ use uuid::Uuid; (status = 401, description = "Unauthorized") ), tag = "Hackathon - Chat", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn get_team_messages_handler( Extension(service): Extension>, @@ -80,7 +80,7 @@ pub async fn get_team_messages_handler( (status = 401, description = "Unauthorized") ), tag = "Hackathon - Chat", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn send_message_handler( Extension(service): Extension>, @@ -105,7 +105,7 @@ pub async fn send_message_handler( (status = 403, description = "Forbidden - not message owner") ), tag = "Hackathon - Chat", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn delete_message_handler( Extension(service): Extension>, diff --git a/imphnen-hackathon/src/invitations/infrastructure/http/handlers.rs b/imphnen-hackathon/src/invitations/infrastructure/http/handlers.rs index fe1640c..d2c0bc7 100644 --- a/imphnen-hackathon/src/invitations/infrastructure/http/handlers.rs +++ b/imphnen-hackathon/src/invitations/infrastructure/http/handlers.rs @@ -32,7 +32,7 @@ use uuid::Uuid; (status = 401, description = "Unauthorized") ), tag = "Hackathon - Invitations", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn get_my_invitations_handler( Extension(service): Extension>, @@ -56,7 +56,7 @@ pub async fn get_my_invitations_handler( (status = 404, description = "Invitation not found") ), tag = "Hackathon - Invitations", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn respond_to_invitation_handler( Extension(service): Extension>, @@ -100,7 +100,7 @@ pub async fn respond_to_invitation_handler( (status = 403, description = "Forbidden - not team leader") ), tag = "Hackathon - Invitations", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn invite_team_member_handler( Extension(service): Extension>, diff --git a/imphnen-hackathon/src/join_requests/infrastructure/http/handlers.rs b/imphnen-hackathon/src/join_requests/infrastructure/http/handlers.rs index 84f27e7..0b29dc8 100644 --- a/imphnen-hackathon/src/join_requests/infrastructure/http/handlers.rs +++ b/imphnen-hackathon/src/join_requests/infrastructure/http/handlers.rs @@ -34,7 +34,7 @@ use uuid::Uuid; (status = 401, description = "Unauthorized") ), tag = "Hackathon - Join Requests", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn create_join_request_handler( Extension(service): Extension>, @@ -72,7 +72,7 @@ pub async fn create_join_request_handler( (status = 401, description = "Unauthorized") ), tag = "Hackathon - Join Requests", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn get_my_join_requests_handler( Extension(service): Extension>, @@ -110,7 +110,7 @@ pub async fn get_my_join_requests_handler( (status = 403, description = "Forbidden - not team leader") ), tag = "Hackathon - Join Requests", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn get_team_join_requests_handler( Extension(service): Extension>, @@ -137,7 +137,7 @@ pub async fn get_team_join_requests_handler( (status = 403, description = "Forbidden - not team leader") ), tag = "Hackathon - Join Requests", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn respond_to_join_request_handler( Extension(service): Extension>, diff --git a/imphnen-hackathon/src/storage/infrastructure/http/handlers.rs b/imphnen-hackathon/src/storage/infrastructure/http/handlers.rs index 9b48ad5..e6ff561 100644 --- a/imphnen-hackathon/src/storage/infrastructure/http/handlers.rs +++ b/imphnen-hackathon/src/storage/infrastructure/http/handlers.rs @@ -21,7 +21,7 @@ use std::sync::Arc; (status = 401, description = "Unauthorized") ), tag = "Hackathon - Storage", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn upload_file_handler( Extension(service): Extension>, @@ -56,7 +56,7 @@ pub async fn upload_file_handler( (status = 401, description = "Unauthorized") ), tag = "Hackathon - Storage", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn upload_avatar_handler( Extension(service): Extension>, @@ -91,7 +91,7 @@ pub async fn upload_avatar_handler( (status = 401, description = "Unauthorized") ), tag = "Hackathon - Storage", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn upload_team_handler( Extension(service): Extension>, @@ -126,7 +126,7 @@ pub async fn upload_team_handler( (status = 401, description = "Unauthorized") ), tag = "Hackathon - Storage", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn upload_submission_handler( Extension(service): Extension>, diff --git a/imphnen-hackathon/src/submissions/infrastructure/http/handlers.rs b/imphnen-hackathon/src/submissions/infrastructure/http/handlers.rs index 706a2dd..5911dc2 100644 --- a/imphnen-hackathon/src/submissions/infrastructure/http/handlers.rs +++ b/imphnen-hackathon/src/submissions/infrastructure/http/handlers.rs @@ -36,7 +36,7 @@ use uuid::Uuid; (status = 401, description = "Unauthorized") ), tag = "Hackathon - Submissions", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn create_submission_handler( Extension(service): Extension>, @@ -79,7 +79,7 @@ pub async fn create_submission_handler( (status = 404, description = "Submission not found") ), tag = "Hackathon - Submissions", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn get_team_submission_handler( Extension(service): Extension>, @@ -119,7 +119,7 @@ pub async fn get_team_submission_handler( (status = 401, description = "Unauthorized") ), tag = "Hackathon - Submissions", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn update_submission_handler( Extension(service): Extension>, @@ -161,7 +161,7 @@ pub async fn update_submission_handler( (status = 401, description = "Unauthorized") ), tag = "Hackathon - Submissions", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn submit_project_handler( Extension(service): Extension>, @@ -200,7 +200,7 @@ pub async fn submit_project_handler( (status = 401, description = "Unauthorized") ), tag = "Hackathon - Submissions", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn confirm_submission_handler( Extension(service): Extension>, @@ -241,7 +241,7 @@ pub async fn confirm_submission_handler( (status = 401, description = "Unauthorized") ), tag = "Hackathon - Submissions", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn cancel_submission_handler( Extension(service): Extension>, diff --git a/imphnen-hackathon/src/teams/infrastructure/http/handlers.rs b/imphnen-hackathon/src/teams/infrastructure/http/handlers.rs index c9a9f40..233978f 100644 --- a/imphnen-hackathon/src/teams/infrastructure/http/handlers.rs +++ b/imphnen-hackathon/src/teams/infrastructure/http/handlers.rs @@ -52,7 +52,7 @@ use uuid::Uuid; (status = 401, description = "Unauthorized") ), tag = "Hackathon - Teams", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn create_team_handler( Extension(service): Extension>, @@ -212,7 +212,7 @@ pub async fn browse_teams_handler( (status = 401, description = "Unauthorized") ), tag = "Hackathon - Teams", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn get_my_teams_handler( Extension(service): Extension>, @@ -261,7 +261,7 @@ pub async fn get_my_teams_handler( (status = 403, description = "Forbidden - not team leader") ), tag = "Hackathon - Teams", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn update_team_handler( Extension(service): Extension>, @@ -286,7 +286,7 @@ pub async fn update_team_handler( (status = 403, description = "Forbidden - not team leader") ), tag = "Hackathon - Teams", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn delete_team_handler( Extension(service): Extension>, @@ -307,7 +307,7 @@ pub async fn delete_team_handler( (status = 401, description = "Unauthorized") ), tag = "Hackathon - Teams", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn leave_team_handler( Extension(service): Extension>, @@ -332,7 +332,7 @@ pub async fn leave_team_handler( (status = 403, description = "Forbidden - not team leader") ), tag = "Hackathon - Teams", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn remove_member_handler( Extension(service): Extension>, diff --git a/imphnen-hackathon/src/users/infrastructure/http/handlers.rs b/imphnen-hackathon/src/users/infrastructure/http/handlers.rs index 03849c7..42e62a0 100644 --- a/imphnen-hackathon/src/users/infrastructure/http/handlers.rs +++ b/imphnen-hackathon/src/users/infrastructure/http/handlers.rs @@ -31,7 +31,7 @@ use uuid::Uuid; (status = 401, description = "Unauthorized") ), tag = "Hackathon - Users", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn get_me_handler( Extension(service): Extension>, @@ -67,7 +67,7 @@ pub async fn get_me_handler( (status = 401, description = "Unauthorized") ), tag = "Hackathon - Users", - security(("bearer_auth" = [])) + security(("Bearer" = [])) )] pub async fn update_me_handler( Extension(service): Extension>,