feat(s3tables): add S3 Tables service basic implementation#210
Merged
feat(s3tables): add S3 Tables service basic implementation#210
Conversation
Implement S3 Tables service emulation with the following operations: TableBucket operations: - CreateTableBucket - DeleteTableBucket - GetTableBucket - ListTableBuckets Namespace operations: - CreateNamespace - DeleteNamespace - GetNamespace - ListNamespaces Table operations: - CreateTable - DeleteTable - GetTable - ListTables Add integration tests for all operations using AWS SDK v2. Add /s3tables prefix to router to avoid conflicts with S3 wildcard routes. Closes #154
- Add path component constants to avoid goconst errors - Remove unused status parameter from writeJSON - Add nolint:tagliatelle comments for AWS API field names - Refactor ListTables to reduce funlen and nestif complexity - Fix wsl lint error in GetTable - Fix integration test Format type check
- Change HTTP methods: PUT for Create operations, GET for Get/List, DELETE for Delete
- Remove /s3tables prefix from routes to match SDK paths:
- /buckets for TableBucket operations
- /namespaces/{arn} for Namespace operations
- /tables/{arn} for Table operations
- /get-table for GetTable (uses query params)
- Update path extraction functions to work without /s3tables prefix
- Update GetTable handler to read from query params (tableBucketARN, namespace, name)
- Update router.go prefixes to include S3 Tables paths
SDK sends requests directly to /buckets, /namespaces, /tables paths
without any service-specific prefix since S3 Tables uses a separate
endpoint in AWS (s3tables.region.amazonaws.com).
The S3 Tables routes no longer have the /s3tables prefix, so the test client should use the base endpoint without it.
ARNs contain '/' characters (e.g., bucket/test-table-bucket) which are URL-encoded as %2F. When Go's http.Request decodes the URL, the encoded slash becomes a literal '/' character, causing path splitting to incorrectly parse the ARN. This fix adds a getURLPath() helper function that returns RawPath (which preserves URL encoding) when available, falling back to the decoded Path otherwise. All handlers now use this helper to correctly extract ARNs from URL paths.
TestS3Tables_GetTable and TestS3Tables_GetTableBucket were both using 'test-get-table-bucket', causing a conflict when tests run concurrently or when cleanup doesn't complete before the next test starts. Renamed the bucket in TestS3Tables_GetTable to 'test-get-table-test-bucket' to ensure test isolation.
Contributor
📊 Integration Test Coverage ReportTotal Coverage: 65.5% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implement S3 Tables service emulation for awsim.
Features
TableBucket operations:
Namespace operations:
Table operations:
Implementation Details
Files Added/Modified
internal/service/s3tables/types.go- Type definitionsinternal/service/s3tables/storage.go- Storage interface and memory implementationinternal/service/s3tables/handlers.go- HTTP handlersinternal/service/s3tables/service.go- Service registrationinternal/server/router.go- Added/s3tablesprefixtest/integration/s3tables_test.go- Integration testsTest plan
Closes #154