2개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
1
Thank you for the details. The cache policy referenced in the first image isn't relevant when it comes to constructing CloudFront signed URLs. Please refer to this document for an example of a custom policy that demonstrates how to control access to a specific file or from an individual IP address, among other things.
As a side note, here are some code examples, though they are not in Python.
답변함 일 년 전
0
A Python example can be found here.
https://github.com/boto/boto3/blob/develop/boto3/examples/cloudfront.rst
I am already able to generate the signed url, but it's not working with custom policy
관련 콘텐츠
- AWS 공식업데이트됨 2년 전
Hey I have update the code based on your input. But still getting the same error. The document says to change some characters, but I am not sure why. DO you have any exampel
Thanks for providing additional codes. Looking at https://github.com/boto/botocore/blob/develop/botocore/signers.py#L402-L403 it seems that
.encode("utf-8")
will not be necessary and worthwhile a try? otherwise we could also trybuild_policy()
mentioned in the library.The same issue persists only when using Wildcard in the Resource URL, if an exact URL is provided, then the issue is resolved. Any idea how to use Wildcards in the Resource URL and not get Malformed Policy response?