Skip to content

Expiration time in URL attachments #10028

@NilHomedes

Description

@NilHomedes

Describe the bug
When you copy the URL of an attachment and share it with other people, the link is broken because the token generated expires.

To Reproduce
Steps to reproduce the behavior:

  1. Upload a PDF file in a participatory space or component
  2. From the frontend, click on the attachment to open the file in the browser
  3. Copy the URL from your address bar and share it with someone
  4. Wait 10 minutes
  5. Try to access again to the same URL
  6. See the error

For instance, try this link of an attachment from MetaDecidim:
https://ajbcn-meta-decidim.s3.eu-west-1.amazonaws.com/3wxq9s5urbsikbj3g8hicagl90wb?response-content-disposition=inline%3B%20filename%3D%22Programa_DecidimFEST22_300ppp.pdf%22%3B%20filename*%3DUTF-8%27%27Programa_DecidimFEST22_300ppp.pdf&response-content-type=application%2Fpdf&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIARXFVQ5FRJEUZE7HY%2F20221103%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Date=20221103T090332Z&X-Amz-Expires=300&X-Amz-SignedHeaders=host&X-Amz-Signature=727e4598b330b4138dd89be7a1639a89fce7683397e1a9c6cdea47008a9cc797

Or this link from TryDecidim:
https://try.decidim.org/rails/active_storage/disk/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDRG9JYTJWNVNTSWhibTlvYjNBeGJuSTNibm93YW10amJIaG9PWFJzWm1ZMk5XTnJZd1k2QmtWVU9oQmthWE53YjNOcGRHbHZia2tpVVdsdWJHbHVaVHNnWm1sc1pXNWhiV1U5SWtWNFlXMXdiR1ZrYjJOMWJXVnVkQzV3WkdZaU95Qm1hV3hsYm1GdFpTbzlWVlJHTFRnbkowVjRZVzF3YkdWa2IyTjFiV1Z1ZEM1d1pHWUdPd1pVT2hGamIyNTBaVzUwWDNSNWNHVkpJaFJoY0hCc2FXTmhkR2x2Ymk5d1pHWUdPd1pVIiwiZXhwIjoiMjAyMi0xMS0wM1QwOToyMDozNS45ODRaIiwicHVyIjoiYmxvYl9rZXkifX0=--becb950ef99a28a7f748f06a762ae231118408b8/Exampledocument.pdf?content_type=application%2Fpdf&disposition=inline%3B+filename%3D%22Exampledocument.pdf%22%3B+filename%2A%3DUTF-8%27%27Exampledocument.pdf

Expected behavior
I expect to have a permanent URL without any expiration time.

Screenshots
Captura de pantalla de 2022-11-03 16-33-02

Stacktrace
<Error> <Code>AccessDenied</Code> <Message>Request has expired</Message> <X-Amz-Expires>300</X-Amz-Expires> <Expires>2022-11-03T09:08:32Z</Expires> <ServerTime>2022-11-03T15:29:54Z</ServerTime> <RequestId>BSRQRVRABRNH1YMY</RequestId> <HostId>oTK/txk/mpRii/KCeVaoxpixonf4e4MkblZpU9H7jKfhUzbC2Uq56jAlBefFIHhbSVOKpLkMRXw=</HostId> </Error>

Extra data (please complete the following information):

  • Device: [e.g. Desktop]
  • Device OS: Ubuntu 22.04
  • Browser: Firefox and Chromium
  • Decidim Version: 0.27 and 0.26.3
  • Decidim installation: Metadecidim and TryDecidim

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions