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) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
852e9652ee
commit
729335014f
@@ -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<Arc<dyn QrCampaignService>>,
|
||||
@@ -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<Arc<dyn QrCampaignService>>,
|
||||
@@ -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<Arc<dyn QrCampaignService>>,
|
||||
@@ -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<Arc<dyn QrCampaignService>>,
|
||||
@@ -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<Arc<dyn QrCampaignService>>,
|
||||
|
||||
@@ -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<Arc<dyn QrUserService>>,
|
||||
@@ -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<Arc<dyn QrUserService>>,
|
||||
@@ -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<Arc<dyn QrUserService>>,
|
||||
@@ -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<Arc<dyn QrUserService>>,
|
||||
@@ -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<Arc<dyn QrUserService>>,
|
||||
|
||||
@@ -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<Arc<dyn AdminService>>,
|
||||
@@ -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<Arc<dyn AdminService>>,
|
||||
@@ -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<Arc<dyn AdminService>>,
|
||||
@@ -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<Arc<dyn AdminService>>,
|
||||
@@ -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<Arc<dyn AdminService>>,
|
||||
@@ -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<Arc<dyn AdminService>>,
|
||||
@@ -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<Arc<dyn AdminService>>,
|
||||
@@ -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<Arc<dyn AdminService>>,
|
||||
@@ -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<Arc<dyn AdminService>>,
|
||||
@@ -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<Arc<dyn AdminService>>,
|
||||
|
||||
@@ -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<Arc<dyn ChatService>>,
|
||||
@@ -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<Arc<dyn ChatService>>,
|
||||
@@ -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<Arc<dyn ChatService>>,
|
||||
|
||||
@@ -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<Arc<dyn InvitationService>>,
|
||||
@@ -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<Arc<dyn InvitationService>>,
|
||||
@@ -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<Arc<dyn InvitationService>>,
|
||||
|
||||
@@ -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<Arc<dyn JoinRequestService>>,
|
||||
@@ -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<Arc<dyn JoinRequestService>>,
|
||||
@@ -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<Arc<dyn JoinRequestService>>,
|
||||
@@ -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<Arc<dyn JoinRequestService>>,
|
||||
|
||||
@@ -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<Arc<dyn StorageService>>,
|
||||
@@ -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<Arc<dyn StorageService>>,
|
||||
@@ -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<Arc<dyn StorageService>>,
|
||||
@@ -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<Arc<dyn StorageService>>,
|
||||
|
||||
@@ -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<Arc<dyn SubmissionService>>,
|
||||
@@ -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<Arc<dyn SubmissionService>>,
|
||||
@@ -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<Arc<dyn SubmissionService>>,
|
||||
@@ -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<Arc<dyn SubmissionService>>,
|
||||
@@ -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<Arc<dyn SubmissionService>>,
|
||||
@@ -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<Arc<dyn SubmissionService>>,
|
||||
|
||||
@@ -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<Arc<dyn TeamService>>,
|
||||
@@ -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<Arc<dyn TeamService>>,
|
||||
@@ -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<Arc<dyn TeamService>>,
|
||||
@@ -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<Arc<dyn TeamService>>,
|
||||
@@ -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<Arc<dyn TeamService>>,
|
||||
@@ -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<Arc<dyn TeamService>>,
|
||||
|
||||
@@ -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<Arc<dyn HackathonUserService>>,
|
||||
@@ -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<Arc<dyn HackathonUserService>>,
|
||||
|
||||
Reference in New Issue
Block a user