public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox] s3-client: drop unused optional object list v2 response fields
Date: Tue, 16 Sep 2025 16:52:20 +0200	[thread overview]
Message-ID: <20250916145220.727899-1-c.ebner@proxmox.com> (raw)

The ListObjectsV2 Response contains fields as bucket name, number of
keys, number of max keys of the response and prefix of the response
keys [0]. Since the AWS S3 API reference documentation does not
explicitly mention these fields as required, they are to be
considered optional and because they are currently not used other
than for response deserialization which will fail if missing, drop
these fields for now.

Fixes: https://forum.proxmox.com/threads/171899/
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
 proxmox-s3-client/src/response_reader.rs | 24 ------------------------
 1 file changed, 24 deletions(-)

diff --git a/proxmox-s3-client/src/response_reader.rs b/proxmox-s3-client/src/response_reader.rs
index c00c7bd4..c705c104 100644
--- a/proxmox-s3-client/src/response_reader.rs
+++ b/proxmox-s3-client/src/response_reader.rs
@@ -21,14 +21,6 @@ pub(crate) struct ResponseReader {
 pub struct ListObjectsV2Response {
     /// Parsed http date header from response.
     pub date: Option<HttpDate>,
-    /// Bucket name.
-    pub name: String,
-    /// Requested key prefix.
-    pub prefix: String,
-    /// Number of keys returned in this response.
-    pub key_count: u64,
-    /// Number of max keys the response can contain.
-    pub max_keys: u64,
     /// Flag indication if response was truncated because of key limits.
     pub is_truncated: bool,
     /// Token used for this request to get further keys in truncated responses.
@@ -44,14 +36,6 @@ pub struct ListObjectsV2Response {
 /// Subset of items used to deserialize a list objects v2 respsonse.
 /// https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html#API_ListObjectsV2_ResponseSyntax
 struct ListObjectsV2ResponseBody {
-    /// Bucket name.
-    pub name: String,
-    /// Requested key prefix.
-    pub prefix: String,
-    /// Number of keys returned in this response.
-    pub key_count: u64,
-    /// Number of max keys the response can contain.
-    pub max_keys: u64,
     /// Flag indication if response was truncated because of key limits.
     pub is_truncated: bool,
     /// Token used for this request to get further keys in truncated responses.
@@ -66,10 +50,6 @@ impl ListObjectsV2ResponseBody {
     fn with_optional_date(self, date: Option<HttpDate>) -> ListObjectsV2Response {
         ListObjectsV2Response {
             date,
-            name: self.name,
-            prefix: self.prefix,
-            key_count: self.key_count,
-            max_keys: self.max_keys,
             is_truncated: self.is_truncated,
             continuation_token: self.continuation_token,
             next_continuation_token: self.next_continuation_token,
@@ -550,10 +530,6 @@ fn parse_list_objects_v2_response_test() {
         </ListBucketResult>
     "#;
     let result: ListObjectsV2ResponseBody = serde_xml_rs::from_str(&response_body).unwrap();
-    assert_eq!(result.name, "bucket0");
-    assert_eq!(result.prefix, ".cnt");
-    assert_eq!(result.key_count, 2);
-    assert_eq!(result.max_keys, 1000);
     assert_eq!(result.is_truncated, false);
     assert_eq!(
         result.contents.unwrap(),
-- 
2.47.3



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


                 reply	other threads:[~2025-09-16 14:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250916145220.727899-1-c.ebner@proxmox.com \
    --to=c.ebner@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal