4028f0d943
- Reordered actix-web imports to standardize import order - Reordered crate module imports to follow alphabetical ordering - Updated function calls to use multi-line formatting for better readability - Standardized blank lines around documentation comments - Applied consistent formatting to response handling methods - Normalized import organization across all repository-related API files - Improved code consistency and maintainability through standardized formatting - Applied formatting updates to all repository endpoint implementations
115 lines
3.9 KiB
Rust
115 lines
3.9 KiB
Rust
pub mod add_gpg_key;
|
|
pub mod add_ssh_key;
|
|
pub mod delete_account;
|
|
pub mod delete_device;
|
|
pub mod delete_gpg_key;
|
|
pub mod delete_ssh_key;
|
|
pub mod get_account;
|
|
pub mod get_appearance;
|
|
pub mod get_notifications;
|
|
pub mod get_profile;
|
|
pub mod list_devices;
|
|
pub mod list_gpg_keys;
|
|
pub mod list_oauth_accounts;
|
|
pub mod list_personal_access_tokens;
|
|
pub mod list_security_logs;
|
|
pub mod list_sessions;
|
|
pub mod list_ssh_keys;
|
|
pub mod revoke_personal_access_token;
|
|
pub mod revoke_session;
|
|
pub mod unlink_oauth;
|
|
pub mod update_account;
|
|
pub mod update_appearance;
|
|
pub mod update_notifications;
|
|
pub mod update_profile;
|
|
pub mod upload_avatar;
|
|
|
|
use actix_web::web;
|
|
|
|
pub fn configure(cfg: &mut web::ServiceConfig) {
|
|
cfg.service(
|
|
web::scope("/user")
|
|
// Account
|
|
.route("/account", web::get().to(get_account::get_account))
|
|
.route("/account", web::put().to(update_account::update_account))
|
|
.route(
|
|
"/account/avatar",
|
|
web::post().to(upload_avatar::upload_avatar),
|
|
)
|
|
.route("/account", web::delete().to(delete_account::delete_account))
|
|
// Appearance
|
|
.route("/appearance", web::get().to(get_appearance::get_appearance))
|
|
.route(
|
|
"/appearance",
|
|
web::put().to(update_appearance::update_appearance),
|
|
)
|
|
// Profile
|
|
.route("/profile", web::get().to(get_profile::get_profile))
|
|
.route("/profile", web::put().to(update_profile::update_profile))
|
|
// Notifications
|
|
.route(
|
|
"/notifications",
|
|
web::get().to(get_notifications::get_notifications),
|
|
)
|
|
.route(
|
|
"/notifications",
|
|
web::put().to(update_notifications::update_notifications),
|
|
)
|
|
// SSH Keys
|
|
.route("/keys/ssh", web::get().to(list_ssh_keys::list_ssh_keys))
|
|
.route("/keys/ssh", web::post().to(add_ssh_key::add_ssh_key))
|
|
.route(
|
|
"/keys/ssh/{key_id}",
|
|
web::delete().to(delete_ssh_key::delete_ssh_key),
|
|
)
|
|
// GPG Keys
|
|
.route("/keys/gpg", web::get().to(list_gpg_keys::list_gpg_keys))
|
|
.route("/keys/gpg", web::post().to(add_gpg_key::add_gpg_key))
|
|
.route(
|
|
"/keys/gpg/{key_id}",
|
|
web::delete().to(delete_gpg_key::delete_gpg_key),
|
|
)
|
|
// Security - Sessions
|
|
.route(
|
|
"/security/sessions",
|
|
web::get().to(list_sessions::list_sessions),
|
|
)
|
|
.route(
|
|
"/security/sessions/{session_id}",
|
|
web::delete().to(revoke_session::revoke_session),
|
|
)
|
|
// Security - Devices
|
|
.route(
|
|
"/security/devices",
|
|
web::get().to(list_devices::list_devices),
|
|
)
|
|
.route(
|
|
"/security/devices/{device_id}",
|
|
web::delete().to(delete_device::delete_device),
|
|
)
|
|
// Security - OAuth
|
|
.route(
|
|
"/security/oauth",
|
|
web::get().to(list_oauth_accounts::list_oauth_accounts),
|
|
)
|
|
.route(
|
|
"/security/oauth/{oauth_id}",
|
|
web::delete().to(unlink_oauth::unlink_oauth),
|
|
)
|
|
// Security - Logs
|
|
.route(
|
|
"/security/logs",
|
|
web::get().to(list_security_logs::list_security_logs),
|
|
)
|
|
// Security - Personal Access Tokens
|
|
.route(
|
|
"/security/tokens",
|
|
web::get().to(list_personal_access_tokens::list_tokens),
|
|
)
|
|
.route(
|
|
"/security/tokens/{token_id}",
|
|
web::delete().to(revoke_personal_access_token::revoke_token),
|
|
),
|
|
);
|
|
}
|