[pbs-devel] [PATCH proxmox 16/17] proxmox-auth-api: update to hyper 1.0
Fabian Grünbichler
f.gruenbichler at proxmox.com
Wed Mar 26 16:23:20 CET 2025
and switch to proxmox-http's Body type
Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
proxmox-auth-api/Cargo.toml | 2 ++
proxmox-auth-api/src/api/access.rs | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/proxmox-auth-api/Cargo.toml b/proxmox-auth-api/Cargo.toml
index c5468ca7..a25b4832 100644
--- a/proxmox-auth-api/Cargo.toml
+++ b/proxmox-auth-api/Cargo.toml
@@ -32,6 +32,7 @@ serde = { workspace = true, optional = true, features = [ "derive" ] }
serde_json = { workspace = true, optional = true }
serde_plain = { workspace = true, optional = true }
+proxmox-http = { workspace = true, optional = true, features = ["body"] }
proxmox-product-config = { workspace = true, optional = true }
proxmox-rest-server = { workspace = true, optional = true }
proxmox-router = { workspace = true, optional = true }
@@ -53,6 +54,7 @@ api = [
"dep:hyper",
"dep:serde_json",
+ "dep:proxmox-http",
"dep:proxmox-rest-server",
"dep:proxmox-router",
"dep:proxmox-tfa",
diff --git a/proxmox-auth-api/src/api/access.rs b/proxmox-auth-api/src/api/access.rs
index 396935f5..8557362e 100644
--- a/proxmox-auth-api/src/api/access.rs
+++ b/proxmox-auth-api/src/api/access.rs
@@ -3,10 +3,10 @@
use anyhow::{bail, format_err, Error};
use http::request::Parts;
use http::Response;
-use hyper::Body;
use openssl::hash::MessageDigest;
use serde_json::{json, Value};
+use proxmox_http::Body;
use proxmox_rest_server::{extract_cookie, RestEnvironment};
use proxmox_router::{
http_err, ApiHandler, ApiMethod, ApiResponseFuture, Permission, RpcEnvironment,
@@ -173,7 +173,7 @@ fn create_ticket_http_only(
}
}
- Ok(response.body(Body::from(json!({"data": ticket_response }).to_string()))?)
+ Ok(response.body(json!({"data": ticket_response }).to_string().into())?)
})
}
--
2.39.5
More information about the pbs-devel
mailing list