Skip to content

Getting a "NoSuchKey" when using signed URL but theobject exists. #528

Closed Answered by dougtoppin
YasenMakioui asked this question in Q&A
Discussion options

You must be logged in to vote

@YasenMakioui We just tested this without any trouble. The requested image was found and returned.

The python that we used was:

import hashlib
import hmac

my_secret = 'mytestsecret'
path = '/0x1024/filters:format(jpeg)/image.jpg'
secret_encode = my_secret.encode('utf-8')
path_encode = path.encode('utf-8')
signature = hmac.new(secret_encode, path_encode, digestmod=hashlib.sha256).hexdigest()
print(signature)

The request would be similar to this:

https://xxx.cloudfront.net/0x1024/filters:format(jpeg)/image.jpg?signature=<output from python>

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@YasenMakioui
Comment options

Answer selected by YasenMakioui
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants