Commit Graph

2244 Commits

Author SHA1 Message Date
Ben McClelland
0f92d0ef4f Merge pull request #1916 from versity/ben/azure-test-falures
azure test failure fixes
2026-03-05 17:07:41 -08:00
Ben McClelland
bcb7bc5f9a Merge pull request #1922 from versity/test/update_remove_some_utils
test: some util file updates, changes, removals
2026-03-05 17:07:25 -08:00
Ben McClelland
6281391bb9 Merge pull request #1920 from versity/sis/posix-object-metadata
fix: change the way object metadata is stored in posix
2026-03-05 17:07:05 -08:00
Ben McClelland
570723a5d9 Merge pull request #1924 from jacksgt/feat-helm-chart
feat: add Helm chart for versitygw
2026-03-05 14:08:27 -08:00
niksis02
97bb70509f fix: change the way object metadata is stored in posix
Fixes #1909

Previously, the mapping between object metadata and posix object was as follows: for each metadata key, we stored a separate xattr with the `user.X-Amz-Meta.<key>` prefix. This resulted in syscall overhead when storing and deleting large numbers of metadata keys.
In addition, very long metadata keys caused failures because most posix filesystems limit xattr key lengths to 127–255 bytes, while S3 does not enforce such a per-key limit.

The logic has now been changed so that all object metadata is stored in a single xattr, `user.metadata`, as a JSON key/value object. For backward compatibility, metadata GET operations still fall back to the old mechanism (`metadata key -> xattr key`) when `user.metadata` is not present.

A new CLI utility has been added to convert all legacy object metadata to the new metadata format within the provided directory.

**Example usage:**

```
versitygw utils convert-xattr-metadata path/to/bucket
```

or

```
versitygw utils cxm path/to/bucket
```

It is recommended to run this command on bucket directories to convert all legacy metadata for every object in the bucket.
2026-03-06 01:44:14 +04:00
Ben McClelland
1595d2cf7f Merge pull request #1929 from versity/ben/webui-policy
fix: webui pass correct arguments to request() in putBucketPolicy
2026-03-04 18:49:06 -08:00
Ben McClelland
11f3f53bd3 Merge pull request #1927 from versity/ben/webui-ipv6
fix: bracket IPv6 addresses in auto-detected webui gateway URLs
2026-03-04 18:48:53 -08:00
Jack Henschel
af1a99c4dc feat: add Helm chart for versitygw 2026-03-04 21:02:33 +01:00
Ben McClelland
07c970e3fe fix: webui pass correct arguments to request() in putBucketPolicy
The fifth parameter of request() is useAdminEndpoint (boolean), but
putBucketPolicy was passing a Content-Type header object instead.
This caused useAdminEndpoint to be truthy and contentType to default
to 'application/xml' instead of 'application/json'.

Fixed by passing false for useAdminEndpoint and 'application/json'
as the contentType argument.

Fixes #1928
2026-03-04 10:32:52 -08:00
Ben McClelland
8534d2829f fix: bracket IPv6 addresses in auto-detected webui gateway URLs
Use net.JoinHostPort instead of manual string formatting in
buildServiceURLs so IPv6 addresses are properly wrapped in brackets.
This fixes malformed URLs like "http://::1:7070" being presented as
the default server URL in the WebUI login form when listening on an
IPv6 address; they now correctly render as "http://[::1]:7070".

Fixes #1926
2026-03-04 09:43:47 -08:00
Luke McCrone
038ae5e1ea test: update functions, transfer/remove some utils files 2026-03-04 14:15:00 -03:00
Ben McClelland
afbeb7cb6e fix: azure modernize part number loop check
The part number loop check can be simplified with slices.Contains.
2026-03-03 08:58:31 -08:00
Ben McClelland
271313b036 fix: azure close download body in CopyObject to prevent resource leak
When copying between two different Azure blobs, the source download
stream body was only consumed by PutObject but never explicitly closed.
If PutObject or any subsequent step returned an error, the underlying
HTTP connection held by the Azure SDK was never released, leaking both
the connection and any internal SDK retry goroutines attached to it.
Added a deferred close on downloadResp.Body immediately after the
successful DownloadStream call to ensure the body is always drained and
released regardless of the outcome.
2026-03-03 08:58:31 -08:00
Ben McClelland
dc31696e53 fix: azure ListBuckets pagination to use client-side continuation tokens
Azure's ListContainers Marker parameter requires an opaque internal token
(e.g. /accountname/containername) rather than a plain container name, so
passing MaxResults and our ContinuationToken directly to the Azure API
caused 400 OutOfRangeInput errors. Rework ListBuckets to iterate all Azure
pages client-side, skip entries at or before the ContinuationToken (matching
the posix backend's "start after" semantics), and stop once MaxBuckets items
have been collected, setting ContinuationToken to the last returned bucket
name. This avoids using Azure's NextMarker entirely and correctly handles
both unpaginated and paginated requests.
2026-03-03 08:58:31 -08:00
Ben McClelland
929048cbee fix: azure PresignedAuth_UploadPart test failure
Azure Storage's StageBlock REST API rejects Content-Length: 0
with InvalidHeaderValue. The tests (PresignedAuth_UploadPart,
UploadPart_success) upload a nil/empty body, which causes the
Azure SDK to send Content-Length: 0. Azurite is lenient and
accepts it; real Azure Storage does not.

Use a new metadata key ("Zerobytesparts") sett on the
.sgwtmp/multipart/<uploadId>/<object-hash> blob to track and
0 length parts.
2026-03-03 08:58:22 -08:00
Ben McClelland
703baeeed4 Merge pull request #1921 from versity/ben/windows
chore: enable windows test build and release binaries
v1.3.1
2026-03-03 08:42:03 -08:00
Ben McClelland
d49e830a6e Merge pull request #1915 from versity/ben/ignores
chore: add .DS_Store to .gitignore
2026-03-03 08:24:54 -08:00
Ben McClelland
29e46667bd chore: enable windows test build and release binaries 2026-03-03 08:22:05 -08:00
Ben McClelland
7d2ff59639 Merge pull request #1903 from versity/test/rest_cors_two
test: CORS - response header tests
2026-03-03 08:19:13 -08:00
Ben McClelland
5b186e62d6 Merge pull request #1918 from versity/sis/webserver-ipv6-addresses
fix: fixes webserver network type
2026-03-03 08:16:31 -08:00
Luke McCrone
7b201777c3 test: CORS response header tests 2026-03-03 10:54:21 -03:00
niksis02
38276ab862 fix: fixes webserver network type
Fixes #1917

When the `--webui` flag uses `localhost:<port>`, the hostname `localhost` resolves to both IPv6 and IPv4 addresses. Previously, the Fiber web server was initialized without an explicit network setting, and Fiber defaults to `tcp4` (IPv4-only). Because `tcp4` cannot bind to IPv6 addresses, any resolved IPv6 address (e.g., `::1`) was treated as invalid for the listener.

The network mode is now changed to `tcp`, which enables dual-stack behavior and allows binding to both IPv4 and IPv6 addresses.
2026-03-03 13:25:38 +04:00
Ben McClelland
65612b76f1 chore: add .DS_Store to .gitignore 2026-03-02 18:22:03 -08:00
Ben McClelland
b581a4c169 Merge pull request #1914 from versity/dependabot/github_actions/actions/download-artifact-8
chore(deps): bump actions/download-artifact from 7 to 8
v1.3.0
2026-03-02 17:28:10 -08:00
Ben McClelland
fe6a5c602b Merge pull request #1913 from versity/dependabot/github_actions/actions/upload-artifact-7
chore(deps): bump actions/upload-artifact from 6 to 7
2026-03-02 17:27:46 -08:00
Ben McClelland
f26e6c3da4 Merge pull request #1912 from versity/dependabot/go_modules/dev-dependencies-b4ebc4d2fb
chore(deps): bump the dev-dependencies group with 4 updates
2026-03-02 17:27:21 -08:00
dependabot[bot]
7ebe0f86c2 chore(deps): bump actions/download-artifact from 7 to 8
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 7 to 8.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v7...v8)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-02 22:50:51 +00:00
dependabot[bot]
892590a23c chore(deps): bump actions/upload-artifact from 6 to 7
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6 to 7.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-02 22:50:44 +00:00
dependabot[bot]
fa9f9ef205 chore(deps): bump the dev-dependencies group with 4 updates
Bumps the dev-dependencies group with 4 updates: [github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager](https://github.com/aws/aws-sdk-go-v2), [github.com/aws/aws-sdk-go-v2/service/s3](https://github.com/aws/aws-sdk-go-v2), [github.com/aws/smithy-go](https://github.com/aws/smithy-go) and [github.com/aws/aws-sdk-go-v2/service/internal/checksum](https://github.com/aws/aws-sdk-go-v2).


Updates `github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager` from 0.1.5 to 0.1.6
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/ec2imds/v0.1.5...feature/s3/transfermanager/v0.1.6)

Updates `github.com/aws/aws-sdk-go-v2/service/s3` from 1.96.1 to 1.96.2
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.96.1...service/s3/v1.96.2)

Updates `github.com/aws/smithy-go` from 1.24.1 to 1.24.2
- [Release notes](https://github.com/aws/smithy-go/releases)
- [Changelog](https://github.com/aws/smithy-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/smithy-go/compare/v1.24.1...v1.24.2)

Updates `github.com/aws/aws-sdk-go-v2/service/internal/checksum` from 1.9.9 to 1.9.10
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/dsql/v1.9.9...service/grafana/v1.9.10)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager
  dependency-version: 0.1.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dev-dependencies
- dependency-name: github.com/aws/aws-sdk-go-v2/service/s3
  dependency-version: 1.96.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dev-dependencies
- dependency-name: github.com/aws/smithy-go
  dependency-version: 1.24.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dev-dependencies
- dependency-name: github.com/aws/aws-sdk-go-v2/service/internal/checksum
  dependency-version: 1.9.10
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: dev-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-02 22:47:08 +00:00
Ben McClelland
8c648b5294 Merge pull request #1911 from versity/sis/revert-acl-headers-validation
feat: revert ignore object ACL behavior
2026-03-02 13:10:27 -08:00
Ben McClelland
fc52052e33 Merge pull request #1910 from versity/sis/posix-dir-obj-metadata-tagging
feat: add tagging support for directory objects in posix
2026-03-02 13:05:51 -08:00
Ben McClelland
75f5db445f Merge pull request #1905 from versity/ben/test-walk-versions
fix: improve WalkVersions() ancestor-directory guard for prefix filtering
2026-03-02 12:55:33 -08:00
niksis02
5c918f3682 feat: revert ignore object ACL behavior
The logic to return a `NotImplemented` error on object upload operations, when any ACL header is present has been removed. Now all object ACL headers are by default ignored. The `-noacl` flag is preserved to disabled bucket ACLs.

**Testing**
The Put/Get object ACL tests are moved to `NotImplemented` integration tests group as a default gateway behavior. The existing `_acl_not_supported` tests are modified to expect no error, when ACLs are used on object uploads.
2026-03-02 19:30:57 +04:00
niksis02
8550dba36f feat: add tagging support for directory objects in posix
Closes #1857

Adds object Tagging support for directory objects in `PutObject` posix. Updates the integration tests to test object metadata and tagging both for file and directory objects.
2026-03-02 18:56:50 +04:00
Ben McClelland
30bd9d7e94 Merge pull request #1908 from versity/ben/cleanup-tests
fix: add missing tests to group-tests map
2026-03-02 05:44:35 -08:00
Ben McClelland
62da7be9cd Merge pull request #1907 from versity/ben/posix-cleanup
chore: fix typos and error return wrapping types in posix
2026-03-02 05:44:07 -08:00
Ben McClelland
c4bd632bc0 Merge pull request #1906 from versity/ben/posix-sidecar-copy 2026-03-02 05:41:08 -08:00
Ben McClelland
da82e5e247 fix: add missing tests to group-tests map
These tests were missing in the tests map to run the individual
tests:
ListBuckets_empty_success
CompleteMultipartUpload_incorrect_part_number
2026-02-28 16:39:43 -08:00
Ben McClelland
fc5c0a36a6 chore: fix typos and error return wrapping types in posix
This is just a cleanup of typos, error messages and error types
to correctly wrap the returned errors in the posix backend. No
major logic changes.
2026-02-28 10:38:29 -08:00
Ben McClelland
7695be56b0 fix: store part checksums at destination path in UploadPartCopy
In sidecar mode, the three StoreAttribute/storeChecksums calls after the
copy loop were using objPath (the source object path) instead of the
destination part's bucket and partPath. This caused checksums and the
internal part-crc64nvme to be written under the source object's sidecar
directory, making them unresolvable when CompleteMultipartUploadWithCopy
tried to retrieve them. All three stores now use *upi.Bucket and partPath,
consistent with the etag store directly below them.
2026-02-28 10:24:15 -08:00
Ben McClelland
760f252936 fix: improve WalkVersions() ancestor-directory guard for prefix filtering
Replace the length-comparison condition with an explicit predicate that
is both more readable and correctly scoped: skip only when the visited
directory is a strict ancestor of the specified prefix (not a descendant
and not when prefix is empty).

Adds tests from the original bug report (#1864) to verify the fix and
guard against future regressions.
2026-02-28 10:10:17 -08:00
Ben McClelland
ca3c76b0f9 Merge pull request #1902 from s3-on-win/fix-1864-ListObjectVersions
fix: not return parent keys for ListObjectVersions
2026-02-28 10:00:43 -08:00
Ben McClelland
809ba9e580 Merge pull request #1899 from versity/sis/upload-part-crc64nvme
feat: optimize multipart upload checksum calculation.
2026-02-28 09:55:34 -08:00
Ben McClelland
98acad9c99 Merge pull request #1887 from versity/sis/complete-mp-checksum
fix: store final checksum on CompleteMultipartUpload
2026-02-28 09:54:55 -08:00
Ben McClelland
0ad928a4d8 Merge pull request #1894 from versity/sis/getobject-directory-object-checksum
feat: adds checksums for directory objects in posix
2026-02-28 09:39:51 -08:00
Ben McClelland
1e5f803cab Merge pull request #1875 from versity/sis/disable-acl-option
feat: configuration option to disable ACLs
2026-02-28 09:32:23 -08:00
Ben McClelland
ade010ecc3 Merge pull request #1881 from versity/test/env_and_readme_work
test: env, README work
2026-02-27 08:42:58 -08:00
Ben McClelland
03c4d7fa3e Merge pull request #1900 from versity/ben/scoutfs-limiter
feat: add concurrency limiter to scoutfs
2026-02-27 08:40:18 -08:00
niksis02
5ae791b154 feat: configuration option to disable ACLs
Closes #1847

This PR introduces a global optional gateway CLI flag `--disable-acl` (`VGW_DISABLE_ACL`) to disable ACL handling. When this flag is enabled, the gateway ignores all ACL-related headers, particularly in `CreateBucket`, `PutObject`, `CopyObject`, and `CreateMultipartUpload`.

`GetBucketAcl` behavior is unchanged simply returning the bucket ACL config.
There's no change in object ACL actions(`PutObjectACL`, `GetObjectACL`). They return a`NotImplemented` error as before.

A new custom error is added for PutBucketAcl calls when ACLs are disabled at the gateway level. Its HTTP status code and error code match AWS S3’s behavior, with only a slightly different error message.

In the access-control checker, ACL evaluation is fully bypassed. If ACLs are disabled only the bucket owner gets access to the bucket and all grantee checks are ignored.

The PR also includes minor refactoring of the S3 API server and router. The growing list of parameters passed to the router’s Init method has been consolidated into fields within the router struct, initialized during router construction. Parameters not needed by the S3 server are no longer stored in the server configuration and are instead forwarded directly to the router.
2026-02-27 20:04:13 +04:00
Kai Hambrecht
8234c317b8 Fix versitygw#1864 to not return parent keys for ListObjectVersions with prefix 2026-02-27 15:55:42 +01:00