My backend is a nodejs application and I want users to upload images to an Amazon S3 bucket.
From my server I am running:
const s3 = new AWS.S3({
params: {
Bucket: bucket
}
});
app.get('/api/images/signed-url', authMiddleware, (req, res) => {
s3.getSignedUrl('putObject',
{ ContentType: 'image/jpeg', Key: uuid() + '.jpeg' },
(_err, url) => res.send({ signedUrl })
})
Then from my browser client I upload to that endpoint
The URL looks like:
https://my-s3-bucket.s3.ap-southeast-2.amazonaws.com/0050db00-c64c-419a-83c2-e8615120f458.jpeg?AWSAccessKeyId=MY_ACCESS_KEY&Content-Type=image%2Fjpeg&Expires=1625365030&Signature=1ebnshTgeMKoLMAH%2Bi2FLletsAU%3D
Given this URL contains my MY_ACCESS_KEY_ID
, is it safe to share with the client? I don't share my secret (obviously), but it is half of the equation.