Skip to content
Clone
d5939db
23 lines 667 B Rust
use axum::extract::{Path, State};
use axum::http::StatusCode;
use jwt::extractor::AuthUser;
use uuid::Uuid;
use crate::error::RepoResult;
use crate::features::RepoService;
#[utoipa::path(
delete,
path = "/repo/{channel_id}/{repo_id}/keys/{key_id}",
tag = "repo",
responses((status = 204, description = "Delete a deploy key")),
security(("bearer_auth" = []))
)]
pub(crate) async fn handler(
State(svc): State<RepoService>,
AuthUser { claims }: AuthUser,
Path((_, repo_id, key_id)): Path<(Uuid, Uuid, Uuid)>,
) -> RepoResult<StatusCode> {
svc.delete_deploy_key(claims.sub, repo_id, key_id).await?;
Ok(StatusCode::NO_CONTENT)
}