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 Answer
1
  • 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

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions