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 Respuesta
1
profile picture
EXPERTO
respondido hace un año
  • 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

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas