Add signed URL generation for task PDF access #233
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Task PDFs are stored in file storage without authentication. Clients need temporary access without direct storage credentials or proxying through the backend.
Implementation
Signed URL utility (
package/utils/signed_url.go)expiresandsignaturequery parametersGenerateSignedURLWithTTL()accepts custom TTL, reuses generator instanceConfiguration (
internal/config/config.go)SIGNED_URL_TTL_SECONDS: Default 300s (5 minutes)SIGNED_URL_SECRET_KEY: Falls back to JWT secretFileStorageService (
package/filestorage/service.go)TaskService (
package/service/task_service.go)Get()now returns signed URL inTaskDetailed.DescriptionURLAPI Response
{ "id": 123, "title": "Example Task", "descriptionUrl": "https://storage/task/123/description.pdf?expires=1706180400&signature=abc...", ... }URLs expire after TTL, backend remains sole authorization point, storage credentials never exposed.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
invalid-host/tmp/go-build924877516/b824/queue.test /tmp/go-build924877516/b824/queue.test -test.testlogfile=/tmp/go-build924877516/b824/testlog.txt -test.paniconexit0 -test.timeout=10m0s /tmp/go-build924877516/b709/vet.cfg om/mattn/go-sqli-errorsas go_.o 64/bin/as -p om/mattn/go-sqli-atomic -lang=go1.22 1249549/b497/imp-buildtags ce t�� om/mattn/go-sqli-errorsas oFiles,IgnoredOt-ifaceassert x_amd64/compile pkg/mod/github.c/opt/hostedtoolcache/go/1.24.2/x64/pkg/tool/linux_amd64/vet om/mattn/go-sqli-atomic -lang=go1.23 x_amd64/compile(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.