Skip to content

Implement proxy-download mode in the mock AWS driver - #428

Open
bauerpawel wants to merge 1 commit into
Forceu:masterfrom
bauerpawel:feat/aws-mock-proxy-download
Open

bauerpawel wants to merge 1 commit into
Forceu:masterfrom
bauerpawel:feat/aws-mock-proxy-download

Conversation

@bauerpawel

Copy link
Copy Markdown
Contributor

Description

The real S3 driver supports a ProxyDownload config option (stream the file content through the server instead of redirecting to a presigned URL), but the mock driver used for awsmock-tagged tests always redirected regardless of that setting — so the proxy-download code path had no test coverage at all.

Mirrors the real implementation in the mock: when ProxyDownload is set, reads the file content from a local test fixture at data/<sha1> (the same convention Stream() already uses) and streams it to the response instead of redirecting.

Type of Change

  • New feature (non-breaking change which adds functionality)

Technical Details

  • Database changes: No
  • Storage backend affected: S3
  • Usage of AI: Yes — developed with Claude Code as a pair-programming assistant. I reviewed and tested all changes before submitting.

How Has This Been Tested?

  • Unit Tests: Added Aws_mock_test.go covering proxy-download streaming (happy path), a missing on-disk fixture (error path), and confirming the existing redirect behavior still works when ProxyDownload is off. All pass in isolation and as part of the full suite.
  • Environment: Windows 11

Checklist

  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation. (n/a — internal test-infrastructure change, ProxyDownload itself already existed and is documented)
  • My changes generate no new warnings.

🤖 Generated with Claude Code

https://claude.ai/code/session_0168YUwGEzEHTqd9CwzXE53d

The mock driver's ServeFile always redirected to a presigned URL,
regardless of the ProxyDownload config option, so the real driver's
proxy-download path had no test coverage. Mirrors the real
implementation: streams the file content from a local test fixture at
"data/<sha1>" (the same convention used by Stream()) instead of
redirecting.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0168YUwGEzEHTqd9CwzXE53d
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.

1 participant