85 Commits

Author SHA1 Message Date
releaser 409447ab08 chore(release): prepare for v0.4.3
storage / test (pull_request) Successful in 1m32s
storage / vulnerabilities (pull_request) Successful in 1m39s
pre-commit / pre-commit (pull_request) Successful in 5m46s
2026-06-20 20:29:53 +00:00
releaser 1cd4f0c0ba chore(release): prepare for v0.4.3 2026-06-20 20:29:50 +00:00
renovate 7143a4aca5 chore(deps): update actions/checkout action to v7 (#144)
storage / test (push) Successful in 1m33s
storage / vulnerabilities (push) Successful in 1m32s
Release / release (push) Successful in 53s
pre-commit / pre-commit (push) Successful in 5m33s
This PR contains the following updates:

| Package | Type | Update | Change | Pending |
|---|---|---|---|---|
| [actions/checkout](https://github.com/actions/checkout) | action | major | `v6` → `v7` | `v7.0.0` |

---

### Release Notes

<details>
<summary>actions/checkout (actions/checkout)</summary>

### [`v7.0.0`](https://github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v700)

[Compare Source](https://github.com/actions/checkout/compare/v7.0.0...v7.0.0)

- Block checking out fork PR for pull\_request\_target and workflow\_run by [@&#8203;aiqiaoy](https://github.com/aiqiaoy) in [#&#8203;2454](https://github.com/actions/checkout/pull/2454)
- Bump actions/publish-immutable-action from 0.0.3 to 0.0.4 in the minor-actions-dependencies group across 1 directory by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2458](https://github.com/actions/checkout/pull/2458)
- Bump flatted from 3.3.1 to 3.4.2 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2460](https://github.com/actions/checkout/pull/2460)
- Bump js-yaml from 4.1.0 to 4.2.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2461](https://github.com/actions/checkout/pull/2461)
- Bump [@&#8203;actions/core](https://github.com/actions/core) and [@&#8203;actions/tool-cache](https://github.com/actions/tool-cache) and Remove uuid by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2459](https://github.com/actions/checkout/pull/2459)
- upgrade module to esm and update dependencies by [@&#8203;aiqiaoy](https://github.com/aiqiaoy) in [#&#8203;2463](https://github.com/actions/checkout/pull/2463)
- Bump the minor-npm-dependencies group across 1 directory with 3 updates by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2462](https://github.com/actions/checkout/pull/2462)

### [`v7`](https://github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v700)

[Compare Source](https://github.com/actions/checkout/compare/v6.0.3...v7.0.0)

- Block checking out fork PR for pull\_request\_target and workflow\_run by [@&#8203;aiqiaoy](https://github.com/aiqiaoy) in [#&#8203;2454](https://github.com/actions/checkout/pull/2454)
- Bump actions/publish-immutable-action from 0.0.3 to 0.0.4 in the minor-actions-dependencies group across 1 directory by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2458](https://github.com/actions/checkout/pull/2458)
- Bump flatted from 3.3.1 to 3.4.2 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2460](https://github.com/actions/checkout/pull/2460)
- Bump js-yaml from 4.1.0 to 4.2.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2461](https://github.com/actions/checkout/pull/2461)
- Bump [@&#8203;actions/core](https://github.com/actions/core) and [@&#8203;actions/tool-cache](https://github.com/actions/tool-cache) and Remove uuid by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2459](https://github.com/actions/checkout/pull/2459)
- upgrade module to esm and update dependencies by [@&#8203;aiqiaoy](https://github.com/aiqiaoy) in [#&#8203;2463](https://github.com/actions/checkout/pull/2463)
- Bump the minor-npm-dependencies group across 1 directory with 3 updates by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;2462](https://github.com/actions/checkout/pull/2462)

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yMjAuMCIsInVwZGF0ZWRJblZlciI6IjQzLjIyMC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Reviewed-on: #144
Co-authored-by: Renovate Bot <renovate@unbound.se>
Co-committed-by: Renovate Bot <renovate@unbound.se>
2026-06-20 19:25:11 +00:00
renovate 2f872143b3 fix(deps): update aws-sdk-go-v2 monorepo (#142)
storage / test (push) Successful in 1m42s
storage / vulnerabilities (push) Successful in 1m46s
Release / release (push) Successful in 58s
pre-commit / pre-commit (push) Successful in 6m7s
2026-06-19 19:34:45 +00:00
renovate d1024ef0d4 fix(deps): update aws-sdk-go-v2 monorepo (#140)
Release / release (push) Successful in 1m0s
storage / test (push) Successful in 1m37s
storage / vulnerabilities (push) Successful in 1m36s
pre-commit / pre-commit (push) Successful in 6m12s
2026-06-13 19:27:43 +00:00
renovate f038c55ac6 fix(deps): update aws-sdk-go-v2 monorepo (#138)
Release / release (push) Successful in 58s
storage / test (push) Successful in 1m33s
storage / vulnerabilities (push) Successful in 1m40s
pre-commit / pre-commit (push) Successful in 5m48s
2026-06-11 19:29:20 +00:00
releaser fde0fbb16f chore(release): prepare for v0.4.2 (#137)
Release / release (push) Successful in 1m9s
storage / test (push) Successful in 2m7s
pre-commit / pre-commit (push) Successful in 6m32s
storage / vulnerabilities (push) Failing after 16m28s
## [0.4.2] - 2026-06-08

### 🐛 Bug Fixes

- *(deps)* Update aws-sdk-go-v2 monorepo (#116)
- *(deps)* Update aws-sdk-go-v2 monorepo (#118)
- *(deps)* Update aws-sdk-go-v2 monorepo (#120)
- *(deps)* Update aws-sdk-go-v2 monorepo (#122)
- *(deps)* Update aws-sdk-go-v2 monorepo (#124)
- *(deps)* Update module github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager to v0.2.3 (#126)
- *(deps)* Update aws-sdk-go-v2 monorepo (#128)
- *(deps)* Update aws-sdk-go-v2 monorepo (#130)
- *(deps)* Update aws-sdk-go-v2 monorepo (#132)
- *(deps)* Update aws-sdk-go-v2 monorepo to v0.2.7 (#134)
- *(deps)* Update aws-sdk-go-v2 monorepo to v0.2.8 (#136)

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

---

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

Reviewed-on: #137
Co-authored-by: Unbound Releaser <releaser@unbound.se>
Co-committed-by: Unbound Releaser <releaser@unbound.se>
2026-06-11 06:04:56 +00:00
renovate 6a28ebaafe fix(deps): update aws-sdk-go-v2 monorepo to v0.2.8 (#136)
Release / release (push) Successful in 1m4s
storage / test (push) Successful in 1m33s
storage / vulnerabilities (push) Successful in 1m37s
pre-commit / pre-commit (push) Successful in 6m45s
2026-06-08 21:33:08 +00:00
renovate 84011d41b6 fix(deps): update aws-sdk-go-v2 monorepo to v0.2.7 (#134)
Release / release (push) Successful in 58s
storage / test (push) Successful in 1m30s
storage / vulnerabilities (push) Successful in 1m43s
pre-commit / pre-commit (push) Successful in 6m9s
2026-06-08 19:32:41 +00:00
renovate 0847617837 fix(deps): update aws-sdk-go-v2 monorepo (#132)
Release / release (push) Successful in 58s
storage / test (push) Successful in 1m33s
storage / vulnerabilities (push) Successful in 1m36s
pre-commit / pre-commit (push) Successful in 5m28s
2026-06-07 20:24:11 +00:00
renovate ebee54114f fix(deps): update aws-sdk-go-v2 monorepo (#130)
Release / release (push) Successful in 1m8s
storage / test (push) Successful in 1m34s
storage / vulnerabilities (push) Successful in 1m34s
pre-commit / pre-commit (push) Successful in 5m37s
2026-06-06 07:28:08 +00:00
renovate 34390f572a fix(deps): update aws-sdk-go-v2 monorepo (#128)
Release / release (push) Successful in 55s
storage / test (push) Successful in 1m32s
storage / vulnerabilities (push) Successful in 1m38s
pre-commit / pre-commit (push) Successful in 5m36s
2026-06-05 19:37:17 +00:00
renovate 906a729ee8 fix(deps): update module github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager to v0.2.3 (#126)
storage / test (push) Successful in 1m36s
storage / vulnerabilities (push) Successful in 1m38s
Release / release (push) Successful in 57s
pre-commit / pre-commit (push) Successful in 6m2s
2026-06-04 19:28:19 +00:00
renovate df37079491 fix(deps): update aws-sdk-go-v2 monorepo (#124)
Release / release (push) Successful in 1m5s
storage / test (push) Successful in 1m33s
storage / vulnerabilities (push) Successful in 1m40s
pre-commit / pre-commit (push) Successful in 5m41s
2026-06-01 19:30:21 +00:00
renovate 23f8e5e9eb fix(deps): update aws-sdk-go-v2 monorepo (#122)
Release / release (push) Successful in 1m1s
storage / test (push) Successful in 1m31s
storage / vulnerabilities (push) Successful in 1m41s
pre-commit / pre-commit (push) Successful in 5m40s
2026-05-31 19:30:17 +00:00
renovate 7761c0013b fix(deps): update aws-sdk-go-v2 monorepo (#120)
Release / release (push) Successful in 56s
storage / test (push) Successful in 1m32s
storage / vulnerabilities (push) Successful in 1m31s
pre-commit / pre-commit (push) Successful in 5m35s
2026-05-30 19:28:13 +00:00
renovate 8efeca8c41 fix(deps): update aws-sdk-go-v2 monorepo (#118)
Release / release (push) Successful in 1m8s
storage / test (push) Successful in 1m28s
storage / vulnerabilities (push) Successful in 1m41s
pre-commit / pre-commit (push) Successful in 5m30s
2026-05-25 19:00:36 +00:00
renovate 78ed511b18 fix(deps): update aws-sdk-go-v2 monorepo (#116)
storage / test (push) Successful in 1m38s
storage / vulnerabilities (push) Successful in 1m58s
pre-commit / pre-commit (push) Successful in 6m29s
Release / release (push) Successful in 58s
2026-05-09 19:28:36 +00:00
releaser ce2cdbe520 chore(release): prepare for v0.4.1 (#115)
Release / release (push) Successful in 47s
storage / test (push) Successful in 1m36s
storage / vulnerabilities (push) Successful in 1m40s
pre-commit / pre-commit (push) Successful in 6m5s
## [0.4.1] - 2026-05-09

### 🐛 Bug Fixes

- *(deps)* Update aws-sdk-go-v2 monorepo (#102)
- *(deps)* Update aws-sdk-go-v2 monorepo (#103)
- *(deps)* Update aws-sdk-go-v2 monorepo (#104)
- *(deps)* Update aws-sdk-go-v2 monorepo (#105)
- *(deps)* Update module github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager to v0.1.20 (#108)

### 🎨 Styling

- Apply gofumpt formatting to s3.go (#112)

### ⚙️ Miscellaneous Tasks

- *(deps)* Update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.25.0 (#106)
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.12.0 (#110)
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.12.1 (#111)
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.12.2 (#114)

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

---

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

Reviewed-on: #115
Co-authored-by: Unbound Releaser <releaser@unbound.se>
Co-committed-by: Unbound Releaser <releaser@unbound.se>
2026-05-09 14:24:16 +00:00
renovate a7c6ed801a chore(deps): update pre-commit hook golangci/golangci-lint to v2.12.2 (#114)
storage / test (push) Successful in 1m40s
storage / vulnerabilities (push) Successful in 1m39s
Release / release (push) Successful in 52s
pre-commit / pre-commit (push) Successful in 6m20s
2026-05-09 12:44:19 +00:00
renovate 9e4fe1c49b chore(deps): update pre-commit hook golangci/golangci-lint to v2.12.1 (#111)
storage / test (push) Successful in 1m37s
storage / vulnerabilities (push) Successful in 1m40s
Release / release (push) Failing after 49s
pre-commit / pre-commit (push) Successful in 6m19s
2026-05-05 10:23:25 +00:00
argoyle 9805d2d213 style: apply gofumpt formatting to s3.go (#112)
Release / release (push) Successful in 1m0s
storage / test (push) Successful in 1m42s
storage / vulnerabilities (push) Successful in 1m40s
pre-commit / pre-commit (push) Successful in 6m5s
2026-05-05 09:14:18 +00:00
renovate 88c37a2a77 chore(deps): update pre-commit hook golangci/golangci-lint to v2.12.0 (#110)
storage / vulnerabilities (push) Successful in 1m36s
Release / release (push) Failing after 47s
storage / test (push) Successful in 1m55s
pre-commit / pre-commit (push) Successful in 6m34s
2026-05-04 14:27:49 +00:00
renovate 397627b24b fix(deps): update module github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager to v0.1.20 (#108)
Release / release (push) Successful in 53s
storage / test (push) Successful in 1m34s
storage / vulnerabilities (push) Successful in 1m37s
pre-commit / pre-commit (push) Successful in 5m56s
2026-05-03 19:27:46 +00:00
renovate e93c8069eb chore(deps): update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.25.0 (#106)
storage / vulnerabilities (push) Successful in 1m35s
storage / test (push) Successful in 1m52s
Release / release (push) Successful in 1m2s
pre-commit / pre-commit (push) Successful in 6m1s
2026-05-03 16:52:18 +00:00
renovate 81e393de2a fix(deps): update aws-sdk-go-v2 monorepo (#105)
Release / release (push) Failing after 50s
storage / test (push) Successful in 1m41s
storage / vulnerabilities (push) Successful in 1m40s
pre-commit / pre-commit (push) Successful in 6m16s
2026-05-03 06:56:31 +00:00
renovate fbbe21f911 fix(deps): update aws-sdk-go-v2 monorepo (#104)
Release / release (push) Failing after 46s
storage / test (push) Successful in 1m37s
storage / vulnerabilities (push) Successful in 1m40s
pre-commit / pre-commit (push) Successful in 8m8s
2026-04-25 19:28:04 +00:00
renovate fbf1105c24 fix(deps): update aws-sdk-go-v2 monorepo (#103)
Release / release (push) Failing after 53s
storage / test (push) Successful in 1m40s
storage / vulnerabilities (push) Successful in 1m40s
pre-commit / pre-commit (push) Successful in 6m17s
2026-04-20 20:26:40 +00:00
renovate 46450f8f37 fix(deps): update aws-sdk-go-v2 monorepo (#102)
Release / release (push) Failing after 49s
storage / test (push) Successful in 1m35s
storage / vulnerabilities (push) Successful in 1m36s
pre-commit / pre-commit (push) Successful in 5m51s
2026-04-19 19:28:24 +00:00
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
11 changed files with 296 additions and 92 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v7
- uses: actions/setup-go@v6 - uses: actions/setup-go@v6
with: with:
go-version: stable go-version: stable
@@ -20,7 +20,7 @@ jobs:
vulnerabilities: vulnerabilities:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v7
- uses: actions/setup-go@v6 - uses: actions/setup-go@v6
with: with:
go-version: stable go-version: stable
+2 -2
View File
@@ -13,13 +13,13 @@ jobs:
env: env:
SKIP: no-commit-to-branch SKIP: no-commit-to-branch
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v7
- uses: actions/setup-go@v6 - uses: actions/setup-go@v6
with: with:
go-version: stable go-version: stable
- name: Install Go tools - name: Install Go tools
run: go install golang.org/x/tools/cmd/goimports@latest run: go install golang.org/x/tools/cmd/goimports@latest
- uses: actions/setup-python@v5 - uses: actions/setup-python@v6
with: with:
python-version: '3.14' python-version: '3.14'
- uses: pre-commit/action@v3.0.1 - uses: pre-commit/action@v3.0.1
+4 -4
View File
@@ -11,7 +11,7 @@ repos:
- --allow-multiple-documents - --allow-multiple-documents
- id: check-added-large-files - id: check-added-large-files
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook - repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.23.0 rev: v9.25.0
hooks: hooks:
- id: commitlint - id: commitlint
stages: [ commit-msg ] stages: [ commit-msg ]
@@ -23,17 +23,17 @@ repos:
- id: go-imports - id: go-imports
args: args:
- -local - -local
- git.unbound.se/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.8.0 rev: v2.12.2
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
+1 -1
View File
@@ -1,3 +1,3 @@
{ {
"version": "v0.1.0" "version": "v0.4.3"
} }
+131
View File
@@ -2,6 +2,137 @@
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.3] - 2026-06-20
### 🐛 Bug Fixes
- *(deps)* Update aws-sdk-go-v2 monorepo (#138)
- *(deps)* Update aws-sdk-go-v2 monorepo (#140)
- *(deps)* Update aws-sdk-go-v2 monorepo (#142)
### ⚙️ Miscellaneous Tasks
- *(deps)* Update actions/checkout action to v7 (#144)
## [0.4.2] - 2026-06-11
### 🐛 Bug Fixes
- *(deps)* Update aws-sdk-go-v2 monorepo (#116)
- *(deps)* Update aws-sdk-go-v2 monorepo (#118)
- *(deps)* Update aws-sdk-go-v2 monorepo (#120)
- *(deps)* Update aws-sdk-go-v2 monorepo (#122)
- *(deps)* Update aws-sdk-go-v2 monorepo (#124)
- *(deps)* Update module github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager to v0.2.3 (#126)
- *(deps)* Update aws-sdk-go-v2 monorepo (#128)
- *(deps)* Update aws-sdk-go-v2 monorepo (#130)
- *(deps)* Update aws-sdk-go-v2 monorepo (#132)
- *(deps)* Update aws-sdk-go-v2 monorepo to v0.2.7 (#134)
- *(deps)* Update aws-sdk-go-v2 monorepo to v0.2.8 (#136)
## [0.4.1] - 2026-05-09
### 🐛 Bug Fixes
- *(deps)* Update aws-sdk-go-v2 monorepo (#102)
- *(deps)* Update aws-sdk-go-v2 monorepo (#103)
- *(deps)* Update aws-sdk-go-v2 monorepo (#104)
- *(deps)* Update aws-sdk-go-v2 monorepo (#105)
- *(deps)* Update module github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager to v0.1.20 (#108)
### 🎨 Styling
- Apply gofumpt formatting to s3.go (#112)
### ⚙️ Miscellaneous Tasks
- *(deps)* Update pre-commit hook alessandrojcm/commitlint-pre-commit-hook to v9.25.0 (#106)
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.12.0 (#110)
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.12.1 (#111)
- *(deps)* Update pre-commit hook golangci/golangci-lint to v2.12.2 (#114)
## [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 ## [0.1.0] - 2026-01-09
### 🚀 Features ### 🚀 Features
+1 -1
View File
@@ -11,7 +11,7 @@ Provides standardized S3 object storage utilities with presigned URL generation.
## Usage ## Usage
```go ```go
import "git.unbound.se/unboundsoftware/storage" import "gitea.unbound.se/unboundsoftware/storage"
// Option 1: Managed uploads (multipart, 5MB part size) - loads AWS config automatically // Option 1: Managed uploads (multipart, 5MB part size) - loads AWS config automatically
s3Storage, err := storage.New("my-bucket") s3Storage, err := storage.New("my-bucket")
+1 -1
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 "git.unbound.se/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")
+21 -22
View File
@@ -1,29 +1,28 @@
module git.unbound.se/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.42.0
github.com/aws/aws-sdk-go-v2/config v1.32.6 github.com/aws/aws-sdk-go-v2/config v1.32.25
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.20.18 github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.2.11
github.com/aws/aws-sdk-go-v2/service/s3 v1.95.0 github.com/aws/aws-sdk-go-v2/service/s3 v1.104.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.13 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.19.6 // indirect github.com/aws/aws-sdk-go-v2/credentials v1.19.24 // 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.29 // 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.29 // 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.29 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4 // indirect github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.30 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.16 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.12 // 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/checksum v1.9.22 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.7 // indirect github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.29 // 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/s3shared v1.19.29 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.16 // indirect github.com/aws/aws-sdk-go-v2/service/signin v1.2.0 // indirect
github.com/aws/aws-sdk-go-v2/service/signin v1.0.4 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.31.3 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.30.8 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.36.6 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.12 // indirect github.com/aws/aws-sdk-go-v2/service/sts v1.43.3 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.41.5 // indirect github.com/aws/smithy-go v1.27.1 // indirect
github.com/aws/smithy-go v1.24.0 // indirect
) )
+38 -40
View File
@@ -1,40 +1,38 @@
github.com/aws/aws-sdk-go-v2 v1.41.0 h1:tNvqh1s+v0vFYdA1xq0aOJH+Y5cRyZ5upu6roPgPKd4= github.com/aws/aws-sdk-go-v2 v1.42.0 h1:XvXMJTkFQtpBKIWZnmr9ZEOc2InWM2yldjXEJ/bymhA=
github.com/aws/aws-sdk-go-v2 v1.41.0/go.mod h1:MayyLB8y+buD9hZqkCW3kX1AKq07Y5pXxtgB+rRFhz0= github.com/aws/aws-sdk-go-v2 v1.42.0/go.mod h1:27+ACypSLljLAEKsCYOmrjKh83vuTRkuAe9Uv/3A4bg=
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.13 h1:p1BBrg/Hhp6uK7zpejeI8QFXHJeC/mynzi04Sl03k9g=
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.13/go.mod h1:8cIfkE9MDhkRZGpQ22aV6/lkYeYSozpz16Smrs5x4Ls=
github.com/aws/aws-sdk-go-v2/config v1.32.6 h1:hFLBGUKjmLAekvi1evLi5hVvFQtSo3GYwi+Bx4lpJf8= github.com/aws/aws-sdk-go-v2/config v1.32.25 h1:ACCejvStYoilgwrfegSt5ZntCbPrk52qfwyNcnl3omM=
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.25/go.mod h1:LJyU8sDRbXUxFn8xMJIGP+v9QYYwveNLI8a/giAOiAs=
github.com/aws/aws-sdk-go-v2/credentials v1.19.6 h1:F9vWao2TwjV2MyiyVS+duza0NIRtAslgLUM0vTA1ZaE= github.com/aws/aws-sdk-go-v2/credentials v1.19.24 h1:2hQqYCV9yqyePQ9o6dCrZc/zO8U3TwPr9mIKlZnPu/I=
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.24/go.mod h1:IDwpACtwqHLISdzfwUUNq4P9DsB/h5BLg4FwJPNfqFY=
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.29 h1:r6qZHbT+wxgWO/e9vYNUEtg7lv5+UN3pRqKhLXvnArg=
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.29/go.mod h1:QRnaRcTVGKPGRy8w78HMQtKUGRYcnMZAANATkeVA6Mo=
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.2.11 h1:ORrr68X2RQ4OBNI4aYJapjcmbaG5mst0Z7/tjUboZEA=
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.2.11/go.mod h1:W4kVdkT0M/UDMNncotFG2X/HGX69yMdNn7S9WGMhUjk=
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.29 h1:f3vKqSo13fhTYb+JEcXwXefZQE26I1FB5eTSniU67ko=
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.29/go.mod h1:MzoLFUArKGpGD+ukmPiTPG1X5x4o6M2kq4v2dr1FiEc=
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.29 h1:RdwIf/CuUsvJX3RgJagbOyotl/cxoLY4xviKuE7p2GY=
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.29/go.mod h1:71wt8W2EgswdZy9Mf9KNnzxZ3TiZlv4caKghPktDOkA=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4 h1:WKuaxf++XKWlHWu9ECbMlha8WOEGm0OUEZqm4K/Gcfk= github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.30 h1:VTGy885W5DKBxWRUJbym9hytNaYzsyaPkCHGRRMAOhU=
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4/go.mod h1:ZWy7j6v1vWGmPReu0iSGvRiise4YI5SkR3OHKTZ6Wuc= github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.30/go.mod h1:AS0HycUvJRFvTt613AYDOgO2jzw+00cVSMny8XB3yMY=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.16 h1:CjMzUs78RDDv4ROu3JnJn/Ig1r6ZD7/T2DXLLRpejic= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.12 h1:ZD2+BSw9vFsNlKYIasSNt3uDbjqqXIBcM13UJv/Lx2k=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.16/go.mod h1:uVW4OLBqbJXSHJYA9svT9BluSvvwbzLQ2Crf6UPzR3c= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.12/go.mod h1:Ms4zlcVBbXbiP7EVLhl+lgjvA/a7YphqQ3Ih3174EmI=
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/checksum v1.9.22 h1:V51LGlOq/1VsDsHUdoklAQi7rMmx4qQubvFYAlP2254=
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/checksum v1.9.22/go.mod h1:4Pzhyz8hJOm2bepgl+NjvRx8vlUFAIIvJnZ/MkcNPpU=
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/presigned-url v1.13.29 h1:DRebniUGZ2MqiiIVmQJ04vIXr918hubdHMnarSLEWyU=
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/presigned-url v1.13.29/go.mod h1:LfRkPCD8YHDM2E5eTkos2UpwYeZnBcVarTa8L59bJHA=
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/s3shared v1.19.29 h1:hiME6pBzC7OTl9LMtlyTWBuEl1f4QBcUmFDKC7MLXtc=
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/s3shared v1.19.29/go.mod h1:G7RP+uhagpKtKhd1BM9N6JQqjCcGEU47K5lBVZQyRQw=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.16 h1:NSbvS17MlI2lurYgXnCOLvCFX38sBW4eiVER7+kkgsU= github.com/aws/aws-sdk-go-v2/service/s3 v1.104.0 h1:ta8csKy5vN91F3i5gGR85lFV0srBqySEji7Jroes6rE=
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/s3 v1.104.0/go.mod h1:77ZAgynvx1txMvDG8gGWoWkO1augYDxkp9JElWFgjQU=
github.com/aws/aws-sdk-go-v2/service/s3 v1.95.0 h1:MIWra+MSq53CFaXXAywB2qg9YvVZifkk6vEGl/1Qor0= github.com/aws/aws-sdk-go-v2/service/signin v1.2.0 h1:3nXpRcFwRCW8n7HgO2QGy0Dc20eQNfBuUemGQhpF8m8=
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/signin v1.2.0/go.mod h1:LxYujSTLPRlp2vTtcUO/+1ilrew8ytt6SvQyOgejzFQ=
github.com/aws/aws-sdk-go-v2/service/signin v1.0.4 h1:HpI7aMmJ+mm1wkSHIA2t5EaFFv5EFYXePW30p1EIrbQ= github.com/aws/aws-sdk-go-v2/service/sso v1.31.3 h1:ey1XLTYXb9PcLt4535632o5kCGXNXEhNb620Dqwuylo=
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/sso v1.31.3/go.mod h1:Lk7PlmoTYryQmyBG0EXqj5BcUbj3whXdU2s3yGI3EAc=
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/ssooidc v1.36.6 h1:yLr03zQE/5Eu5l3QU0Si+xMbLMbSDF2YXsigqXngs6g=
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/ssooidc v1.36.6/go.mod h1:Q5N6icH+KJZDLh+ESNwzdv6cZ6vLFF/egy3IOxWhmz4=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.12 h1:AHDr0DaHIAo8c9t1emrzAlVDFp+iMMKnPdYy6XO4MCE= github.com/aws/aws-sdk-go-v2/service/sts v1.43.3 h1:VrIhKRCSK1umelSgB9RghvA9RTUYeQffyAS5ApXehNI=
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/sts v1.43.3/go.mod h1:r8wkDOuLaaMFqFiYAb8dGY2A3gJCOujMc6CFOVC4Zhc=
github.com/aws/aws-sdk-go-v2/service/sts v1.41.5 h1:SciGFVNZ4mHdm7gpD1dgZYnCuVdX1s+lFTg4+4DOy70= github.com/aws/smithy-go v1.27.1 h1:4T340VFndXtADGF52gYa1POyL7s9E4Z1OeZ1hCscIw8=
github.com/aws/aws-sdk-go-v2/service/sts v1.41.5/go.mod h1:iW40X4QBmUxdP+fZNOpfmkdMZqsovezbAeO+Ubiv2pk= github.com/aws/smithy-go v1.27.1/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc=
github.com/aws/smithy-go v1.24.0 h1:LpilSUItNPFr1eY85RYgTIg5eIEPtvFbskaFcmmIUnk=
github.com/aws/smithy-go v1.24.0/go.mod h1:LEj2LM3rBRQJxPZTB4KuzZkaZYnZPnvgIhb4pu07mx0=
+56 -9
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,
@@ -53,7 +67,8 @@ func (s *S3) storeWithManager(path string, content io.Reader, contentType string
if err != nil { if err != nil {
return "", err return "", err
} }
presignedUrl, err := s.presigner.PresignGetObject(context.Background(), presignedUrl, err := s.presigner.PresignGetObject(
context.Background(),
&s3.GetObjectInput{ &s3.GetObjectInput{
Bucket: aws.String(s.bucket), Bucket: aws.String(s.bucket),
Key: aws.String(*out.Key), Key: aws.String(*out.Key),
@@ -92,6 +107,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 +146,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 +162,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
}, },
} }