-
Notifications
You must be signed in to change notification settings - Fork 367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[s3 gateway] Handle all path characters in SigV2 and add Nessie S3-ish test #2464
Conversation
a7588b2
to
8f2794f
Compare
f7c2b54
to
bac9681
Compare
c45837f
to
1b9109c
Compare
02b2315
to
6f9f5dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
We really needed these tests,
Thanks!
pkg/gateway/sig/v4.go
Outdated
@@ -277,6 +277,7 @@ func (ctx *verificationCtx) getAmzDate() (string, error) { | |||
// parse signature date | |||
sigTS, err := time.Parse(v4shortTimeFormat, ctx.AuthValue.Date) | |||
if err != nil { | |||
fmt.Printf("[DEBUG] failed to parse auth-date %s by %s: %s\n", ctx.AuthValue.Date, v4shortTimeFormat, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove or change to log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😢 sorry, thanks!
nessie/s3_gateway_test.go
Outdated
download, err := client.GetObject( | ||
ctx, repo, o.Path, minio.GetObjectOptions{}) | ||
if err != nil { | ||
t.Error(fmt.Sprintf("minio.Client.GetObject(%s): %s", o.Path, err)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use t.Errorf ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, that was silly of me.
nessie/s3_gateway_test.go
Outdated
Secure: false, | ||
}) | ||
if err != nil { | ||
t.Error(fmt.Sprintf("minio.New: %s", err)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why aren't you returning in case of error? will be hard to continue without a client
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Dying fatally outside the goroutine when this fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
nessie/s3_gateway_test.go
Outdated
download, err := client.GetObject( | ||
ctx, repo, o.Path, minio.GetObjectOptions{}) | ||
if err != nil { | ||
t.Error(fmt.Sprintf("minio.Client.GetObject(%s): %s", o.Path, err)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, that was silly of me.
nessie/s3_gateway_test.go
Outdated
Secure: false, | ||
}) | ||
if err != nil { | ||
t.Error(fmt.Sprintf("minio.New: %s", err)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Dying fatally outside the goroutine when this fails.
Use the minIO client to test S3 uploads and downloads with both V2 and V4 signatures. (Unlike the AWS S3 client, the minIO client supports signing using SigV2.)
(Timed out on GCP)
Sign using minio, verify using gateway code.
Also increase parallelism somewhat.
f54ba60
to
a0ed39f
Compare
Use correctly-coded path when checking sigV2 signatures in the S3 gateway.
Use the minIO client to test S3 uploads and downloads with both V2 and V4
signatures. (Unlike the AWS S3 client, the minIO client supports signing
using SigV2.)