---
title: "Versity Gateway: S3 listing and error parity in Go | VulCode"
description: "Amazon S3 compatibility fixes in Versity Gateway, written in Go: paging in ListMultipartUploads and ListObjects, S3 error codes and region validation."
url: "https://vulcode.com/en/opensource/contributions/versitygw"
lang: "en"
---

[All contributions](https://vulcode.com/en/opensource/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.

[See the repository](https://github.com/versity/versitygw) [All contributions](https://vulcode.com/en/opensource/contributions)

- **Language**: Go
- **GitHub stars**: 3,157
- **Merged changes**: 12
- **Project site**: [versity.com](https://www.versity.com/products/versitygw/)

## 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](https://github.com/versity/versitygw/pull/2477) [#2472](https://github.com/versity/versitygw/pull/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](https://github.com/versity/versitygw/pull/2475) [#2476](https://github.com/versity/versitygw/pull/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](https://github.com/versity/versitygw/pull/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](https://github.com/versity/versitygw/pull/2506) [#2505](https://github.com/versity/versitygw/pull/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](https://github.com/versity/versitygw/pull/2474) [#2389](https://github.com/versity/versitygw/pull/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](https://github.com/versity/versitygw/pull/2473) [#2471](https://github.com/versity/versitygw/pull/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](https://github.com/versity/versitygw/pull/2672)

## Merged changes 12

- [#2672 fix: require s3:GetObject along with s3:GetObjectAttributes Merged 19 November 2026](https://github.com/versity/versitygw/pull/2672)

- [#2506 fix: return NextMarker in ListObjects only when a delimiter is set Merged 13 October 2026](https://github.com/versity/versitygw/pull/2506)

- [#2505 fix: reject the start-after query in ListObjects (V1) Merged 13 October 2026](https://github.com/versity/versitygw/pull/2505)

- [#2475 fix: compute IsTruncated from the absolute index in ListMultipartUploads Merged 8 October 2026](https://github.com/versity/versitygw/pull/2475)

- [#2474 fix: validate and apply the ListBuckets bucket-region query Merged 7 October 2026](https://github.com/versity/versitygw/pull/2474)

- [#2477 fix: drop upload-id-marker without key-marker in ListMultipartUploads Merged 5 October 2026](https://github.com/versity/versitygw/pull/2477)

- [#2476 fix: report the last upload in ListMultipartUploads next markers on a single page Merged 5 October 2026](https://github.com/versity/versitygw/pull/2476)

- [#2473 fix: return InvalidURI for a malformed escape in the request path Merged 5 October 2026](https://github.com/versity/versitygw/pull/2473)

- [#2472 fix: accept upload-id-marker together with key-marker in ListMultipartUploads Merged 5 October 2026](https://github.com/versity/versitygw/pull/2472)

- [#2471 fix: return MalformedXML for a DeleteObjects request without objects Merged 5 October 2026](https://github.com/versity/versitygw/pull/2471)

- [#2470 fix: reject ListMultipartUploads requests that also carry uploadId Merged 5 October 2026](https://github.com/versity/versitygw/pull/2470)

- [#2389 Return IllegalLocationConstraintException for a mismatched LocationConstraint Merged 14 September 2026](https://github.com/versity/versitygw/pull/2389)

## 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](https://vulcode.com/en/technologies/go)

## Other projects we write code for

- [**urfave/cli** Go · 24,329 stars A declarative Go package for building command line tools.](https://vulcode.com/en/opensource/contributions/urfave-cli)

- [**chezmoi** Go · 22,342 stars A dotfiles manager that keeps the same settings on many different machines, securely.](https://vulcode.com/en/opensource/contributions/chezmoi)

- [**goquery** Go · 14,995 stars A Go library for traversing and changing HTML documents in the style of jQuery, built on the golang.org/x/net/html parser.](https://vulcode.com/en/opensource/contributions/goquery)

- [**Ebitengine** Go · 13,647 stars A 2D game engine in Go, used in games released for computers, phones, browsers and consoles.](https://vulcode.com/en/opensource/contributions/ebiten)

- [**Fission** Go · 8,950 stars A serverless functions framework for Kubernetes that runs code as functions and scales them down to zero when they are idle.](https://vulcode.com/en/opensource/contributions/fission)

- [**Concourse** Go · 7,944 stars A container-based automation system written in Go and used mostly for CI/CD. Pipelines and tasks are described in YAML files.](https://vulcode.com/en/opensource/contributions/concourse)

## Describe your project.

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

### Rather skip the form?

Ask in the chat or write to us directly.

Open the chat

- **Email**: [hello@vulcode.com](mailto:hello@vulcode.com)
- **Phone**: [+48 576 043 920](tel:+48576043920)
- **Discord**: [discord.gg/vulcode](https://discord.gg/vulcode)
