How to avoid using S3 Object keys in generated temporary URLs?

0

Hello there. I have private access to my S3 objects and I'm using s3.getSignedUrl('getObject', options) method from SDK in my Node.js app. It's good solution for me except for the one thing: as I have multiple user roles in my application, I want to hide file names (object Key) for some of them. For this I am considering the option with Gateways API to use it as proxy for my temporary generated URLs. Please, let me know if I'm on the right way. It'll be good to initially generate link with another name using getSignedUrl('getObject'), but I'm not sure that this is possible.

Example of my current code,:

const fileTempUrl = s3.getSignedUrl('getObject', { Bucket: bucketName, Key: objectKey, Expires: ONE_DAY });

Thanks.

1 Risposta
1
profile picture
ESPERTO
con risposta un anno fa
  • Yes, but this implementation won't help me with main problem described in the question. URL will still contain Object Key

  • I see. then either a proxy as you suggested, or a lambda that copies the files in another folder with a hashed value for the key could be the left possibilities

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande