Skip to content

Commit baca64a

Browse files
committed
First cut of transtional
1 parent 8092b12 commit baca64a

13 files changed

Lines changed: 695 additions & 0 deletions

File tree

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "test-server/ruby-transitional-server/transitional-ruby-sdk"]
2+
path = test-server/ruby-transitional-server/transitional-ruby-sdk
3+
url = git@github.com:aws/aws-sdk-ruby-staging.git
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
BUNDLE_PATH: "vendor/bundle"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vendor
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
source 'https://rubygems.org'
2+
3+
ruby '~> 3.0'
4+
5+
gem 'sinatra', '~> 3.0'
6+
gem 'puma', '~> 6.0'
7+
gem 'aws-sdk-s3', path: 'transitional-ruby-sdk/gems/aws-sdk-s3'
8+
gem 'aws-sdk-kms', path: 'transitional-ruby-sdk/gems/aws-sdk-kms'
9+
gem 'json', '~> 2.0'
10+
gem 'concurrent-ruby', '~> 1.0'
11+
gem 'nokogiri', '~> 1.13'
12+
13+
group :development do
14+
gem 'rubocop', '~> 1.0'
15+
end
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
PATH
2+
remote: transitional-ruby-sdk/gems/aws-sdk-kms
3+
specs:
4+
aws-sdk-kms (1.112.0)
5+
aws-sdk-core (~> 3, >= 3.231.0)
6+
aws-sigv4 (~> 1.5)
7+
8+
PATH
9+
remote: transitional-ruby-sdk/gems/aws-sdk-s3
10+
specs:
11+
aws-sdk-s3 (1.199.0)
12+
aws-sdk-core (~> 3, >= 3.231.0)
13+
aws-sdk-kms (~> 1)
14+
aws-sigv4 (~> 1.5)
15+
16+
GEM
17+
remote: https://rubygems.org/
18+
specs:
19+
ast (2.4.3)
20+
aws-eventstream (1.4.0)
21+
aws-partitions (1.1161.0)
22+
aws-sdk-core (3.232.0)
23+
aws-eventstream (~> 1, >= 1.3.0)
24+
aws-partitions (~> 1, >= 1.992.0)
25+
aws-sigv4 (~> 1.9)
26+
base64
27+
bigdecimal
28+
jmespath (~> 1, >= 1.6.1)
29+
logger
30+
aws-sigv4 (1.12.1)
31+
aws-eventstream (~> 1, >= 1.0.2)
32+
base64 (0.3.0)
33+
bigdecimal (3.2.3)
34+
concurrent-ruby (1.3.5)
35+
jmespath (1.6.2)
36+
json (2.13.2)
37+
language_server-protocol (3.17.0.5)
38+
lint_roller (1.1.0)
39+
logger (1.7.0)
40+
mustermann (3.0.4)
41+
ruby2_keywords (~> 0.0.1)
42+
nio4r (2.7.4)
43+
nokogiri (1.18.10-arm64-darwin)
44+
racc (~> 1.4)
45+
parallel (1.27.0)
46+
parser (3.3.9.0)
47+
ast (~> 2.4.1)
48+
racc
49+
prism (1.5.1)
50+
puma (6.6.1)
51+
nio4r (~> 2.0)
52+
racc (1.8.1)
53+
rack (2.2.17)
54+
rack-protection (3.2.0)
55+
base64 (>= 0.1.0)
56+
rack (~> 2.2, >= 2.2.4)
57+
rainbow (3.1.1)
58+
regexp_parser (2.11.3)
59+
rubocop (1.80.2)
60+
json (~> 2.3)
61+
language_server-protocol (~> 3.17.0.2)
62+
lint_roller (~> 1.1.0)
63+
parallel (~> 1.10)
64+
parser (>= 3.3.0.2)
65+
rainbow (>= 2.2.2, < 4.0)
66+
regexp_parser (>= 2.9.3, < 3.0)
67+
rubocop-ast (>= 1.46.0, < 2.0)
68+
ruby-progressbar (~> 1.7)
69+
unicode-display_width (>= 2.4.0, < 4.0)
70+
rubocop-ast (1.46.0)
71+
parser (>= 3.3.7.2)
72+
prism (~> 1.4)
73+
ruby-progressbar (1.13.0)
74+
ruby2_keywords (0.0.5)
75+
sinatra (3.2.0)
76+
mustermann (~> 3.0)
77+
rack (~> 2.2, >= 2.2.4)
78+
rack-protection (= 3.2.0)
79+
tilt (~> 2.0)
80+
tilt (2.6.1)
81+
unicode-display_width (3.2.0)
82+
unicode-emoji (~> 4.1)
83+
unicode-emoji (4.1.0)
84+
85+
PLATFORMS
86+
arm64-darwin-24
87+
88+
DEPENDENCIES
89+
aws-sdk-kms!
90+
aws-sdk-s3!
91+
concurrent-ruby (~> 1.0)
92+
json (~> 2.0)
93+
nokogiri (~> 1.13)
94+
puma (~> 6.0)
95+
rubocop (~> 1.0)
96+
sinatra (~> 3.0)
97+
98+
RUBY VERSION
99+
ruby 3.4.5p51
100+
101+
BUNDLED WITH
102+
2.6.9
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Ruby S3 Encryption Client Test Server
2+
3+
This is a Ruby implementation of the S3 Encryption Client test server that provides an invariant interface around the S3 Encryption Client v2. It's designed to work alongside other implementations of test servers for cross-language compatibility testing.
4+
5+
## Overview
6+
7+
The server provides a REST API that wraps the AWS S3 Encryption Client v2, allowing tests to verify that all language implementations behave consistently.
8+
9+
## Endpoints
10+
11+
- `POST /client` - Create a new S3 encryption client instance
12+
- `PUT /object/{bucket}/{key}` - Encrypt and store an object
13+
- `GET /object/{bucket}/{key}` - Retrieve and decrypt an object
14+
- `GET /health` - Health check endpoint
15+
16+
## Configuration
17+
18+
The server runs on port **8086** by default.
19+
20+
## Setup
21+
22+
1. Install Ruby 3.x
23+
2. Install dependencies:
24+
```bash
25+
cd test-server/ruby-v2-server
26+
bundle install
27+
```
28+
29+
3. Set up AWS credentials (via AWS CLI, environment variables, or IAM roles)
30+
31+
4. Start the server:
32+
```bash
33+
ruby app.rb
34+
# or using Rack
35+
bundle exec rackup -p 8086
36+
```
37+
38+
## Usage
39+
40+
The server is designed to be used by the Java test suite in `test-server/java-tests/`. The tests will automatically discover and use this server for cross-language compatibility testing.
41+
42+
### Environment Variables
43+
44+
- `TEST_SERVER_KMS_KEY_ARN` - KMS key ARN for encryption (defaults to test key)
45+
- `TEST_SERVER_S3_BUCKET` - S3 bucket for testing (defaults to test bucket)
46+
47+
## Architecture
48+
49+
- `app.rb` - Main Sinatra application
50+
- `lib/client_manager.rb` - Manages S3 encryption client instances
51+
- `lib/metadata_utils.rb` - Handles metadata serialization/deserialization
52+
- `lib/error_handlers.rb` - Smithy-compliant error responses
53+
54+
## Error Handling
55+
56+
The server returns errors in the format expected by the Smithy model:
57+
58+
- `GenericServerError` - Internal server errors
59+
- `S3EncryptionClientError` - Errors from the S3 Encryption Client
60+
61+
## Compatibility
62+
63+
This server is compatible with:
64+
- S3 Encryption Client v2
65+
- Legacy v1 clients (when `enableLegacyWrappingAlgorithms` is true)
66+
- Cross-language testing with Java and Python implementations

0 commit comments

Comments
 (0)