Skip to content

Commit ab92796

Browse files
Fix sync for files with authenticated access mode
1 parent 5957d1a commit ab92796

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cloudinary_cli/utils/api_utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def query_cld_folder(folder):
3939
"format": asset['format'],
4040
"etag": asset.get('etag', '0'),
4141
"relative_path": rel_path, # save for inner use
42+
"access_mode": asset.get('access_mode', 'public'),
4243
}
4344
# use := when switch to python 3.8
4445
next_cursor = res.get('next_cursor')
@@ -72,7 +73,10 @@ def download_file(remote_file, local_path, downloaded=None, failed=None):
7273
failed = failed if failed is not None else {}
7374
makedirs(path.dirname(local_path), exist_ok=True)
7475

75-
sign_url = True if remote_file['type'] in ("private", "authenticated") else False
76+
if remote_file['type'] in ("private", "authenticated") or remote_file['access_mode'] == "authenticated":
77+
sign_url = True
78+
else:
79+
sign_url = False
7680

7781
download_url = cloudinary_url(asset_source(remote_file), resource_type=remote_file['resource_type'],
7882
type=remote_file['type'], sign_url=sign_url)[0]

0 commit comments

Comments
 (0)