Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@
# --8<-- [end:setup]

# --8<-- [start:create_proxy_storage_location]
Comment thread
rxu17 marked this conversation as resolved.
# 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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"""

# --8<-- [start:setup]
import os

import synapseclient
from synapseclient.models import Folder, Project, StorageLocation, StorageLocationType

Expand Down Expand Up @@ -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,
Comment thread
rxu17 marked this conversation as resolved.
benefactor_id=my_project.id,
description="Proxy-controlled storage",
).store()
Expand Down
Loading