ds_stoa.sign

This module facilitates the generation of pre-signed URLs for secure data retrieval from the GraspDP datalake.

By leveraging the sign function, users can obtain URLs that grant temporary access to specific files stored within the datalake. This is particularly useful for scenarios where direct access to the data is necessary without compromising security or requiring permanent credentials.

The sign function requires an authentication token and parameters specifying the data to be accessed. It communicates with the Stoa service to generate a URL that is pre-signed with the necessary permissions.

Example Usage:

from ds_stoa.sign import sign

# Authentication token and parameters for the request
token = "your_auth_token"
params = {"key": "12345"}

# Generate a pre-signed URL
pre_signed_url = sign(token=token, params=params)
print(pre_signed_url)

Submodules

Functions

sign(→ str)

Generate a pre-signed URL for accessing data in the

Package Contents

ds_stoa.sign.sign(token: str, params: Dict) str

Generate a pre-signed URL for accessing data in the GraspDP datalake.

Parameters:
  • token – Authentication token required for generating the pre-signed URL.

  • params – Parameters for the request, typically including identifiers for the data to be accessed.

Returns:

A string containing the pre-signed URL.

Raises:

ValueError – If the pre-signed URL is not found.

Example::
>>> sign(token=token, params=params)
"https://fmdp.io/stoa-dev/sign/12345"