diff --git a/docs/tutorials/python/tutorial_scripts/proxy_storage_location.py b/docs/tutorials/python/tutorial_scripts/proxy_storage_location.py index bcb85b23c..f08343641 100644 --- a/docs/tutorials/python/tutorial_scripts/proxy_storage_location.py +++ b/docs/tutorials/python/tutorial_scripts/proxy_storage_location.py @@ -21,13 +21,14 @@ # --8<-- [end:setup] # --8<-- [start:create_proxy_storage_location] -# Replace with your proxy server URL and shared secret key +# Replace with your proxy server URL and provide the shared secret key via the +# MY_PROXY_SECRET_KEY environment variable. MY_PROXY_URL = "https://my-proxy-server.example.com" +MY_PROXY_SECRET_KEY = os.environ.get("MY_PROXY_SECRET_KEY") # Replace with the path to a local file to register via the proxy FILE_PATH = "/path/to/your/file.csv" -# --8<-- [start:create_proxy_storage_location] # Use this when a proxy server controls access to the underlying storage. my_proxy_folder = Folder(name="my-folder-for-proxy", parent_id=my_project.id) my_proxy_folder = my_proxy_folder.store() diff --git a/docs/tutorials/python/tutorial_scripts/storage_location.py b/docs/tutorials/python/tutorial_scripts/storage_location.py index a32acbfa0..cb231fc62 100644 --- a/docs/tutorials/python/tutorial_scripts/storage_location.py +++ b/docs/tutorials/python/tutorial_scripts/storage_location.py @@ -3,6 +3,8 @@ """ # --8<-- [start:setup] +import os + import synapseclient from synapseclient.models import Folder, Project, StorageLocation, StorageLocationType @@ -138,11 +140,14 @@ # Use this when a proxy server controls access to the underlying storage. # --8<-- [start:create_proxy_storage_location] +# Replace with your proxy server URL and provide the shared secret key via the +# MY_PROXY_SECRET_KEY environment variable. MY_PROXY_URL = "https://my-proxy-server.example.com" +MY_PROXY_SECRET_KEY = os.environ.get("MY_PROXY_SECRET_KEY") proxy_storage = StorageLocation( storage_type=StorageLocationType.PROXY, proxy_url=MY_PROXY_URL, - secret_key=my_proxy_secret_key, + secret_key=MY_PROXY_SECRET_KEY, benefactor_id=my_project.id, description="Proxy-controlled storage", ).store()