chore(repo): remove package removal route for now
parent
04715b0036
commit
777d57512e
18
CHANGELOG.md
18
CHANGELOG.md
|
@ -9,13 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
* Server
|
* Functional repository server
|
||||||
* Functional repository server
|
* Supports any number of repositories, grouped into distros, each
|
||||||
* Serve packages from any number of repositories & architectures
|
supporting any number of architectures
|
||||||
* Publish packages to and delete packages from repositories using HTTP
|
* Repository & package information available using JSON REST API
|
||||||
requests
|
* Queueing system with configurable number of workers for resilient
|
||||||
* Packages of architecture "any" are part of every architecture's
|
concurrency
|
||||||
database
|
* TOML configuration file
|
||||||
* Bearer authentication for private routes
|
* SQLite & Postgres support
|
||||||
* REST API
|
|
||||||
* Repository & package information available using JSON REST API
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ use axum::{
|
||||||
extract::{Path, State},
|
extract::{Path, State},
|
||||||
http::{Request, StatusCode},
|
http::{Request, StatusCode},
|
||||||
response::IntoResponse,
|
response::IntoResponse,
|
||||||
routing::{delete, post},
|
routing::{delete, get, post},
|
||||||
Router,
|
Router,
|
||||||
};
|
};
|
||||||
use futures::TryStreamExt;
|
use futures::TryStreamExt;
|
||||||
|
@ -27,12 +27,7 @@ pub fn router(api_key: &str) -> Router<crate::Global> {
|
||||||
)
|
)
|
||||||
// Routes added after the layer do not get that layer applied, so the GET requests will not
|
// Routes added after the layer do not get that layer applied, so the GET requests will not
|
||||||
// be authorized
|
// be authorized
|
||||||
.route(
|
.route("/:distro/:repo/:arch/:filename", get(get_file))
|
||||||
"/:distro/:repo/:arch/:filename",
|
|
||||||
delete(delete_package)
|
|
||||||
.route_layer(ValidateRequestHeaderLayer::bearer(api_key))
|
|
||||||
.get(get_file),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Serve the package archive files and database archives. If files are requested for an
|
/// Serve the package archive files and database archives. If files are requested for an
|
||||||
|
@ -129,28 +124,3 @@ async fn delete_arch_repo(
|
||||||
Ok(StatusCode::NOT_FOUND)
|
Ok(StatusCode::NOT_FOUND)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn delete_package(
|
|
||||||
State(_global): State<crate::Global>,
|
|
||||||
Path((_distro, _repo, _arch, _pkg_name)): Path<(String, String, String, String)>,
|
|
||||||
) -> crate::Result<StatusCode> {
|
|
||||||
Ok(StatusCode::NOT_FOUND)
|
|
||||||
//if let Some(mgr) = global.mgr.get_mgr(&distro).await {
|
|
||||||
// let pkg_removed = mgr.remove_pkg(&repo, &arch, &pkg_name).await?;
|
|
||||||
//
|
|
||||||
// if pkg_removed {
|
|
||||||
// tracing::info!(
|
|
||||||
// "Removed package '{}' ({}) from repository '{}'",
|
|
||||||
// pkg_name,
|
|
||||||
// arch,
|
|
||||||
// repo
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// Ok(StatusCode::OK)
|
|
||||||
// } else {
|
|
||||||
// Ok(StatusCode::NOT_FOUND)
|
|
||||||
// }
|
|
||||||
//} else {
|
|
||||||
// Ok(StatusCode::NOT_FOUND)
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue