111 Commits

Author SHA1 Message Date
releaser a4dedab2f5 chore(release): prepare for v0.4.0 (#100)
Release / release (push) Successful in 46s
storage / test (push) Successful in 1m40s
storage / vulnerabilities (push) Successful in 1m53s
pre-commit / pre-commit (push) Successful in 7m20s
## [0.4.0] - 2026-04-17

### 🚀 Features

- Auto-enable path-style addressing when a custom endpoint is set (#99)

<!-- generated by git-cliff -->

---

**Note:** Please use **Squash Merge** when merging this PR.

Reviewed-on: #100
Co-authored-by: Unbound Releaser <releaser@unbound.se>
Co-committed-by: Unbound Releaser <releaser@unbound.se>
2026-04-17 17:31:17 +00:00
argoyle 1620565ae6 feat: auto-enable path-style addressing when a custom endpoint is set (#99)
Release / release (push) Successful in 52s
storage / test (push) Successful in 1m46s
storage / vulnerabilities (push) Successful in 1m46s
pre-commit / pre-commit (push) Successful in 6m26s
## Summary

When `AWS_ENDPOINT_URL_S3` or `AWS_ENDPOINT_URL` is set — typically because the runtime is pointing at a local MinIO / S3-compatible endpoint — auto-enable path-style addressing on the S3 client. Without this, requests fail because MinIO does not implement virtual-hosted style addressing out of the box.

Production deployments leave those env vars unset and continue talking to real AWS S3 with virtual-hosted style — no behaviour change for prod.

Both `New()` and `NewS3()` share a `s3ClientOptions` helper that applies the toggle.

## Motivation

Spinning up a MinIO-backed acctest environment for Shiny (document-service, invoice-service, accounting-service). Without this change callers would have to sidestep `storage.New` and construct an `aws.Config` by hand just to flip `UsePathStyle`.

## Test plan

- [x] New unit test `TestS3ClientOptions_PathStyleTogglesOnCustomEndpoint` covers the three relevant env-var states
- [x] `go test ./...` passes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Reviewed-on: #99
2026-04-17 17:18:53 +00:00
releaser 7539b5db24 chore(release): prepare for v0.3.0 (#98)
storage / test (push) Successful in 1m36s
Release / release (push) Successful in 1m56s
storage / vulnerabilities (push) Successful in 2m45s
pre-commit / pre-commit (push) Successful in 6m21s
## [0.3.0] - 2026-04-16

### 🚀 Features

- Add PresignInlineURL method for inline content display (#97)

<!-- generated by git-cliff -->

---

**Note:** Please use **Squash Merge** when merging this PR.

Reviewed-on: #98
Co-authored-by: Unbound Releaser <releaser@unbound.se>
Co-committed-by: Unbound Releaser <releaser@unbound.se>
2026-04-16 09:03:25 +00:00
argoyle 862ec3f7bc feat: add PresignInlineURL method for inline content display (#97)
storage / vulnerabilities (push) Successful in 1m43s
storage / test (push) Successful in 1m44s
Release / release (push) Successful in 58s
pre-commit / pre-commit (push) Successful in 6m14s
## Summary

- Add `PresignInlineURL(ctx, key, contentType)` method that generates presigned URLs with `Content-Disposition: inline` and optional `Content-Type` override
- Browsers will render content (e.g. PDFs) directly in iframes instead of triggering download dialogs
- Existing `PresignURL` remains unchanged

## Context

The document-service uses presigned S3 URLs to display PDFs in iframes. Without `Content-Disposition: inline`, the browser triggers a download dialog instead of rendering the PDF.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Reviewed-on: #97
2026-04-16 08:52:38 +00:00
releaser cdad7f1f66 chore(release): prepare for v0.2.0 (#96)
Release / release (push) Successful in 53s
storage / test (push) Successful in 1m41s
storage / vulnerabilities (push) Successful in 1m54s
pre-commit / pre-commit (push) Successful in 6m10s
## [0.2.0] - 2026-04-16

### 🚀 Features

- Add PresignURL method for existing objects (#95)

### 🐛 Bug Fixes

- *(deps)* Update aws-sdk-go-v2 monorepo (#92)
- *(deps)* Update aws-sdk-go-v2 monorepo (#93)

<!-- generated by git-cliff -->

---

**Note:** Please use **Squash Merge** when merging this PR.

Reviewed-on: #96
Co-authored-by: Unbound Releaser <releaser@unbound.se>
Co-committed-by: Unbound Releaser <releaser@unbound.se>
2026-04-16 06:50:17 +00:00
argoyle 425056b0c2 feat: add PresignURL method for existing objects (#95)
Release / release (push) Successful in 59s
storage / vulnerabilities (push) Successful in 1m43s
storage / test (push) Successful in 1m56s
pre-commit / pre-commit (push) Successful in 5m29s
## Summary

Add `PresignURL(ctx, key)` method to generate presigned download URLs for existing S3 objects (15 min expiry). Needed by document-service to serve document preview/download links.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Reviewed-on: #95
2026-04-16 06:41:56 +00:00
renovate c3eeaddc10 fix(deps): update aws-sdk-go-v2 monorepo (#93)
Release / release (push) Successful in 1m4s
storage / test (push) Successful in 1m36s
storage / vulnerabilities (push) Successful in 1m42s
pre-commit / pre-commit (push) Successful in 6m2s
2026-04-10 19:42:55 +00:00
renovate 78d05388d2 fix(deps): update aws-sdk-go-v2 monorepo (#92)
Release / release (push) Failing after 47s
storage / test (push) Successful in 1m37s
storage / vulnerabilities (push) Successful in 1m45s
pre-commit / pre-commit (push) Successful in 6m18s
2026-04-05 19:29:23 +00:00
releaser b2490bab23 chore(release): prepare for v0.1.4 (#91)
Release / release (push) Successful in 47s
storage / vulnerabilities (push) Successful in 1m39s
storage / test (push) Successful in 1m43s
pre-commit / pre-commit (push) Successful in 6m23s
## [0.1.4] - 2026-03-31

### 🐛 Bug Fixes

- *(deps)* Update module github.com/aws/aws-sdk-go-v2/service/s3 to v1.97.0 (#80)
- *(deps)* Update module github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager to v0.1.9 (#82)
- *(deps)* Update aws-sdk-go-v2 monorepo (#83)
- *(deps)* Update aws-sdk-go-v2 monorepo (#87)
- *(deps)* Update aws-sdk-go-v2 monorepo (#88)
- *(deps)* Update aws-sdk-go-v2 monorepo (#90)

### ⚙️ Miscellaneous Tasks

- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.11.2 (#74)
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.11.3 (#76)
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.30.1 (#78)
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.11.4 (#85)

<!-- generated by git-cliff -->

---

**Note:** Please use **Squash Merge** when merging this PR.

Reviewed-on: #91
Co-authored-by: Unbound Releaser <releaser@unbound.se>
Co-committed-by: Unbound Releaser <releaser@unbound.se>
2026-04-02 09:14:06 +00:00
renovate dd3ff95990 fix(deps): update aws-sdk-go-v2 monorepo (#90)
Release / release (push) Failing after 58s
storage / vulnerabilities (push) Successful in 1m43s
storage / test (push) Successful in 1m44s
pre-commit / pre-commit (push) Successful in 6m19s
2026-03-31 19:19:07 +00:00
renovate 7d1237ee84 fix(deps): update aws-sdk-go-v2 monorepo (#88)
Release / release (push) Successful in 1m26s
storage / test (push) Successful in 1m41s
storage / vulnerabilities (push) Successful in 1m59s
pre-commit / pre-commit (push) Successful in 6m27s
2026-03-26 19:20:13 +00:00
renovate 01d63892b3 fix(deps): update aws-sdk-go-v2 monorepo (#87)
Release / release (push) Failing after 58s
storage / vulnerabilities (push) Successful in 1m49s
storage / test (push) Successful in 2m6s
pre-commit / pre-commit (push) Successful in 6m27s
2026-03-23 19:22:31 +00:00
renovate b24e0b7047 chore(deps): update pre-commit hook golangci/golangci-lint to v2.11.4 (#85)
storage / vulnerabilities (push) Successful in 1m38s
storage / test (push) Successful in 2m4s
Release / release (push) Successful in 55s
pre-commit / pre-commit (push) Successful in 6m17s
2026-03-22 18:46:14 +00:00
renovate 78af8b0e1b fix(deps): update aws-sdk-go-v2 monorepo (#83)
Release / release (push) Successful in 55s
storage / test (push) Successful in 2m3s
storage / vulnerabilities (push) Successful in 2m5s
pre-commit / pre-commit (push) Successful in 6m21s
2026-03-13 20:27:47 +00:00
renovate dd739d2225 fix(deps): update module github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager to v0.1.9 (#82)
storage / test (push) Successful in 1m37s
Release / release (push) Failing after 54s
storage / vulnerabilities (push) Successful in 1m49s
pre-commit / pre-commit (push) Successful in 5m19s
2026-03-12 20:28:18 +00:00
renovate 643f10ba3f fix(deps): update module github.com/aws/aws-sdk-go-v2/service/s3 to v1.97.0 (#80)
Release / release (push) Successful in 1m21s
storage / test (push) Successful in 2m5s
storage / vulnerabilities (push) Successful in 2m17s
pre-commit / pre-commit (push) Successful in 12m14s
2026-03-12 19:40:05 +00:00
renovate f710c631e7 chore(deps): update pre-commit hook gitleaks/gitleaks to v8.30.1 (#78)
Release / release (push) Successful in 1m19s
storage / vulnerabilities (push) Successful in 1m40s
storage / test (push) Successful in 2m31s
pre-commit / pre-commit (push) Successful in 7m24s
2026-03-12 16:28:18 +00:00
renovate 325031b5cf chore(deps): update pre-commit hook golangci/golangci-lint to v2.11.3 (#76)
storage / test (push) Successful in 1m49s
Release / release (push) Successful in 1m18s
storage / vulnerabilities (push) Successful in 1m57s
pre-commit / pre-commit (push) Successful in 13m29s
2026-03-10 11:41:42 +00:00
renovate 5c83764bf2 chore(deps): update pre-commit hook golangci/golangci-lint to v2.11.2 (#74)
Release / release (push) Successful in 1m0s
storage / test (push) Successful in 1m46s
storage / vulnerabilities (push) Successful in 1m37s
pre-commit / pre-commit (push) Successful in 7m5s
2026-03-08 08:39:23 +00:00
releaser 3f760a62e1 chore(release): prepare for v0.1.3 (#73)
Release / release (push) Successful in 1m6s
storage / test (push) Successful in 1m58s
storage / vulnerabilities (push) Successful in 2m19s
pre-commit / pre-commit (push) Successful in 6m4s
## [0.1.3] - 2026-03-06

### 🐛 Bug Fixes

- *(deps)* Update aws-sdk-go-v2 monorepo (#60)
- *(deps)* Update aws-sdk-go-v2 monorepo (#62)
- *(deps)* Update aws-sdk-go-v2 monorepo (#64)
- *(deps)* Update aws-sdk-go-v2 monorepo (#66)
- *(deps)* Update aws-sdk-go-v2 monorepo (#68)
- *(deps)* Update aws-sdk-go-v2 monorepo (#70)

### ⚙️ Miscellaneous Tasks

- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.9.0 (#56)
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.10.1 (#58)
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.11.1 (#72)

<!-- generated by git-cliff -->

---

**Note:** Please use **Squash Merge** when merging this PR.

Reviewed-on: #73
Co-authored-by: Unbound Releaser <releaser@unbound.se>
Co-committed-by: Unbound Releaser <releaser@unbound.se>
2026-03-06 20:00:33 +00:00
renovate 7dae9b02d2 chore(deps): update pre-commit hook golangci/golangci-lint to v2.11.1 (#72)
Release / release (push) Successful in 1m12s
storage / test (push) Successful in 1m47s
storage / vulnerabilities (push) Successful in 2m11s
pre-commit / pre-commit (push) Successful in 6m15s
2026-03-06 16:22:39 +00:00
renovate cd97f212aa fix(deps): update aws-sdk-go-v2 monorepo (#70)
Release / release (push) Successful in 57s
storage / test (push) Successful in 2m6s
storage / vulnerabilities (push) Successful in 2m10s
pre-commit / pre-commit (push) Successful in 5m46s
2026-03-05 21:27:29 +00:00
renovate 986731e9a2 fix(deps): update aws-sdk-go-v2 monorepo (#68)
Release / release (push) Successful in 1m3s
storage / test (push) Successful in 2m4s
storage / vulnerabilities (push) Successful in 2m9s
pre-commit / pre-commit (push) Successful in 6m5s
2026-03-03 22:30:51 +00:00
renovate fc07508d7c fix(deps): update aws-sdk-go-v2 monorepo (#66)
Release / release (push) Successful in 1m1s
storage / vulnerabilities (push) Successful in 1m42s
storage / test (push) Successful in 2m51s
pre-commit / pre-commit (push) Successful in 6m52s
2026-02-26 20:35:21 +00:00
renovate 57a8f9e929 fix(deps): update aws-sdk-go-v2 monorepo (#64)
Release / release (push) Successful in 1m5s
storage / vulnerabilities (push) Successful in 3m20s
storage / test (push) Successful in 3m46s
pre-commit / pre-commit (push) Successful in 6m55s
2026-02-24 05:40:23 +00:00
renovate 1c7b12c348 fix(deps): update aws-sdk-go-v2 monorepo (#62)
Release / release (push) Successful in 1m53s
storage / vulnerabilities (push) Successful in 3m54s
storage / test (push) Successful in 4m22s
pre-commit / pre-commit (push) Successful in 7m17s
2026-02-18 21:19:51 +00:00
renovate 6ef6d9712a fix(deps): update aws-sdk-go-v2 monorepo (#60)
Release / release (push) Successful in 54s
storage / test (push) Successful in 1m49s
storage / vulnerabilities (push) Successful in 1m53s
pre-commit / pre-commit (push) Successful in 6m34s
2026-02-17 22:18:55 +00:00
renovate e324605c3e chore(deps): update pre-commit hook golangci/golangci-lint to v2.10.1 (#58)
storage / vulnerabilities (push) Successful in 1m35s
Release / release (push) Successful in 3m50s
storage / test (push) Successful in 4m48s
pre-commit / pre-commit (push) Successful in 11m37s
2026-02-17 17:55:58 +00:00
renovate 9b0ee6b6ac chore(deps): update pre-commit hook golangci/golangci-lint to v2.9.0 (#56)
Release / release (push) Successful in 1m23s
storage / vulnerabilities (push) Successful in 1m34s
storage / test (push) Successful in 5m9s
pre-commit / pre-commit (push) Successful in 11m39s
2026-02-11 13:58:57 +00:00
argoyle 9ada1c5e17 Merge pull request 'chore(release): prepare for v0.1.2' (#52) from next-release into main
Release / release (push) Successful in 43s
storage / vulnerabilities (push) Successful in 1m46s
storage / test (push) Successful in 1m55s
pre-commit / pre-commit (push) Successful in 4m28s
Reviewed-on: #52
2026-02-06 00:31:05 +00:00
releaser d1f616b9d8 chore(release): prepare for v0.1.2
storage / vulnerabilities (pull_request) Successful in 4m9s
storage / test (pull_request) Successful in 6m53s
pre-commit / pre-commit (pull_request) Successful in 11m38s
2026-02-06 00:13:26 +00:00
releaser 20ca082a98 chore(release): prepare for v0.1.2 2026-02-06 00:13:23 +00:00
releaser b0c84530bc chore(release): prepare for v0.1.2
storage / vulnerabilities (pull_request) Successful in 6m40s
pre-commit / pre-commit (pull_request) Successful in 6m56s
storage / test (pull_request) Successful in 7m18s
2026-02-06 00:11:30 +00:00
releaser b220632f74 chore(release): prepare for v0.1.2 2026-02-06 00:11:30 +00:00
releaser ba064f9ae0 chore(release): prepare for v0.1.2 2026-02-06 00:11:30 +00:00
releaser 0bf774486b chore(release): prepare for v0.1.2 2026-02-06 00:11:30 +00:00
releaser ddadc1e882 chore(release): prepare for v0.1.2 2026-02-06 00:11:30 +00:00
releaser 9bf09d0f8f chore(release): prepare for v0.1.2 2026-02-06 00:11:30 +00:00
releaser 59554f49de chore(release): prepare for v0.1.2 2026-02-06 00:11:30 +00:00
releaser 0a657a499e chore(release): prepare for v0.1.2 2026-02-06 00:11:30 +00:00
argoyle 44a0a6bd36 Merge pull request 'refactor: migrate from deprecated s3/manager to s3/transfermanager' (#55) from migrate-to-transfermanager into main
storage / vulnerabilities (push) Successful in 2m1s
storage / test (push) Successful in 2m56s
Release / release (push) Successful in 1m26s
pre-commit / pre-commit (push) Successful in 8m29s
Reviewed-on: #55
2026-02-06 00:10:15 +00:00
argoyle d8decc411e refactor: migrate from deprecated s3/manager to s3/transfermanager
storage / test (pull_request) Successful in 1m25s
storage / vulnerabilities (pull_request) Successful in 1m58s
pre-commit / pre-commit (pull_request) Successful in 5m0s
Replace feature/s3/manager (deprecated) with feature/s3/transfermanager.
Updates Uploader interface, constructor, and all tests to use the new
UploadObject API with transfermanager types.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 01:03:19 +01:00
renovate f260d3c3c0 fix(deps): update module github.com/aws/aws-sdk-go-v2/feature/s3/manager to v1.22.0 (#54)
Release / release (push) Failing after 57s
storage / vulnerabilities (push) Successful in 2m4s
storage / test (push) Successful in 2m28s
pre-commit / pre-commit (push) Failing after 4m5s
2026-02-05 21:21:09 +00:00
renovate dee1809673 fix(deps): update aws-sdk-go-v2 monorepo (#53)
storage / vulnerabilities (push) Successful in 2m14s
Release / release (push) Failing after 4m47s
storage / test (push) Successful in 7m9s
pre-commit / pre-commit (push) Failing after 10m41s
2026-01-28 20:30:57 +00:00
renovate 3c2b55e2cf fix(deps): update module github.com/aws/aws-sdk-go-v2/feature/s3/manager to v1.21.0 (#51)
Release / release (push) Successful in 2m31s
storage / vulnerabilities (push) Successful in 7m10s
storage / test (push) Successful in 7m27s
pre-commit / pre-commit (push) Successful in 10m45s
2026-01-20 21:19:59 +00:00
renovate 734386c3fc chore(deps): update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.24.0 (#50)
Release / release (push) Failing after 2m3s
storage / test (push) Successful in 3m25s
storage / vulnerabilities (push) Successful in 4m47s
pre-commit / pre-commit (push) Successful in 7m25s
2026-01-13 21:33:15 +00:00
renovate cf65c464b8 fix(deps): update aws-sdk-go-v2 monorepo (#49)
Release / release (push) Failing after 57s
storage / vulnerabilities (push) Successful in 8m50s
storage / test (push) Successful in 9m21s
pre-commit / pre-commit (push) Successful in 9m9s
2026-01-09 20:28:17 +00:00
argoyle f49aabcc48 Merge pull request 'chore(release): prepare for v0.1.1' (#47) from next-release into main
Release / release (push) Successful in 3m43s
storage / test (push) Successful in 5m15s
storage / vulnerabilities (push) Successful in 8m30s
pre-commit / pre-commit (push) Successful in 14m18s
Reviewed-on: #47
2026-01-09 13:50:08 +00:00
releaser a359c82df7 chore(release): prepare for v0.1.1
storage / vulnerabilities (pull_request) Successful in 6m6s
storage / test (pull_request) Successful in 6m48s
pre-commit / pre-commit (pull_request) Successful in 13m21s
2026-01-09 13:27:18 +00:00
releaser 8b3b7b95dc chore(release): prepare for v0.1.1 2026-01-09 13:27:13 +00:00
argoyle ec5383af6d Merge pull request 'chore: migrate module path to gitea.unbound.se' (#48) from migrate-to-gitea into main
Release / release (push) Successful in 2m25s
storage / vulnerabilities (push) Successful in 3m14s
storage / test (push) Successful in 4m0s
pre-commit / pre-commit (push) Successful in 6m49s
Reviewed-on: #48
2026-01-09 13:24:25 +00:00
argoyle 41d0edf378 chore: migrate module path to gitea.unbound.se
storage / test (pull_request) Successful in 7m25s
storage / vulnerabilities (pull_request) Successful in 7m22s
pre-commit / pre-commit (pull_request) Successful in 12m49s
Update module path from git.unbound.se to gitea.unbound.se for Go module
discovery over HTTPS.
2026-01-09 13:43:53 +01:00
releaser b399a2cf21 chore(release): prepare for v0.1.1
storage / vulnerabilities (pull_request) Successful in 3m35s
storage / test (pull_request) Successful in 4m10s
pre-commit / pre-commit (pull_request) Successful in 3m37s
2026-01-09 09:10:41 +00:00
releaser 28905c35f5 chore(release): prepare for v0.1.1 2026-01-09 09:08:39 +00:00
argoyle 75b9dc34ac Merge pull request 'chore(deps): update actions/setup-python action to v6' (#46) from renovate/actions-setup-python-6.x into main
storage / test (push) Successful in 3m16s
storage / vulnerabilities (push) Successful in 3m29s
Release / release (push) Successful in 3m45s
pre-commit / pre-commit (push) Successful in 13m3s
Reviewed-on: #46
2026-01-09 09:05:12 +00:00
renovate c823edae25 chore(deps): update actions/setup-python action to v6
storage / vulnerabilities (pull_request) Successful in 4m36s
storage / test (pull_request) Successful in 5m0s
pre-commit / pre-commit (pull_request) Successful in 9m23s
2026-01-09 08:24:10 +00:00
argoyle aaa0204d34 Merge pull request 'chore(release): prepare for v0.1.0' (#18) from next-release into main
Release / release (push) Successful in 1m1s
storage / vulnerabilities (push) Successful in 5m47s
storage / test (push) Successful in 6m44s
pre-commit / pre-commit (push) Successful in 8m51s
Reviewed-on: #18
2026-01-09 07:50:09 +00:00
releaser 44ed391995 chore(release): prepare for v0.1.0 2026-01-09 07:48:28 +00:00
releaser 147c673635 chore(release): prepare for v0.1.0 2026-01-09 07:48:24 +00:00
argoyle 918dc6aa0b Merge pull request 'ci: add pre-commit and release workflows' (#45) from add-workflows into main
storage / vulnerabilities (push) Successful in 1m7s
Release / release (push) Successful in 53s
storage / test (push) Successful in 1m53s
pre-commit / pre-commit (push) Has been cancelled
Reviewed-on: #45
2026-01-09 07:46:53 +00:00
argoyle 57fe122b3a ci: add pre-commit and release workflows
storage / vulnerabilities (pull_request) Successful in 2m24s
storage / test (pull_request) Successful in 2m29s
pre-commit / pre-commit (pull_request) Successful in 5m37s
- Add pre-commit workflow to run hooks on PRs and main branch pushes
- Add release workflow using shared unboundsoftware workflow

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 08:38:46 +01:00
argoyle 9c530267ee Merge pull request 'chore: migrate from GitLab to Gitea' (#44) from migrate-to-gitea into main
storage / test (push) Successful in 2m51s
storage / vulnerabilities (push) Successful in 2m18s
Reviewed-on: #44
2026-01-09 07:04:10 +00:00
argoyle 887d3b8517 chore: migrate from GitLab to Gitea
storage / vulnerabilities (pull_request) Successful in 2m45s
storage / test (pull_request) Successful in 2m57s
- Update module path from gitlab.com/unboundsoftware/storage to
  git.unbound.se/unboundsoftware/storage
- Update import examples in documentation (CLAUDE.md, README.md)
- Remove .gitlab-ci.yml (GitLab CI pipeline no longer needed)
- Remove gitlab-ci-linter pre-commit hook
- Update go-imports local path in pre-commit config

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 08:00:42 +01:00
argoyle 14cb137593 Merge pull request 'chore(deps): update pre-commit hook golangci/golangci-lint to v2.8.0' (#43) from renovate/golangci-golangci-lint-2.x into main
storage / test (push) Successful in 1m50s
storage / vulnerabilities (push) Successful in 4m16s
Reviewed-on: #43
2026-01-09 04:13:22 +00:00
renovate a358aaddd6 chore(deps): update pre-commit hook golangci/golangci-lint to v2.8.0
storage / vulnerabilities (pull_request) Successful in 5m5s
storage / test (pull_request) Successful in 5m21s
2026-01-08 21:25:51 +00:00
argoyle 9632a497e6 Merge pull request 'chore(deps): update actions/setup-go action to v6' (#42) from renovate/actions-setup-go-6.x into main
storage / test (push) Successful in 5m7s
storage / vulnerabilities (push) Successful in 5m38s
Reviewed-on: #42
2026-01-08 15:21:14 +00:00
renovate 3b053e526a chore(deps): update actions/setup-go action to v6
storage / vulnerabilities (pull_request) Successful in 3m53s
storage / test (pull_request) Successful in 4m18s
2026-01-08 15:14:04 +00:00
argoyle 1e331a4ea2 Merge pull request 'chore(deps): update actions/checkout action to v6' (#41) from renovate/actions-checkout-6.x into main
storage / vulnerabilities (push) Successful in 1m36s
storage / test (push) Successful in 1m44s
Reviewed-on: #41
2026-01-08 14:17:10 +00:00
renovate 7f15846a21 chore(deps): update actions/checkout action to v6
storage / vulnerabilities (pull_request) Successful in 7m58s
storage / test (pull_request) Successful in 8m28s
2026-01-08 14:06:02 +00:00
argoyle e00cd62aa6 Merge pull request 'feat: add Gitea Actions workflow' (#40) from feat/gitea-migration into main
storage / vulnerabilities (push) Successful in 3m10s
storage / test (push) Successful in 3m24s
Reviewed-on: #40
2026-01-08 13:11:45 +00:00
argoyle 534427f2b1 feat: add Gitea Actions workflow
storage / test (pull_request) Successful in 1m36s
storage / vulnerabilities (pull_request) Successful in 1m11s
2026-01-08 14:09:14 +01:00
Unbound Release afa466fd9d chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release 4f74f5bd24 chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release 8eb1606e56 chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release dd29f1c269 chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release 904975ab71 chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release 1cc374cf60 chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release 5f51c86f6b chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release 43eabfe3b0 chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release 6034eeaebf chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release c9eddfd5ee chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release 0995fbee16 chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release 1bc385da98 chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release dfb0b9a32a chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release 76a3f6764a chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release 00a8a1d70d chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release ad02cf9349 chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release 33a74b280c chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release fb6d163640 chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release 7ca6dc1464 chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release 3195066da5 chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release 8df96b7155 chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release 18917e07da chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release 81377274c0 chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release 42a9e97a53 chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release 24895fe36b chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release 345eb623b0 chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release 76070072ae chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release 2ceb9afabf chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release 3acc7ec562 chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release 2d82816eea chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release b721a3c011 chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release 2a3c248fb2 chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release 9ea7a26861 chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release 3394413ba0 chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release f288ca48dc chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release e9c5d4a150 chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release cb02b810e3 chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release 994c50a2bf chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release aaa9d869ab chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
Unbound Release bb04bdd76a chore(release): prepare for v0.0.4 2025-12-31 21:07:48 +00:00
13 changed files with 371 additions and 149 deletions
+30
View File
@@ -0,0 +1,30 @@
name: storage
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: stable
- name: Run tests
run: go test -race -coverprofile=coverage.txt ./...
vulnerabilities:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: stable
- name: Check vulnerabilities
run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...
+25
View File
@@ -0,0 +1,25 @@
name: pre-commit
permissions: read-all
on:
pull_request:
push:
branches:
- main
jobs:
pre-commit:
runs-on: ubuntu-latest
env:
SKIP: no-commit-to-branch
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: stable
- name: Install Go tools
run: go install golang.org/x/tools/cmd/goimports@latest
- uses: actions/setup-python@v6
with:
python-version: '3.14'
- uses: pre-commit/action@v3.0.1
+9
View File
@@ -0,0 +1,9 @@
name: Release
on:
push:
branches: [main]
jobs:
release:
uses: unboundsoftware/shared-workflows/.gitea/workflows/Release.yml@main
-38
View File
@@ -1,38 +0,0 @@
include:
- template: 'Workflows/MergeRequest-Pipelines.gitlab-ci.yml'
- project: unboundsoftware/ci-templates
file: Defaults.gitlab-ci.yml
- project: unboundsoftware/ci-templates
file: Release.gitlab-ci.yml
- project: unboundsoftware/ci-templates
file: Pre-Commit-Go.gitlab-ci.yml
image: amd64/golang:1.25.5@sha256:ad03ba93327b8a6143b49373790b5d92c28067bdb814418509466122ee9c9e63
stages:
- deps
- test
deps:
stage: deps
script:
- go mod download
test:
stage: test
dependencies:
- deps
script:
- CGO_ENABLED=1 go test -mod=readonly -race -coverprofile=coverage.txt -covermode=atomic -coverpkg=$(go list ./... | tr '\n' , | sed 's/,$//') ./...
- go tool cover -html=coverage.txt -o coverage.html
- go tool cover -func=coverage.txt
- curl -Os https://uploader.codecov.io/latest/linux/codecov
- chmod +x codecov
- ./codecov -t ${CODECOV_TOKEN} -R $CI_PROJECT_DIR -C $CI_COMMIT_SHA -r $CI_PROJECT_PATH
vulnerabilities:
stage: test
image: amd64/golang:1.25.5@sha256:ad03ba93327b8a6143b49373790b5d92c28067bdb814418509466122ee9c9e63
script:
- go install golang.org/x/vuln/cmd/govulncheck@latest
- govulncheck ./...
+4 -11
View File
@@ -10,15 +10,8 @@ repos:
args: args:
- --allow-multiple-documents - --allow-multiple-documents
- id: check-added-large-files - id: check-added-large-files
- repo: https://gitlab.com/devopshq/gitlab-ci-linter
rev: v1.0.6
hooks:
- id: gitlab-ci-linter
args:
- --project
- unboundsoftware/storage
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook - repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.23.0 rev: v9.24.0
hooks: hooks:
- id: commitlint - id: commitlint
stages: [ commit-msg ] stages: [ commit-msg ]
@@ -30,17 +23,17 @@ repos:
- id: go-imports - id: go-imports
args: args:
- -local - -local
- gitlab.com/unboundsoftware/storage - gitea.unbound.se/unboundsoftware/storage
- repo: https://github.com/lietu/go-pre-commit - repo: https://github.com/lietu/go-pre-commit
rev: v1.0.0 rev: v1.0.0
hooks: hooks:
- id: go-test - id: go-test
- id: gofumpt - id: gofumpt
- repo: https://github.com/golangci/golangci-lint - repo: https://github.com/golangci/golangci-lint
rev: v2.7.2 rev: v2.11.4
hooks: hooks:
- id: golangci-lint-full - id: golangci-lint-full
- repo: https://github.com/gitleaks/gitleaks - repo: https://github.com/gitleaks/gitleaks
rev: v8.30.0 rev: v8.30.1
hooks: hooks:
- id: gitleaks - id: gitleaks
+3 -1
View File
@@ -1 +1,3 @@
{"version":"v0.0.3"} {
"version": "v0.4.0"
}
+124
View File
@@ -2,6 +2,130 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## [0.4.0] - 2026-04-17
### 🚀 Features
- Auto-enable path-style addressing when a custom endpoint is set (#99)
## [0.3.0] - 2026-04-16
### 🚀 Features
- Add PresignInlineURL method for inline content display (#97)
## [0.2.0] - 2026-04-16
### 🚀 Features
- Add PresignURL method for existing objects (#95)
### 🐛 Bug Fixes
- *(deps)* Update aws-sdk-go-v2 monorepo (#92)
- *(deps)* Update aws-sdk-go-v2 monorepo (#93)
## [0.1.4] - 2026-04-02
### 🐛 Bug Fixes
- *(deps)* Update module github.com/aws/aws-sdk-go-v2/service/s3 to v1.97.0 (#80)
- *(deps)* Update module github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager to v0.1.9 (#82)
- *(deps)* Update aws-sdk-go-v2 monorepo (#83)
- *(deps)* Update aws-sdk-go-v2 monorepo (#87)
- *(deps)* Update aws-sdk-go-v2 monorepo (#88)
- *(deps)* Update aws-sdk-go-v2 monorepo (#90)
### ⚙️ Miscellaneous Tasks
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.11.2 (#74)
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.11.3 (#76)
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.30.1 (#78)
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.11.4 (#85)
## [0.1.3] - 2026-03-06
### 🐛 Bug Fixes
- *(deps)* Update aws-sdk-go-v2 monorepo (#60)
- *(deps)* Update aws-sdk-go-v2 monorepo (#62)
- *(deps)* Update aws-sdk-go-v2 monorepo (#64)
- *(deps)* Update aws-sdk-go-v2 monorepo (#66)
- *(deps)* Update aws-sdk-go-v2 monorepo (#68)
- *(deps)* Update aws-sdk-go-v2 monorepo (#70)
### ⚙️ Miscellaneous Tasks
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.9.0 (#56)
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.10.1 (#58)
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.11.1 (#72)
## [0.1.2] - 2026-02-06
### 🐛 Bug Fixes
- *(deps)* Update aws-sdk-go-v2 monorepo (#49)
- *(deps)* Update module github.com/aws/aws-sdk-go-v2/feature/s3/manager to v1.21.0 (#51)
- *(deps)* Update aws-sdk-go-v2 monorepo (#53)
- *(deps)* Update module github.com/aws/aws-sdk-go-v2/feature/s3/manager to v1.22.0 (#54)
### 🚜 Refactor
- Migrate from deprecated s3/manager to s3/transfermanager
### ⚙️ Miscellaneous Tasks
- *(deps)* Update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.24.0 (#50)
## [0.1.1] - 2026-01-09
### ⚙️ Miscellaneous Tasks
- *(deps)* Update actions/setup-python action to v6
- Migrate module path to gitea.unbound.se
## [0.1.0] - 2026-01-09
### 🚀 Features
- Add Gitea Actions workflow
### 🐛 Bug Fixes
- *(deps)* Update aws-sdk-go-v2 monorepo
- *(deps)* Update aws-sdk-go-v2 monorepo
- *(deps)* Update module github.com/aws/aws-sdk-go-v2/feature/s3/manager to v1.20.10
- *(deps)* Update aws-sdk-go-v2 monorepo
- *(deps)* Update aws-sdk-go-v2 monorepo
- *(deps)* Update aws-sdk-go-v2 monorepo
- *(deps)* Update aws-sdk-go-v2 monorepo
- *(deps)* Update aws-sdk-go-v2 monorepo
- *(deps)* Update aws-sdk-go-v2 monorepo
- *(deps)* Update module github.com/aws/aws-sdk-go-v2/feature/s3/manager to v1.20.17
- *(deps)* Update module github.com/aws/aws-sdk-go-v2/feature/s3/manager to v1.20.18
### 📚 Documentation
- Add CLAUDE.md for Claude Code integration
### ⚙️ Miscellaneous Tasks
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.6.2
- *(deps)* Update golang:1.25.4 docker digest to efe81fa
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.29.1
- *(deps)* Update pre-commit hook gitleaks/gitleaks to v8.30.0
- *(deps)* Update golang docker tag to v1.25.5
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.7.0
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.7.1
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.7.2
- *(deps)* Update golang:1.25.5 docker digest to 0c27bcf
- *(deps)* Update golang:1.25.5 docker digest to ad03ba9
- *(deps)* Update actions/checkout action to v6
- *(deps)* Update actions/setup-go action to v6
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.8.0
- Migrate from GitLab to Gitea
- Add pre-commit and release workflows
## [0.0.3] - 2025-11-13 ## [0.0.3] - 2025-11-13
### 🐛 Bug Fixes ### 🐛 Bug Fixes
+19 -17
View File
@@ -1,41 +1,43 @@
# storage # storage
Shared Go library for AWS S3 storage operations. Standalone Go library for AWS S3 storage operations.
## Shared Documentation **Note:** This is an independent library, not part of the Shiny ecosystem, though it is currently only used by Shiny services.
@../docs/claude/architecture.md ## Purpose
@../docs/claude/go-services.md
@../docs/claude/conventions.md
## Library Information
### Purpose
Provides standardized S3 object storage utilities with presigned URL generation. Used by services that need to store and serve files (PDFs, images, etc.). Provides standardized S3 object storage utilities with presigned URL generation. Used by services that need to store and serve files (PDFs, images, etc.).
### Usage ## Usage
```go ```go
import "gitlab.com/unboundsoftware/shiny/storage" import "gitea.unbound.se/unboundsoftware/storage"
// Create storage with automatic AWS config // Option 1: Managed uploads (multipart, 5MB part size) - loads AWS config automatically
s3Storage, err := storage.New("my-bucket") s3Storage, err := storage.New("my-bucket")
// Option 2: Direct uploads with custom AWS config
cfg, _ := config.LoadDefaultConfig(context.Background())
s3Storage := storage.NewS3(cfg, "my-bucket")
// Upload and get presigned URL (15-minute expiration) // Upload and get presigned URL (15-minute expiration)
url, err := s3Storage.Store("path/to/file.pdf", reader, "application/pdf") url, err := s3Storage.Store("path/to/file.pdf", reader, "application/pdf")
``` ```
### Features ## Features
- **Managed uploads** - For large files with multipart upload - **Managed uploads** (`New`) - Uses upload manager with 5MB multipart chunks for large files
- **Direct uploads** - For smaller files or custom config - **Direct uploads** (`NewS3`) - Uses PutObject directly, allows custom AWS config
- **Presigned URLs** - 15-minute expiration for secure access - **Presigned URLs** - 15-minute expiration for secure access
- **Configurable part size** - For multipart upload optimization
### Configuration ## Configuration
Uses AWS SDK v2, loading config from: Uses AWS SDK v2, loading config from:
- Environment variables (`AWS_REGION`, `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`) - Environment variables (`AWS_REGION`, `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`)
- Shared config files (`~/.aws/config`, `~/.aws/credentials`) - Shared config files (`~/.aws/config`, `~/.aws/credentials`)
- IAM roles (on AWS infrastructure) - IAM roles (on AWS infrastructure)
## Development
- Go 1.23+
- Run tests: `go test ./...`
+2 -2
View File
@@ -14,7 +14,7 @@ Shared storage utilities for AWS S3.
### Using the Upload Manager (recommended for large files) ### Using the Upload Manager (recommended for large files)
```go ```go
import "gitlab.com/unboundsoftware/storage" import "gitea.unbound.se/unboundsoftware/storage"
// Create storage with automatic AWS config loading // Create storage with automatic AWS config loading
s3Storage, err := storage.New("my-bucket") s3Storage, err := storage.New("my-bucket")
@@ -31,7 +31,7 @@ url, err := s3Storage.Store("path/to/file.pdf", fileReader, "application/pdf")
```go ```go
import ( import (
"github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/config"
"gitlab.com/unboundsoftware/storage" "git.unbound.se/unboundsoftware/storage"
) )
// Load custom AWS config // Load custom AWS config
+22 -22
View File
@@ -1,29 +1,29 @@
module gitlab.com/unboundsoftware/storage module gitea.unbound.se/unboundsoftware/storage
go 1.23 go 1.24
require ( require (
github.com/aws/aws-sdk-go-v2 v1.41.0 github.com/aws/aws-sdk-go-v2 v1.41.5
github.com/aws/aws-sdk-go-v2/config v1.32.6 github.com/aws/aws-sdk-go-v2/config v1.32.14
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.20.18 github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.1.15
github.com/aws/aws-sdk-go-v2/service/s3 v1.95.0 github.com/aws/aws-sdk-go-v2/service/s3 v1.99.0
) )
require ( require (
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.4 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.8 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.19.6 // indirect github.com/aws/aws-sdk-go-v2/credentials v1.19.14 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.16 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.16 // indirect github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.16 // indirect github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.6 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.16 // indirect github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.22 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.4 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.7 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.7 // indirect github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.13 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.16 // indirect github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.21 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.16 // indirect github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.21 // indirect
github.com/aws/aws-sdk-go-v2/service/signin v1.0.4 // indirect github.com/aws/aws-sdk-go-v2/service/signin v1.0.9 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.30.8 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.30.15 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.12 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.19 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.41.5 // indirect github.com/aws/aws-sdk-go-v2/service/sts v1.41.10 // indirect
github.com/aws/smithy-go v1.24.0 // indirect github.com/aws/smithy-go v1.24.2 // indirect
) )
+40 -40
View File
@@ -1,40 +1,40 @@
github.com/aws/aws-sdk-go-v2 v1.41.0 h1:tNvqh1s+v0vFYdA1xq0aOJH+Y5cRyZ5upu6roPgPKd4= github.com/aws/aws-sdk-go-v2 v1.41.5 h1:dj5kopbwUsVUVFgO4Fi5BIT3t4WyqIDjGKCangnV/yY=
github.com/aws/aws-sdk-go-v2 v1.41.0/go.mod h1:MayyLB8y+buD9hZqkCW3kX1AKq07Y5pXxtgB+rRFhz0= github.com/aws/aws-sdk-go-v2 v1.41.5/go.mod h1:mwsPRE8ceUUpiTgF7QmQIJ7lgsKUPQOUl3o72QBrE1o=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.4 h1:489krEF9xIGkOaaX3CE/Be2uWjiXrkCH6gUX+bZA/BU= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.8 h1:eBMB84YGghSocM7PsjmmPffTa+1FBUeNvGvFou6V/4o=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.4/go.mod h1:IOAPF6oT9KCsceNTvvYMNHy0+kMF8akOjeDvPENWxp4= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.8/go.mod h1:lyw7GFp3qENLh7kwzf7iMzAxDn+NzjXEAGjKS2UOKqI=
github.com/aws/aws-sdk-go-v2/config v1.32.6 h1:hFLBGUKjmLAekvi1evLi5hVvFQtSo3GYwi+Bx4lpJf8= github.com/aws/aws-sdk-go-v2/config v1.32.14 h1:opVIRo/ZbbI8OIqSOKmpFaY7IwfFUOCCXBsUpJOwDdI=
github.com/aws/aws-sdk-go-v2/config v1.32.6/go.mod h1:lcUL/gcd8WyjCrMnxez5OXkO3/rwcNmvfno62tnXNcI= github.com/aws/aws-sdk-go-v2/config v1.32.14/go.mod h1:U4/V0uKxh0Tl5sxmCBZ3AecYny4UNlVmObYjKuuaiOo=
github.com/aws/aws-sdk-go-v2/credentials v1.19.6 h1:F9vWao2TwjV2MyiyVS+duza0NIRtAslgLUM0vTA1ZaE= github.com/aws/aws-sdk-go-v2/credentials v1.19.14 h1:n+UcGWAIZHkXzYt87uMFBv/l8THYELoX6gVcUvgl6fI=
github.com/aws/aws-sdk-go-v2/credentials v1.19.6/go.mod h1:SgHzKjEVsdQr6Opor0ihgWtkWdfRAIwxYzSJ8O85VHY= github.com/aws/aws-sdk-go-v2/credentials v1.19.14/go.mod h1:cJKuyWB59Mqi0jM3nFYQRmnHVQIcgoxjEMAbLkpr62w=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.16 h1:80+uETIWS1BqjnN9uJ0dBUaETh+P1XwFy5vwHwK5r9k= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.21 h1:NUS3K4BTDArQqNu2ih7yeDLaS3bmHD0YndtA6UP884g=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.16/go.mod h1:wOOsYuxYuB/7FlnVtzeBYRcjSRtQpAW0hCP7tIULMwo= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.21/go.mod h1:YWNWJQNjKigKY1RHVJCuupeWDrrHjRqHm0N9rdrWzYI=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.20.18 h1:9vWXHtaepwoAl/UuKzxwgOoJDXPCC3hvgNMfcmdS2Tk= github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.1.15 h1:92MfpwB6KjsPIEq9g3DniRPxOe92ew5hUz1h8W8cX7E=
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.20.18/go.mod h1:sKuUZ+MwUTuJbYvZ8pK0x10LvgcJK3Y4rmh63YBekwk= github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.1.15/go.mod h1:7O129SmOn4acM++3oVfTLAeHmNOsj0y7AA7zmbgnGOk=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.16 h1:rgGwPzb82iBYSvHMHXc8h9mRoOUBZIGFgKb9qniaZZc= github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.21 h1:Rgg6wvjjtX8bNHcvi9OnXWwcE0a2vGpbwmtICOsvcf4=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.16/go.mod h1:L/UxsGeKpGoIj6DxfhOWHWQ/kGKcd4I1VncE4++IyKA= github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.21/go.mod h1:A/kJFst/nm//cyqonihbdpQZwiUhhzpqTsdbhDdRF9c=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.16 h1:1jtGzuV7c82xnqOVfx2F0xmJcOw5374L7N6juGW6x6U= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.21 h1:PEgGVtPoB6NTpPrBgqSE5hE/o47Ij9qk/SEZFbUOe9A=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.16/go.mod h1:M2E5OQf+XLe+SZGmmpaI2yy+J326aFf6/+54PoxSANc= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.21/go.mod h1:p+hz+PRAYlY3zcpJhPwXlLC4C+kqn70WIHwnzAfs6ps=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4 h1:WKuaxf++XKWlHWu9ECbMlha8WOEGm0OUEZqm4K/Gcfk= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.6 h1:qYQ4pzQ2Oz6WpQ8T3HvGHnZydA72MnLuFK9tJwmrbHw=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4/go.mod h1:ZWy7j6v1vWGmPReu0iSGvRiise4YI5SkR3OHKTZ6Wuc= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.6/go.mod h1:O3h0IK87yXci+kg6flUKzJnWeziQUKciKrLjcatSNcY=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.16 h1:CjMzUs78RDDv4ROu3JnJn/Ig1r6ZD7/T2DXLLRpejic= github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.22 h1:rWyie/PxDRIdhNf4DzRk0lvjVOqFJuNnO8WwaIRVxzQ=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.16/go.mod h1:uVW4OLBqbJXSHJYA9svT9BluSvvwbzLQ2Crf6UPzR3c= github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.22/go.mod h1:zd/JsJ4P7oGfUhXn1VyLqaRZwPmZwg44Jf2dS84Dm3Y=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.4 h1:0ryTNEdJbzUCEWkVXEXoqlXV72J5keC1GvILMOuD00E= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.7 h1:5EniKhLZe4xzL7a+fU3C2tfUN4nWIqlLesfrjkuPFTY=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.4/go.mod h1:HQ4qwNZh32C3CBeO6iJLQlgtMzqeG17ziAA/3KDJFow= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.7/go.mod h1:x0nZssQ3qZSnIcePWLvcoFisRXJzcTVvYpAAdYX8+GI=
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.7 h1:DIBqIrJ7hv+e4CmIk2z3pyKT+3B6qVMgRsawHiR3qso= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.13 h1:JRaIgADQS/U6uXDqlPiefP32yXTda7Kqfx+LgspooZM=
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.7/go.mod h1:vLm00xmBke75UmpNvOcZQ/Q30ZFjbczeLFqGx5urmGo= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.13/go.mod h1:CEuVn5WqOMilYl+tbccq8+N2ieCy0gVn3OtRb0vBNNM=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.16 h1:oHjJHeUy0ImIV0bsrX0X91GkV5nJAyv1l1CC9lnO0TI= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.21 h1:c31//R3xgIJMSC8S6hEVq+38DcvUlgFY0FM6mSI5oto=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.16/go.mod h1:iRSNGgOYmiYwSCXxXaKb9HfOEj40+oTKn8pTxMlYkRM= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.21/go.mod h1:r6+pf23ouCB718FUxaqzZdbpYFyDtehyZcmP5KL9FkA=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.16 h1:NSbvS17MlI2lurYgXnCOLvCFX38sBW4eiVER7+kkgsU= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.21 h1:ZlvrNcHSFFWURB8avufQq9gFsheUgjVD9536obIknfM=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.16/go.mod h1:SwT8Tmqd4sA6G1qaGdzWCJN99bUmPGHfRwwq3G5Qb+A= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.21/go.mod h1:cv3TNhVrssKR0O/xxLJVRfd2oazSnZnkUeTf6ctUwfQ=
github.com/aws/aws-sdk-go-v2/service/s3 v1.95.0 h1:MIWra+MSq53CFaXXAywB2qg9YvVZifkk6vEGl/1Qor0= github.com/aws/aws-sdk-go-v2/service/s3 v1.99.0 h1:hlSuz394kV0vhv9drL5lhuEFbEOEP1VyQpy15qWh1Pk=
github.com/aws/aws-sdk-go-v2/service/s3 v1.95.0/go.mod h1:79S2BdqCJpScXZA2y+cpZuocWsjGjJINyXnOsf5DTz8= github.com/aws/aws-sdk-go-v2/service/s3 v1.99.0/go.mod h1:uoA43SdFwacedBfSgfFSjjCvYe8aYBS7EnU5GZ/YKMM=
github.com/aws/aws-sdk-go-v2/service/signin v1.0.4 h1:HpI7aMmJ+mm1wkSHIA2t5EaFFv5EFYXePW30p1EIrbQ= github.com/aws/aws-sdk-go-v2/service/signin v1.0.9 h1:QKZH0S178gCmFEgst8hN0mCX1KxLgHBKKY/CLqwP8lg=
github.com/aws/aws-sdk-go-v2/service/signin v1.0.4/go.mod h1:C5RdGMYGlfM0gYq/tifqgn4EbyX99V15P2V3R+VHbQU= github.com/aws/aws-sdk-go-v2/service/signin v1.0.9/go.mod h1:7yuQJoT+OoH8aqIxw9vwF+8KpvLZ8AWmvmUWHsGQZvI=
github.com/aws/aws-sdk-go-v2/service/sso v1.30.8 h1:aM/Q24rIlS3bRAhTyFurowU8A0SMyGDtEOY/l/s/1Uw= github.com/aws/aws-sdk-go-v2/service/sso v1.30.15 h1:lFd1+ZSEYJZYvv9d6kXzhkZu07si3f+GQ1AaYwa2LUM=
github.com/aws/aws-sdk-go-v2/service/sso v1.30.8/go.mod h1:+fWt2UHSb4kS7Pu8y+BMBvJF0EWx+4H0hzNwtDNRTrg= github.com/aws/aws-sdk-go-v2/service/sso v1.30.15/go.mod h1:WSvS1NLr7JaPunCXqpJnWk1Bjo7IxzZXrZi1QQCkuqM=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.12 h1:AHDr0DaHIAo8c9t1emrzAlVDFp+iMMKnPdYy6XO4MCE= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.19 h1:dzztQ1YmfPrxdrOiuZRMF6fuOwWlWpD2StNLTceKpys=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.12/go.mod h1:GQ73XawFFiWxyWXMHWfhiomvP3tXtdNar/fi8z18sx0= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.19/go.mod h1:YO8TrYtFdl5w/4vmjL8zaBSsiNp3w0L1FfKVKenZT7w=
github.com/aws/aws-sdk-go-v2/service/sts v1.41.5 h1:SciGFVNZ4mHdm7gpD1dgZYnCuVdX1s+lFTg4+4DOy70= github.com/aws/aws-sdk-go-v2/service/sts v1.41.10 h1:p8ogvvLugcR/zLBXTXrTkj0RYBUdErbMnAFFp12Lm/U=
github.com/aws/aws-sdk-go-v2/service/sts v1.41.5/go.mod h1:iW40X4QBmUxdP+fZNOpfmkdMZqsovezbAeO+Ubiv2pk= github.com/aws/aws-sdk-go-v2/service/sts v1.41.10/go.mod h1:60dv0eZJfeVXfbT1tFJinbHrDfSJ2GZl4Q//OSSNAVw=
github.com/aws/smithy-go v1.24.0 h1:LpilSUItNPFr1eY85RYgTIg5eIEPtvFbskaFcmmIUnk= github.com/aws/smithy-go v1.24.2 h1:FzA3bu/nt/vDvmnkg+R8Xl46gmzEDam6mZ1hzmwXFng=
github.com/aws/smithy-go v1.24.0/go.mod h1:LEj2LM3rBRQJxPZTB4KuzZkaZYnZPnvgIhb4pu07mx0= github.com/aws/smithy-go v1.24.2/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc=
+54 -8
View File
@@ -3,18 +3,32 @@ package storage
import ( import (
"context" "context"
"io" "io"
"os"
"time" "time"
"github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws"
v4 "github.com/aws/aws-sdk-go-v2/aws/signer/v4" v4 "github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/feature/s3/manager" "github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager"
"github.com/aws/aws-sdk-go-v2/service/s3" "github.com/aws/aws-sdk-go-v2/service/s3"
) )
// Uploader is the interface for uploading objects to S3 using the upload manager // s3ClientOptions returns the per-client overrides applied to every S3 client
// constructed by this package. When the AWS_ENDPOINT_URL_S3 (or
// AWS_ENDPOINT_URL) env var is set — typically because the runtime is
// pointing at a local MinIO/S3-compatible endpoint — path-style addressing
// is enabled so requests look like `http://host:9000/bucket/key` instead of
// `http://bucket.host:9000/key`. Production deployments leave those vars
// unset and continue talking to real S3 with virtual-hosted style.
func s3ClientOptions(o *s3.Options) {
if os.Getenv("AWS_ENDPOINT_URL_S3") != "" || os.Getenv("AWS_ENDPOINT_URL") != "" {
o.UsePathStyle = true
}
}
// Uploader is the interface for uploading objects to S3 using the transfer manager
type Uploader interface { type Uploader interface {
Upload(ctx context.Context, input *s3.PutObjectInput, opts ...func(*manager.Uploader)) (*manager.UploadOutput, error) UploadObject(ctx context.Context, input *transfermanager.UploadObjectInput, opts ...func(*transfermanager.Options)) (*transfermanager.UploadObjectOutput, error)
} }
// DirectUploader is the interface for uploading objects directly to S3 // DirectUploader is the interface for uploading objects directly to S3
@@ -45,7 +59,7 @@ func (s *S3) Store(path string, content io.Reader, contentType string) (string,
} }
func (s *S3) storeWithManager(path string, content io.Reader, contentType string) (string, error) { func (s *S3) storeWithManager(path string, content io.Reader, contentType string) (string, error) {
out, err := s.svc.Upload(context.Background(), &s3.PutObjectInput{ out, err := s.svc.UploadObject(context.Background(), &transfermanager.UploadObjectInput{
Bucket: aws.String(s.bucket), Bucket: aws.String(s.bucket),
Key: aws.String(path), Key: aws.String(path),
Body: content, Body: content,
@@ -92,6 +106,38 @@ func (s *S3) storeWithDirectUpload(path string, content io.Reader, contentType s
return req.URL, nil return req.URL, nil
} }
// PresignURL generates a presigned download URL for an existing object.
// The URL is valid for 15 minutes.
func (s *S3) PresignURL(ctx context.Context, key string) (string, error) {
req, err := s.presigner.PresignGetObject(ctx, &s3.GetObjectInput{
Bucket: aws.String(s.bucket),
Key: aws.String(key),
}, s3.WithPresignExpires(15*time.Minute))
if err != nil {
return "", err
}
return req.URL, nil
}
// PresignInlineURL generates a presigned URL that tells the browser to display
// the content inline rather than triggering a download. The URL is valid for
// 15 minutes.
func (s *S3) PresignInlineURL(ctx context.Context, key string, contentType string) (string, error) {
input := &s3.GetObjectInput{
Bucket: aws.String(s.bucket),
Key: aws.String(key),
ResponseContentDisposition: aws.String("inline"),
}
if contentType != "" {
input.ResponseContentType = aws.String(contentType)
}
req, err := s.presigner.PresignGetObject(ctx, input, s3.WithPresignExpires(15*time.Minute))
if err != nil {
return "", err
}
return req.URL, nil
}
// New creates a new S3 storage instance using the upload manager // New creates a new S3 storage instance using the upload manager
// This loads AWS config from the default locations and is suitable for most use cases // This loads AWS config from the default locations and is suitable for most use cases
func New(bucket string) (*S3, error) { func New(bucket string) (*S3, error) {
@@ -99,9 +145,9 @@ func New(bucket string) (*S3, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
client := s3.NewFromConfig(cfg) client := s3.NewFromConfig(cfg, s3ClientOptions)
uploader := manager.NewUploader(client, func(u *manager.Uploader) { uploader := transfermanager.New(client, func(o *transfermanager.Options) {
u.PartSize = 5 * 1024 * 1024 o.PartSizeBytes = 5 * 1024 * 1024
}) })
presignClient := s3.NewPresignClient(client) presignClient := s3.NewPresignClient(client)
return &S3{ return &S3{
@@ -115,7 +161,7 @@ func New(bucket string) (*S3, error) {
// NewS3 creates a new S3 storage instance using direct PutObject // NewS3 creates a new S3 storage instance using direct PutObject
// This is useful when you want more control over the AWS configuration // This is useful when you want more control over the AWS configuration
func NewS3(cfg aws.Config, bucket string) *S3 { func NewS3(cfg aws.Config, bucket string) *S3 {
client := s3.NewFromConfig(cfg) client := s3.NewFromConfig(cfg, s3ClientOptions)
return &S3{ return &S3{
bucket: bucket, bucket: bucket,
directSvc: client, directSvc: client,
+39 -10
View File
@@ -10,17 +10,17 @@ import (
"github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws"
v4 "github.com/aws/aws-sdk-go-v2/aws/signer/v4" v4 "github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/feature/s3/manager" "github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager"
"github.com/aws/aws-sdk-go-v2/service/s3" "github.com/aws/aws-sdk-go-v2/service/s3"
) )
// Mock implementations for testing // Mock implementations for testing
type mockUploader struct { type mockUploader struct {
uploadFunc func(ctx context.Context, input *s3.PutObjectInput, opts ...func(*manager.Uploader)) (*manager.UploadOutput, error) uploadFunc func(ctx context.Context, input *transfermanager.UploadObjectInput, opts ...func(*transfermanager.Options)) (*transfermanager.UploadObjectOutput, error)
} }
func (m *mockUploader) Upload(ctx context.Context, input *s3.PutObjectInput, opts ...func(*manager.Uploader)) (*manager.UploadOutput, error) { func (m *mockUploader) UploadObject(ctx context.Context, input *transfermanager.UploadObjectInput, opts ...func(*transfermanager.Options)) (*transfermanager.UploadObjectOutput, error) {
return m.uploadFunc(ctx, input, opts...) return m.uploadFunc(ctx, input, opts...)
} }
@@ -40,6 +40,35 @@ func (m *mockPresigner) PresignGetObject(ctx context.Context, params *s3.GetObje
return m.presignFunc(ctx, params, optFns...) return m.presignFunc(ctx, params, optFns...)
} }
// Test path-style toggle
func TestS3ClientOptions_PathStyleTogglesOnCustomEndpoint(t *testing.T) {
cases := []struct {
name string
envVar string
value string
expected bool
}{
{name: "no env var → virtual-hosted", envVar: "", expected: false},
{name: "AWS_ENDPOINT_URL_S3 set → path-style", envVar: "AWS_ENDPOINT_URL_S3", value: "http://minio:9000", expected: true},
{name: "AWS_ENDPOINT_URL set → path-style", envVar: "AWS_ENDPOINT_URL", value: "http://minio:9000", expected: true},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
t.Setenv("AWS_ENDPOINT_URL", "")
t.Setenv("AWS_ENDPOINT_URL_S3", "")
if tc.envVar != "" {
t.Setenv(tc.envVar, tc.value)
}
opts := s3.Options{}
s3ClientOptions(&opts)
if opts.UsePathStyle != tc.expected {
t.Fatalf("UsePathStyle = %v, want %v", opts.UsePathStyle, tc.expected)
}
})
}
}
// Test NewS3 constructor // Test NewS3 constructor
func TestNewS3(t *testing.T) { func TestNewS3(t *testing.T) {
@@ -81,7 +110,7 @@ func TestStore_WithUploadManager_Success(t *testing.T) {
expectedURL := "https://s3.amazonaws.com/test-bucket/path/to/file.pdf?presigned=true" expectedURL := "https://s3.amazonaws.com/test-bucket/path/to/file.pdf?presigned=true"
mockUploader := &mockUploader{ mockUploader := &mockUploader{
uploadFunc: func(ctx context.Context, input *s3.PutObjectInput, opts ...func(*manager.Uploader)) (*manager.UploadOutput, error) { uploadFunc: func(ctx context.Context, input *transfermanager.UploadObjectInput, opts ...func(*transfermanager.Options)) (*transfermanager.UploadObjectOutput, error) {
// Verify input parameters // Verify input parameters
if *input.Bucket != testBucket { if *input.Bucket != testBucket {
t.Errorf("Expected bucket %s, got %s", testBucket, *input.Bucket) t.Errorf("Expected bucket %s, got %s", testBucket, *input.Bucket)
@@ -99,7 +128,7 @@ func TestStore_WithUploadManager_Success(t *testing.T) {
t.Errorf("Expected content %s, got %s", testContent, string(body)) t.Errorf("Expected content %s, got %s", testContent, string(body))
} }
return &manager.UploadOutput{ return &transfermanager.UploadObjectOutput{
Key: aws.String(testPath), Key: aws.String(testPath),
}, nil }, nil
}, },
@@ -149,7 +178,7 @@ func TestStore_WithUploadManager_UploadError(t *testing.T) {
expectedError := errors.New("upload failed") expectedError := errors.New("upload failed")
mockUploader := &mockUploader{ mockUploader := &mockUploader{
uploadFunc: func(ctx context.Context, input *s3.PutObjectInput, opts ...func(*manager.Uploader)) (*manager.UploadOutput, error) { uploadFunc: func(ctx context.Context, input *transfermanager.UploadObjectInput, opts ...func(*transfermanager.Options)) (*transfermanager.UploadObjectOutput, error) {
return nil, expectedError return nil, expectedError
}, },
} }
@@ -191,8 +220,8 @@ func TestStore_WithUploadManager_PresignError(t *testing.T) {
expectedError := errors.New("presign failed") expectedError := errors.New("presign failed")
mockUploader := &mockUploader{ mockUploader := &mockUploader{
uploadFunc: func(ctx context.Context, input *s3.PutObjectInput, opts ...func(*manager.Uploader)) (*manager.UploadOutput, error) { uploadFunc: func(ctx context.Context, input *transfermanager.UploadObjectInput, opts ...func(*transfermanager.Options)) (*transfermanager.UploadObjectOutput, error) {
return &manager.UploadOutput{ return &transfermanager.UploadObjectOutput{
Key: aws.String(testPath), Key: aws.String(testPath),
}, nil }, nil
}, },
@@ -390,8 +419,8 @@ func TestStore_PresignExpiry(t *testing.T) {
var capturedExpiry time.Duration var capturedExpiry time.Duration
mockUploader := &mockUploader{ mockUploader := &mockUploader{
uploadFunc: func(ctx context.Context, input *s3.PutObjectInput, opts ...func(*manager.Uploader)) (*manager.UploadOutput, error) { uploadFunc: func(ctx context.Context, input *transfermanager.UploadObjectInput, opts ...func(*transfermanager.Options)) (*transfermanager.UploadObjectOutput, error) {
return &manager.UploadOutput{Key: aws.String(testPath)}, nil return &transfermanager.UploadObjectOutput{Key: aws.String(testPath)}, nil
}, },
} }