9362a10
ZhenYi
refactor: remove OAuth-related modules and update references for identity service integration
9362a10
use actix_web::web;
pub fn configure(cfg: &mut web::ServiceConfig) {
cfg.route(
"/health",
web::get().to(crate::server::http::health::health),
);
cfg.route("/ready", web::get().to(crate::server::http::health::ready));
cfg.service(web::scope("/api/v1").configure(api));
}
fn api(cfg: &mut web::ServiceConfig) {
cfg.route(
"/oauth/socket-tickets",
web::post().to(crate::server::http::socket_ticket::issue),
);
cfg.route(
"/oauth/socket-tickets",
web::method(actix_web::http::Method::OPTIONS).to(crate::server::http::cors::preflight),
);
cfg.route(
"/oauth/challenge",
web::post().to(crate::server::http::challenge::handler::challenge),
);
cfg.route(
"/oauth/login",
web::post().to(crate::server::http::login::handler::login),
);
cfg.route(
"/oauth/login/code",
web::post().to(crate::server::http::login::handler::login_code),
);
cfg.route(
"/oauth/login/code/verify",
web::post().to(crate::server::http::login::handler::login_code_verify),
);
cfg.route(
"/oauth/login/verify",
web::post().to(crate::server::http::login::handler::login_verify),
);
cfg.route(
"/oauth/session/logout",
web::post().to(crate::server::http::logout::handler::logout),
);
cfg.route(
"/oauth/me",
web::get().to(crate::server::http::me::handler::me),
);
cfg.route(
"/oauth/register/code",
web::post().to(crate::server::http::register::handler::register_code),
);
cfg.route(
"/oauth/register",
web::post().to(crate::server::http::register::handler::register),
);
cfg.route(
"/oauth/password/reset",
web::post().to(crate::server::http::password_reset::handler::password_reset_request),
);
cfg.route(
"/oauth/password/reset/confirm",
web::post().to(crate::server::http::password_reset::handler::password_reset),
);
cfg.route(
"/oauth/access-tokens",
web::get().to(crate::server::http::access_token::handler::access_token_list),
);
cfg.route(
"/oauth/access-tokens",
web::post().to(crate::server::http::access_token::handler::access_token_create),
);
cfg.route(
"/oauth/access-tokens/{token_id}",
web::delete().to(crate::server::http::access_token::handler::access_token_revoke),
);
cfg.route(
"/oauth/access-tokens/{token_id}/rotate",
web::post().to(crate::server::http::access_token::handler::access_token_rotate),
);
cfg.route(
"/oauth/app-tokens",
web::post().to(crate::server::http::app_token::handler::app_token_issue),
);
cfg.route(
"/oauth/session/token",
web::post().to(crate::server::http::token::handler::token_issue),
);
cfg.route(
"/oauth/ssh-keys",
web::get().to(crate::server::http::ssh_key::handler::ssh_key_list),
);
cfg.route(
"/oauth/ssh-keys",
web::post().to(crate::server::http::ssh_key::handler::ssh_key_add),
);
cfg.route(
"/oauth/ssh-keys/{key_id}",
web::delete().to(crate::server::http::ssh_key::handler::ssh_key_delete),
);
cfg.route(
"/organizations",
web::post().to(crate::server::http::organization::handler::create_organization),
);
cfg.route(
"/organizations",
web::get().to(crate::server::http::organization::handler::list_organizations),
);
cfg.route(
"/organizations/invites/redeem",
web::post().to(crate::server::http::organization::handler::redeem_invite),
);
cfg.route(
"/organizations/{organization_id}",
web::get().to(crate::server::http::organization::handler::get_organization),
);
cfg.route(
"/organizations/{organization_id}",
web::patch().to(crate::server::http::organization::handler::update_organization),
);
cfg.route(
"/organizations/{organization_id}",
web::delete().to(crate::server::http::organization::handler::delete_organization),
);
cfg.route(
"/organizations/{organization_id}/archive",
web::post().to(crate::server::http::organization::handler::archive_organization),
);
cfg.route(
"/organizations/{organization_id}/restore",
web::post().to(crate::server::http::organization::handler::restore_organization),
);
cfg.route(
"/organizations/{organization_id}/transfer",
web::post().to(crate::server::http::organization::handler::transfer_ownership),
);
cfg.route(
"/organizations/{organization_id}/leave",
web::post().to(crate::server::http::organization::handler::leave_organization),
);
cfg.route(
"/organizations/{organization_id}/members",
web::get().to(crate::server::http::organization::handler::list_members),
);
cfg.route(
"/organizations/{organization_id}/members",
web::post().to(crate::server::http::organization::handler::add_member),
);
cfg.route(
"/organizations/{organization_id}/members/@me",
web::patch().to(crate::server::http::organization::handler::update_self_member),
);
cfg.route(
"/organizations/{organization_id}/members/{member_id}",
web::get().to(crate::server::http::organization::handler::get_member),
);
cfg.route(
"/organizations/{organization_id}/members/{member_id}",
web::patch().to(crate::server::http::organization::handler::update_member),
);
cfg.route(
"/organizations/{organization_id}/members/{member_id}",
web::delete().to(crate::server::http::organization::handler::remove_member),
);
cfg.route(
"/organizations/{organization_id}/members/{member_id}/role",
web::patch().to(crate::server::http::organization::handler::set_member_role),
);
cfg.route(
"/organizations/{organization_id}/members/{member_id}/ban",
web::post().to(crate::server::http::organization::handler::ban_member),
);
cfg.route(
"/organizations/{organization_id}/members/{member_id}/unban",
web::post().to(crate::server::http::organization::handler::unban_member),
);
cfg.route(
"/organizations/{organization_id}/members/{member_id}/permissions",
web::put().to(crate::server::http::organization::handler::set_member_permissions),
);
cfg.route(
"/organizations/{organization_id}/bans",
web::get().to(crate::server::http::organization::handler::list_bans),
);
cfg.route(
"/organizations/{organization_id}/bans/{user_id}",
web::get().to(crate::server::http::organization::handler::get_ban),
);
cfg.route(
"/organizations/{organization_id}/bans/{user_id}",
web::patch().to(crate::server::http::organization::handler::update_ban),
);
cfg.route(
"/organizations/{organization_id}/bans/{user_id}",
web::delete().to(crate::server::http::organization::handler::unban_by_user),
);
cfg.route(
"/organizations/{organization_id}/roles",
web::get().to(crate::server::http::organization::handler::list_roles),
);
cfg.route(
"/organizations/{organization_id}/roles",
web::post().to(crate::server::http::organization::handler::create_role),
);
cfg.route(
"/organizations/{organization_id}/roles/assign",
web::post().to(crate::server::http::organization::handler::assign_role),
);
cfg.route(
"/organizations/{organization_id}/roles/unassign",
web::post().to(crate::server::http::organization::handler::unassign_role),
);
cfg.route(
"/organizations/{organization_id}/roles/{role_id}",
web::get().to(crate::server::http::organization::handler::get_role),
);
cfg.route(
"/organizations/{organization_id}/roles/{role_id}",
web::patch().to(crate::server::http::organization::handler::update_role),
);
cfg.route(
"/organizations/{organization_id}/roles/{role_id}/join",
web::post().to(crate::server::http::organization::handler::join_role),
);
cfg.route(
"/organizations/{organization_id}/roles/{role_id}/join",
web::delete().to(crate::server::http::organization::handler::leave_role),
);
cfg.route(
"/organizations/{organization_id}/roles/{role_id}",
web::delete().to(crate::server::http::organization::handler::delete_role),
);
cfg.route(
"/organizations/{organization_id}/roles/{role_id}/permissions",
web::put().to(crate::server::http::organization::handler::set_role_permissions),
);
cfg.route(
"/organizations/{organization_id}/permissions/check",
web::post().to(crate::server::http::organization::handler::check_permission),
);
cfg.route(
"/organizations/{organization_id}/invites",
web::post().to(crate::server::http::organization::handler::create_invite),
);
cfg.route(
"/organizations/{organization_id}/invites",
web::get().to(crate::server::http::organization::handler::list_invites),
);
cfg.route(
"/organizations/{organization_id}/invites/{invite_id}",
web::delete().to(crate::server::http::organization::handler::revoke_invite),
);
}