Add chunk uploading #126
Labels
No labels
P0
P1
P2
P3
good first issue
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-s3-gw#126
Loading…
Reference in a new issue
No description provided.
Delete branch "ironbee/frostfs-s3-gw:add-chunk-reader"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Signed-off-by: Artem Tataurov a.tataurov@yadro.com
Closes #106
e6381badf5
to01c32351f3
01c32351f3
toe469e2fc40
WIP: Temporary committo WIP: Add chunk uploaderWIP: Add chunk uploaderto WIP: Add chunk uploadinge469e2fc40
to27256db8ed
27256db8ed
toe47e50a4df
e47e50a4df
to583259c598
583259c598
toffb1f60161
ffb1f60161
to01f119c6ca
01f119c6ca
tof659d0f98d
WIP: Add chunk uploadingto Add chunk uploadingf659d0f98d
tob603a34c28
@ -232,6 +232,24 @@ func (h *handler) PutObjectHandler(w http.ResponseWriter, r *http.Request) {
Encryption: encryptionParams,
}
if api.IsSignedStreamingV4(r) {
Let's move this to separate function
What is meant by "this" here?
b603a34c28/api/handler/put.go (L235-L251)
@ -235,0 +240,4 @@
errors.GetAPIError(errors.ErrMissingContentLength))
}
} else {
h.logAndSendError(w, "expecting decode content length information", reqInfo,
After
h.logAndSendError
we must usereturn
statementTo check this we can use for example test:
@ -0,0 +169,4 @@
// that the received signature matches our computed signature.
calculatedSignature, err := c.streamSigner.GetSignature(nil, c.buffer, c.requestTime)
if string(signature[16:]) != hex.EncodeToString(calculatedSignature) {
Why don't we check the
err
here?@ -100,2 +105,4 @@
require.Equal(t, "dfbe886241d9e369cf4b329ca0f15eb27306c97aa1022cc0bb5a914c4ef87634", signature)
}
func TestChunkUploadSigning(t *testing.T) {
Actually this test doesn't check signature.
Let's rework it to:
Or just replace printlns with asserts.
Yes, but then we check only validity of v4 stream signature (already existed code) rather than validity of handlers and proper invoking v4 stream signature ( new code in this PR)
@ -109,1 +115,4 @@
}
func IsSignedStreamingV4(r *http.Request) bool {
return r.Header.Get(AmzContentSha256) == StreamingContentSHA256 &&
Shouldn't we also check the
content-encoding
for containingaws-chunked
?@ -42,6 +45,7 @@ func AuthMiddleware(log *zap.Logger, center auth.Center) mux.MiddlewareFunc {
if !box.ClientTime.IsZero() {
Client time is required to work with chunk payloads. However
center.Authenticate
might not set it depending onneedClientTime
flag which is set whenX-Amz-Algorithm != AWS4-HMAC-SHA256
. So my question to @dkirillov, would it be a bit more error prone if we set client time for all requests as long as it is available inX-Amz-Date
?Actually, we don't use client time when we get request with presigned url. But I wouldn't say that it be more error prone if we set client (signature) time for all request with
X-Amz-Date
(probably we should use justDate
ifX-Amz-Date
is missed)And we can use s3-gw time for some specific cases
LGTM, see 1, 2, 3 and 4 comments.
b603a34c28
tof3239461b3
f3239461b3
to7cc0c4822a
@ -235,0 +237,4 @@
_, err := strconv.Atoi(decodeContentSize)
if err != nil {
h.logAndSendError(w, "cannot parse decode content length information", reqInfo,
errors.GetAPIError(errors.ErrMissingContentLength))
I think you missed
return
here too, as it is done inapi/handler/put.go
7cc0c4822a
to614d703726
LGTM. We will consider compatibility profiles later.
Content-Encoding
header in chunked payload based on kludge flag #146