Skip to content

feat(router): report decrypted plaintext size in ListObjects responses#51

Open
pszafarczyk wants to merge 1 commit into
Intrinsec:mainfrom
pszafarczyk:ls-size
Open

feat(router): report decrypted plaintext size in ListObjects responses#51
pszafarczyk wants to merge 1 commit into
Intrinsec:mainfrom
pszafarczyk:ls-size

Conversation

@pszafarczyk

Copy link
Copy Markdown

ListObjects/ListObjectsV2 previously reported the at-rest ciphertext size (plaintext + 28-byte AES-GCM-SIV envelope). Intercept bucket-level list requests, subtract the fixed encryption overhead from every , and clamp at 0. Bucket sub-resource GETs (acl, versioning, multipart listings, ?versions, …) are still forwarded unchanged.

  • cryptoutil: export EncryptionOverhead constant + invariant test
  • router: bucketOnlyPattern + isListObjects, wired into getHandler
  • handler: extract forwardUpstream; add handleListObjects (buffer, rewrite on 2xx, fix Content-Length)
  • listsize: byte-preserving regex rewrite + unit tests
  • e2e: assert v1 and v2 listings report plaintext size

Known limitation: objects not written through the proxy (legacy plaintext, server-side copies, multipart) are reported 28 bytes short / 0 after clamp, since list responses carry no per-object encryption metadata.

ListObjects/ListObjectsV2 previously reported the at-rest ciphertext size
(plaintext + 28-byte AES-GCM-SIV envelope). Intercept bucket-level list
requests, subtract the fixed encryption overhead from every <Size>, and
clamp at 0. Bucket sub-resource GETs (acl, versioning, multipart listings,
?versions, …) are still forwarded unchanged.

- cryptoutil: export EncryptionOverhead constant + invariant test
- router: bucketOnlyPattern + isListObjects, wired into getHandler
- handler: extract forwardUpstream; add handleListObjects (buffer, rewrite
on 2xx, fix Content-Length)
- listsize: byte-preserving <Size> regex rewrite + unit tests
- e2e: assert v1 and v2 listings report plaintext size

Known limitation: objects not written through the proxy (legacy plaintext,
server-side copies, multipart) are reported 28 bytes short / 0 after clamp,
since list responses carry no per-object encryption metadata.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant