-
Notifications
You must be signed in to change notification settings - Fork 6.5k
cdn: add sign_cookie example with tests #3281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@elithrar FYI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this a sample for a closed alpha, why are we putting it in a public github repo?
Additionally, if you team owns these samples, please add yourself in the CODEOWNERs file.
@kurtisvg This will go GA shortly (within a week) and we are attempting to sync this up with the need to be in the public docs for launch day. Is there a better process to handle cases like this? We are not concerned about folks seeing this PR ahead of being merged. |
@elithrar Most folks use GOB to stage samples when not publicly available, but if you aren't concerned about public knowledge this is fine. We won't be able to merge it into master until the feature is publicly available, but you can ping me when that happens and I'll take care of it. |
PTAL again:
Thanks! |
In case you don't have access to the build logs. Here is the lint output:
It seems like |
expiration_timestamp = int((expiration_time - epoch).total_seconds()) | ||
decoded_key = base64.urlsafe_b64decode(base64_key) | ||
|
||
policy_pattern = u'URLPrefix={encoded_url_prefix}:Expires={expires}:KeyName={key_name}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JFYI, from python 3.6, you can use f-string
Then it will be
policy = (
f'URLPrefix={encoded_url_prefix}:Expires={expiration_timestamp}:'
f'KeyName={key_name}'
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL--thanks!
This PR expands the existing snippet for Cloud CDN Signed URLs to also illustrate Signed Cookies, a feature currently in closed alpha. This feature extends Cloud CDN's Signed URL functionality.