Compare commits

..

1 commit

Author SHA1 Message Date
4533b08f85 admin api: make all handlers impls of a single trait
All checks were successful
ci/woodpecker/push/debug Pipeline was successful
ci/woodpecker/pr/debug Pipeline was successful
2025-01-28 00:28:01 +01:00
3 changed files with 6 additions and 6 deletions

View file

@ -271,7 +271,7 @@ impl ApiHandler for AdminApiServer {
e => {
async {
let body = parse_request_body(e, req).await?;
let res = body.handle(&self.garage)?;
let res = body.handle(&self.garage).await?;
json_ok_response(&res)
}
.await

View file

@ -457,7 +457,7 @@ impl EndpointHandler for GlobalAliasBucketRequest {
type Response = GlobalAliasBucketResponse;
async fn handle(self, garage: &Arc<Garage>) -> Result<GlobalAliasBucketResponse, Error> {
let bucket_id = parse_bucket_id(&self.bucket_id)?;
let bucket_id = parse_bucket_id(&self.id)?;
let helper = garage.locked_helper().await;
@ -476,7 +476,7 @@ impl EndpointHandler for GlobalUnaliasBucketRequest {
type Response = GlobalUnaliasBucketResponse;
async fn handle(self, garage: &Arc<Garage>) -> Result<GlobalUnaliasBucketResponse, Error> {
let bucket_id = parse_bucket_id(&self.bucket_id)?;
let bucket_id = parse_bucket_id(&self.id)?;
let helper = garage.locked_helper().await;
@ -495,7 +495,7 @@ impl EndpointHandler for LocalAliasBucketRequest {
type Response = LocalAliasBucketResponse;
async fn handle(self, garage: &Arc<Garage>) -> Result<LocalAliasBucketResponse, Error> {
let bucket_id = parse_bucket_id(&self.bucket_id)?;
let bucket_id = parse_bucket_id(&self.id)?;
let helper = garage.locked_helper().await;
@ -514,7 +514,7 @@ impl EndpointHandler for LocalUnaliasBucketRequest {
type Response = LocalUnaliasBucketResponse;
async fn handle(self, garage: &Arc<Garage>) -> Result<LocalUnaliasBucketResponse, Error> {
let bucket_id = parse_bucket_id(&self.bucket_id)?;
let bucket_id = parse_bucket_id(&self.id)?;
let helper = garage.locked_helper().await;

View file

@ -59,7 +59,7 @@ impl EndpointHandler for GetKeyInfoRequest {
unreachable!();
};
Ok(key_info_results(garage, key, self.show_secret_key).await)
Ok(key_info_results(garage, key, self.show_secret_key).await?)
}
}