Skip to content

v0.40.0

Choose a tag to compare

@github-actions github-actions released this 04 Dec 12:10
· 6 commits to main since this release
5ea45b1

Highlights

  • A virtual-hosted-style PutObject could return 200 without storing the object, from v0.4.0 through v0.39.0 (#596, fixes #595). s2-server treated PUT /hello.txt on a bucket host as a CreateBucket request for hello.txt, discarding the body, and wrote dir/hello.txt into bucket dir when that bucket existed. Upgrading alone fixes only part of this: see s2-server operators below, and docs/upgrading.md for checking past damage.
  • s2-server serves virtual-hosted-style requests under the domains in S2_SERVER_DOMAINS (#599, fixes #594), alongside path-style requests on the same listener. With the variable unset, routing is unchanged.

Changes

Features

  • server: S2_SERVER_DOMAINS (domains in the config file) serves requests to <bucket>.<domain> in virtual-hosted style (#599, fixes #594)

Changed

  • server: SigV4 now requires host among the signed headers, in both addressing styles; a request or presigned URL that leaves it out returns 403 SignatureDoesNotMatch, where v0.39.0 accepted it (#599)
  • s3api: CompleteMultipartUpload returns Location as an absolute URL in the style of the request; it was /<bucket>/<key> (#599)

Fixed

  • s3api: CreateBucket with a body that is not a well-formed CreateBucketConfiguration returns 400 MalformedXML and creates nothing; it returned 200 and created the bucket (#596, fixes #595)

Dependencies

  • s3, server: aws-sdk-go-v2 1.48.2, service/s3 1.117.0, smithy-go 1.28.11 and related modules (#597)
  • gcs: cloud.google.com/go/storage 1.71.1, google.golang.org/api 0.317.0 (#597)
  • server: chromedp 0.24.1, cdproto 0.160.12 (#598)

Documentation

  • README: a "Virtual-hosted-style requests" section and MINIO_DOMAIN → S2_SERVER_DOMAINS in the MinIO migration table (#599)
  • README and docs/backends.md link s2-sql, a SQLite and PostgreSQL backend in its own repository (#592)
  • README: the Go-native benchmark table is re-measured in one run (#593)

CI / Build

  • Bump intra-repo deps to v0.39.0 for cmd/s2-server (#591)

Upgrading

  • Submodule consumers: go get github.com/mojatter/s2/<module>@v0.40.0
  • s2-server operators running the image: docker pull mojatter/s2-server:0.40.0 (:latest points at it too)
  • cmd/s2-server/v0.40.0 is published separately, shortly after: go install github.com/mojatter/s2/cmd/s2-server@v0.40.0
  • No module's go directive changed and go.work is unchanged since v0.39.0.
  • No change to the data at rest; downgrading to v0.39.0 is safe for the data but reintroduces the misrouted PutObject behaviour, see docs/upgrading.md.

Library users

  • No API or behaviour change in s2, fs, s3, gcs, azblob or s2env; only dependency versions changed. server gains Config.Domains, EnvS2ServerDomains and SignedPath, and a program that embeds server gets the operator changes below.

Storage implementers

  • Nothing changes. s2test is unchanged.

s2-server operators

  • Upgrading alone does not stop every misrouted PutObject. From a client that puts the bucket in the host name, a zero-byte PutObject of a key with no / inside, a folder marker such as photos/ included, still returns 200 and creates a bucket named after the key, and a key with a / inside is still written to the bucket named after its first segment when that bucket exists. Both stop once you set S2_SERVER_DOMAINS and make <bucket>.<domain> resolve to the server, or switch the client to path style. A PutObject that returns 400 MalformedXML, or 400 MaxMessageLengthExceeded for a body over 8 MiB, is the sign of such a client. Then check for past damage: docs/upgrading.md.
  • With authentication on, a signer that leaves host out of SignedHeaders now gets 403 SignatureDoesNotMatch on every request, with or without S2_SERVER_DOMAINS; aws-sdk-go-v2 and the AWS CLI v2 always sign it, so check a signer you wrote yourself before upgrading.
  • Once S2_SERVER_DOMAINS is set, the health path (/healthz by default) requested on a bucket host is read as an object key in that bucket, not as the health check. Point load-balancer probes at the domain itself or at another host name.
  • CompleteMultipartUpload's Location is now http://<host>/<bucket>/<key> where it was /<bucket>/<key>.

Full Changelog

v0.39.0...v0.40.0