Skip to content

Commit 701eaf5

Browse files
Media CDN - Minor updates (#9166)
- Update copyright year - Add region tag for `sign_url_prefix`
1 parent 827578f commit 701eaf5

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

media_cdn/dualtoken.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22
#
3-
# Copyright 2022 Google, Inc.
3+
# Copyright 2023 Google, Inc.
44
#
55
# Licensed under the Apache License, Version 2.0 (the 'License');
66
# you may not use this file except in compliance with the License.

media_cdn/snippets.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22
#
3-
# Copyright 2022 Google, Inc.
3+
# Copyright 2023 Google, Inc.
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@
2323

2424
# [START mediacdn_sign_url]
2525
# [START mediacdn_sign_cookie]
26+
# [START mediacdn_sign_url_prefix]
2627
import base64
2728
import datetime
2829

@@ -33,6 +34,7 @@
3334

3435
# [END mediacdn_sign_cookie]
3536
# [END mediacdn_sign_url]
37+
# [END mediacdn_sign_url_prefix]
3638

3739

3840
# [START mediacdn_sign_url]
@@ -72,9 +74,11 @@ def sign_url(url: str, key_name: str, base64_key: str, expiration_time: datetime
7274
url=url_to_sign, signature=signature)
7375

7476
return signed_url
77+
# [END mediacdn_sign_url]
7578

7679

77-
def sign_url_prefix(url: str, url_prefix, key_name: str, base64_key: str, expiration_time: datetime.datetime) -> str:
80+
# [START mediacdn_sign_url_prefix]
81+
def sign_url_prefix(url: str, url_prefix: str, key_name: str, base64_key: str, expiration_time: datetime.datetime) -> str:
7882
"""Gets the Signed URL string for the specified URL prefix and configuration.
7983
8084
Args:
@@ -113,7 +117,7 @@ def sign_url_prefix(url: str, url_prefix, key_name: str, base64_key: str, expira
113117
policy=policy,
114118
signature=signature)
115119
return signed_url
116-
# [END mediacdn_sign_url]
120+
# [END mediacdn_sign_url_prefix]
117121

118122

119123
# [START mediacdn_sign_cookie]

0 commit comments

Comments
 (0)