How do you let a user download a private ticket without making the S3 bucket public?
After this you can answer: How do you let a user download a private ticket without making the S3 bucket public?
Say it in 30 seconds
Section titled “Say it in 30 seconds”The deeper answer
Section titled “The deeper answer”The ticket service reads bookings and that user’s DynamoDB partition. Before signing, it checks the owner, event, seat bounds, stable ticket ID, duplicate seat numbers and expected tickets path. It returns only ready tickets, not raw stored tokens or arbitrary caller-supplied object keys.
The presigner uses the API task’s AWS credentials. A signed URL grants the operation its signature allows, subject to current service authorization. Its configured expiry is an upper bound, not a promise that revoked permission or expired signing credentials cannot shorten its usable life.
For downloads, the signature includes an attachment response disposition so the browser can download across origins. URLs are generated at read time, not persisted in Postgres or shared event caches. Production handling should keep complete signed URLs out of logs and analytics, because the query string is itself a temporary credential.
Counter-questions
Section titled “Counter-questions”Can someone replace the key in the URL?
What if the user opens the link later?
Would a proxy download be safer?
Where in MiniTickets
Section titled “Where in MiniTickets”Read S3 presigned urls, then inspect the ticket-assets-bucket piece →.
apps/api/src/services/tickets.ts → mine
Read the presigned-URL 403 case.
Read this book online: https://book.theversehub.in/