Repository navigation
Conversation
The proxy policies middleware now passes the Content-Length of the request body and the TUS Upload-Length header to the policies engine as input.request.content_length and input.request.upload_length. This allows rejecting uploads that are too big before any data is transferred, instead of only in postprocessing after the upload has completed. We add them to the request instead of setting resource.size, because the resource describes the target of the request (the middleware may even stat it) and in postprocessing resource.size is the actual file size. This can only be an early check. The TUS concatenation extension allows merging several smaller uploads into one file, so the file size still has to be checked in postprocessing. protojson encodes uint64 values as strings with camelCase keys, so NewEnvironmentFromPB copies the lengths explicitly. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 5 |
🟢 Coverage 50.00% diff coverage · +0.01% coverage variation
Metric Results Coverage variation ✅ +0.01% coverage variation (-1.00%) Diff coverage ✅ 50.00% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (331855f) 93429 26714 28.59% Head commit (bd4325b) 93449 (+20) 26726 (+12) 28.60% (+0.01%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#3903) 20 10 50.00% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
micbar
approved these changes
Nov 5, 2026
butonic
marked this pull request as draft
November 5, 2026 14:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The proxy policies middleware now passes the declared request lengths to the policies engine:
input.request.content_length(Content-Length) andinput.request.upload_length(TUSUpload-Length). That allows rejecting too big uploads before any data is transferred:I put them on the request instead of
resource.size, because the resource is the target of the request (the middleware may even stat it) and in postprocessingresource.sizeis the actual file size.This can only be an early check. With the concatenation extension several smaller uploads can be merged into one file, so postprocessing still has to check
input.resource.size. A single PATCH can't exceed the declaredUpload-Length, tusd already answers 413 for that.protojson encodes uint64 as strings with camelCase keys, so
NewEnvironmentFromPBcopies the lengths explicitly instead of relying on the json round trip.needed for the proxy part of https://github.com/opencloud-eu/opencloud-charts/pull/367
I used Claude Code to dig through the proxy, policies, reva and tusd code, write the change and tests and draft the texts. I reviewed and tested the result.
Assisted-by: Claude Code:claude-opus-5-5