Skip to content

feat: Go V3 test server; rename Java and Python as "V3" implementations#4

Merged
lucasmcdonald3 merged 8 commits into
fireegg-test-serversfrom
go-test-server
Sep 17, 2025
Merged

feat: Go V3 test server; rename Java and Python as "V3" implementations#4
lucasmcdonald3 merged 8 commits into
fireegg-test-serversfrom
go-test-server

Conversation

@lucasmcdonald3

@lucasmcdonald3 lucasmcdonald3 commented Sep 16, 2025

Copy link
Copy Markdown

Issue #, if available:

Description of changes:

  • Add Go test server
  • Rename Python and Java servers to "V3" -- we'll be doing lots of cross-version testing so let's set up the versioning now

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Lucas McDonald added 2 commits September 16, 2025 10:31
@lucasmcdonald3 lucasmcdonald3 changed the title feat: Go V3 test server feat: Go V3 test server; rename Java and Python as "V3" implementations Sep 16, 2025

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a Go V3 test server implementation and renames existing Java and Python servers to explicitly indicate they are "V3" implementations, setting up the framework for cross-version testing of S3 Encryption Client implementations.

  • Add complete Go V3 test server with HTTP endpoints for client creation and S3 object operations
  • Rename Java and Python servers from generic names to "V3" specific versions
  • Update test infrastructure to support the new Go server and handle encryption context validation differences

Reviewed Changes

Copilot reviewed 7 out of 29 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test-server/java-v3-server/README.md Updates documentation to reflect V3 naming
test-server/java-tests/src/it/java/software/amazon/encryption/s3/RoundTripTests.java Adds Go-V3 server support and new encryption context validation tests
test-server/go-v3-server/main.go New Go test server implementation with full S3EC functionality
test-server/go-v3-server/go.mod Go module definition with required dependencies
test-server/go-v3-server/README.md Documentation for the new Go test server
test-server/README.md Updated instructions for V3 server naming
test-server/Makefile Updated build targets to support all three V3 servers

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread test-server/go-v3-server/main.go
Comment on lines +311 to +312
ctx := context.Background()
encryptionContext := context.WithValue(ctx, "EncryptionContext", encCtx)

Copilot AI Sep 16, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the PUT operation, the encryption context is being added to the Go context but may not be used by the S3 encryption client for validation during decryption. The comment on lines 309-310 suggests this implementation doesn't validate encryption context, which may be due to this incorrect usage.

Suggested change
ctx := context.Background()
encryptionContext := context.WithValue(ctx, "EncryptionContext", encCtx)

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, I could go either way here.
I'll probably leave it in so the test server behavior explicitly mirrors that of other test servers, but will defer to reviewers' opinions.

Comment thread test-server/go-v3-server/main.go Outdated

// Generate client ID
clientID := uuid.New().String()
log.Printf("CreateClient: Generated client ID: %s", clientID)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with keeping some print logging, but I think we should be more concise than we are now.

Also, let's add a [Go v3] prefix or similar to differentiate it from other servers.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reduced logging to only either log error or success

lucasmcdonald3 and others added 4 commits September 16, 2025 11:17
…s3/RoundTripTests.java

Co-authored-by: Kess Plasmeier <76071473+kessplas@users.noreply.github.com>
…s3/RoundTripTests.java

Co-authored-by: Kess Plasmeier <76071473+kessplas@users.noreply.github.com>

@kessplas kessplas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, please have Shubham take a look as well

@ShubhamChaturvedi7 ShubhamChaturvedi7 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing major; Approving since this PR is building block of other changes that need to go, the comments can be addressed as a follow up PR.

Comment thread test-server/go-v3-server/README.md Outdated

- **HTTP Framework**: Gorilla Mux for routing
- **AWS SDK**: AWS SDK for Go v2 for S3 and KMS operations
- **Concurrency**: Thread-safe client caching with sync.RWMutex

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it being used anywhere? I see the cache is plain map (which I guess works; see my comment below).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops sorry AI slop slipped through, will remove

)

// Server represents the Go test server
type Server struct {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit / optional: you can make them all private (structs) if it's all in the same package.

Comment on lines +152 to +153
keyring := materials.NewKmsKeyring(kmsClient, input.Config.KeyMaterial.KMSKeyID, func(options *materials.KeyringOptions) {
options.EnableLegacyWrappingAlgorithms = input.Config.EnableLegacyWrappingAlgorithms

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about other values in the input config? Do we not use them?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing Java and Python implementations don't, so I'm mirroring those

Comment on lines +67 to +75
serverList = new ArrayList<>(14);
serverList.add(new LanguageServerTarget("Java-V3", "8080"));
serverList.add(new LanguageServerTarget("Python-V3", "8081"));
serverList.add(new LanguageServerTarget("Go-V3", "8082"));

serverMap = new HashMap<>(14);
serverMap.put("Java-V3", new LanguageServerTarget("Java-V3", "8080"));
serverMap.put("Python-V3", new LanguageServerTarget("Python-V3", "8081"));
serverMap.put("Go-V3", new LanguageServerTarget("Go-V3", "8082"));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why list and map both? It'd be a bit less maintenance if it was just a map (and iterate over the valueSet).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure but I'll leave this as-is

Comment on lines +173 to +176
clientID := uuid.New().String()

// Store client in cache
s.clientCache[clientID] = s3EncryptionClient

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we are safe against multi-threading because each request would just create a new uuid. Cool.

@lucasmcdonald3

Copy link
Copy Markdown
Author

I'll merge since my only change since 2 approvals is cleaning up the README.

2e594b6

@lucasmcdonald3 lucasmcdonald3 merged commit 2316fa4 into fireegg-test-servers Sep 17, 2025
2 checks passed
@lucasmcdonald3 lucasmcdonald3 deleted the go-test-server branch September 17, 2025 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants