All contributions

versity/versitygw

Versity Gateway

An S3-compatible object storage server that exposes a plain filesystem or Azure Blob storage through Amazon's API. Written in Go.

Language
Go
GitHub stars
3,157
Merged changes
12
Project site
versity.com

What we changed

Twelve S3 compatibility fixes: paging in ListMultipartUploads and ListObjects, the right error codes for malformed paths, an empty DeleteObjects and conflicting parameters, region checks in CreateBucket and ListBuckets, and GetObjectAttributes requiring read access to the object.

What this work shows

  • Amazon S3 API compatibility
  • Marker-based list pagination
  • HTTP error codes and request validation
  • Integration tests with the AWS SDK for Go
What was broken

Paging with upload-id-marker did not work

ListMultipartUploads returns the multipart uploads in progress. The posix and azure backends dropped every upload of the key-marker before listing, so asking for the next page with the markers from the previous response failed with Invalid uploadId marker. An upload-id-marker without a key-marker was ignored for the listing but still echoed back in UploadIdMarker.

How we fixed it

Markers behave as in S3

When an upload-id-marker is set, posix and azure keep the uploads of the key-marker and the listing continues right after the given upload. A lone upload-id-marker is cleared in the controller, so every backend gets the same input and the response has an empty UploadIdMarker.

#2477 #2472

What was broken

The upload list misreported its own end

With an upload-id-marker the lister passed an index from a sub-slice to hasMoreAfter, so a page ending on the last upload was still marked IsTruncated and the client sent one more request for an empty page. NextKeyMarker and NextUploadIdMarker were only set on a truncated listing, while S3 fills them with the last upload on a single page too.

How we fixed it

IsTruncated computed on the full list

The loop now walks the full list from startIndex, so IsTruncated comes from the absolute index. A non-truncated page reports its last upload in both next markers, and a page of only common prefixes keeps them empty as before.

#2475 #2476

What was broken

uploads and uploadId together reached the listing

A bucket GET carrying both uploads and uploadId was handled as a normal ListMultipartUploads, although S3 rejects that combination.

How we fixed it

A 400 for conflicting parameters

An error route now sits ahead of the normal routes for every HTTP method, at bucket and object level. It returns 400 InvalidArgument with the message Conflicting query string parameters: uploadId, uploads, as S3 does.

#2470

What was broken

ListObjects V1 differed from S3

Version 1 of the object listing returned NextMarker even without a delimiter, although S3 only does so with one. The start-after and continuation-token parameters, which belong to ListObjectsV2, were silently ignored.

How we fixed it

NextMarker only with a delimiter, V2 args rejected

Without a delimiter the response has no NextMarker and the client uses the last key as the marker for the next page. start-after and continuation-token, even when empty, get 400 InvalidArgument with the same message as S3.

#2506 #2505

What was broken

Regions in requests were checked wrongly

A gateway running outside us-east-1 accepted CreateBucket without a LocationConstraint and answered a foreign region with InvalidLocationConstraint instead of the error AWS returns. ListBuckets ignored the bucket-region parameter and let even the value abc through.

How we fixed it

Region errors that match AWS

A new ValidateLocationConstraint returns IllegalLocationConstraintException for a missing or foreign region, while us-east-1 still takes no constraint. bucket-region is checked against the AWS region code format: the gateway region passes in any letter case, and any other region gets the regional endpoint error.

#2474 #2389

What was broken

Wrong error codes for faulty requests

A path with a malformed escape, such as /bucket/%zz, ended in DecodeURL as a 500 InternalError. DeleteObjects with an empty Delete element returned 200 and an empty result, although the S3 schema requires at least one object.

How we fixed it

400 InvalidURI and MalformedXML

A malformed path escape now returns 400 InvalidURI, and the website handler passes that error through. An empty DeleteObjects gets MalformedXML before anything reaches the backend, which a test now guards.

#2473 #2471

What was broken

Object attributes without read access to it

GetObjectAttributes only checked s3:GetObjectAttributes, or s3:GetObjectVersionAttributes with a versionId. AWS also requires s3:GetObject or s3:GetObjectVersion for it, so a policy granting only the attributes action let through requests that S3 rejects. An anonymous request was served when the bucket policy granted that action publicly, although AWS never serves it.

How we fixed it

A pair of actions and a refusal for anonymous calls

A new ObjectAttributesActions function returns the pair of actions depending on versionId, and the controller requires both. An anonymous GetObjectAttributes is refused up front with 403 AccessDenied and the message Request has no authentication!, as AWS does. Integration tests cover the denials with a single action, actions split between the bucket and identity policies, and a public bucket.

#2672

Merged changes 12

  1. #2672 fix: require s3:GetObject along with s3:GetObjectAttributes Merged 19 November 2026
  2. #2506 fix: return NextMarker in ListObjects only when a delimiter is set Merged 13 October 2026
  3. #2505 fix: reject the start-after query in ListObjects (V1) Merged 13 October 2026
  4. #2475 fix: compute IsTruncated from the absolute index in ListMultipartUploads Merged 8 October 2026
  5. #2474 fix: validate and apply the ListBuckets bucket-region query Merged 7 October 2026
  6. #2477 fix: drop upload-id-marker without key-marker in ListMultipartUploads Merged 5 October 2026
  7. #2476 fix: report the last upload in ListMultipartUploads next markers on a single page Merged 5 October 2026
  8. #2473 fix: return InvalidURI for a malformed escape in the request path Merged 5 October 2026
  9. #2472 fix: accept upload-id-marker together with key-marker in ListMultipartUploads Merged 5 October 2026
  10. #2471 fix: return MalformedXML for a DeleteObjects request without objects Merged 5 October 2026
  11. #2470 fix: reject ListMultipartUploads requests that also carry uploadId Merged 5 October 2026
  12. #2389 Return IllegalLocationConstraintException for a mismatched LocationConstraint Merged 14 September 2026

What it taught us

Compatibility with someone else's API is decided by a single XML field and error code. Every difference from S3 is closed with an integration test that reproduces it.

More about this technology: Golang

Other projects we write code for

Describe your project.

A free quote comes back within an hour during working hours.