Signing
Signing module.
Revamp of Microsoft Planetary Computer SAS, using custom URL signing endpoint instead.
ExpiredSignedURL
¶
NotSignedURL
¶
SignURLRoute
¶
SignedURL
¶
Bases: URLBase
Signed URL response.
Source code in teledetection/sdk/signing.py
from_already_signed(signed_href)
classmethod
¶
Create an instance from an already signed URL.
Source code in teledetection/sdk/signing.py
SignedURLBatch
¶
URLBase
¶
is_vrt_string(string)
¶
sign(obj, copy=True)
¶
Sign the relevant URL with a S3 token allowing read access.
All URLs belonging to supported objects are modified in-place, or returned
by the function, depending on copy.
Args:
obj (Any): The object to sign. Must be one of:
str (URL), Asset, Item, ItemCollection, or ItemSearch, or a
mapping.
copy (bool): Whether to sign the object in place, or make a copy.
Has no effect for immutable objects like strings.
Returns:
| Name | Type | Description |
|---|---|---|
Any |
Any
|
A copy of the object where all relevant URLs have been signed |
Source code in teledetection/sdk/signing.py
sign_asset(asset, copy=True)
¶
Sign a PySTAC asset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
asset
|
Asset
|
The Asset to sign |
required |
copy
|
bool
|
Whether to copy (clone) the asset or mutate it inplace. |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
Asset |
Asset
|
An asset where the HREF is replaced with a |
Asset
|
signed version. |
Source code in teledetection/sdk/signing.py
sign_collection(collection, copy=True)
¶
Sign a collection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
collection
|
Collection
|
STAC Collection |
required |
copy
|
bool
|
copy or not the input |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
signed |
Collection
|
the STAC collection, now with signed URLs. |
Source code in teledetection/sdk/signing.py
sign_inplace(obj)
¶
sign_item(item, copy=True)
¶
Sign all assets within a PySTAC item.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item
|
Item
|
The Item whose assets that will be signed |
required |
copy
|
bool
|
Whether to copy (clone) the item or mutate it inplace. |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
Item |
Item
|
An Item where all assets' HREFs have |
Item
|
been replaced with a signed version. In addition, an "expiry" |
|
Item
|
property is added to the Item properties indicating the earliest |
|
Item
|
expiry time for any assets that were signed. |
Source code in teledetection/sdk/signing.py
sign_item_collection(item_collection, copy=True)
¶
Sign a PySTAC item collection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item_collection
|
ItemCollection
|
The ItemCollection whose assets will be signed |
required |
copy
|
bool
|
Whether to copy (clone) the ItemCollection or mutate it inplace. |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
ItemCollection |
ItemCollection
|
An ItemCollection where all assets' |
ItemCollection
|
HREFs for each item have been replaced with a signed version. In |
|
ItemCollection
|
addition, an "expiry" property is added to the Item properties |
|
ItemCollection
|
indicating the earliest expiry time for any assets that were signed. |
Source code in teledetection/sdk/signing.py
sign_mapping(mapping, copy=True)
¶
Sign a mapping.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mapping
|
Mapping
|
|
required |
copy
|
bool
|
Whether to copy (clone) the mapping or mutate it inplace. |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
signed |
Mapping
|
The dictionary, now with signed URLs. |
Source code in teledetection/sdk/signing.py
sign_string(url, copy=True)
¶
Sign a URL or VRT-like string containing URLs with a S3 Token.
Signing with a S3 token allows read access to files in blob storage.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
The HREF of the asset as a URL or a GDAL VRT Single URLs can be found on a STAC Item's Asset GDAL VRTs can combine many data sources into a single mosaic. A VRT can be built quickly from the GDAL STACIT driver https://gdal.org/drivers/raster/stacit.html. Each URL to S3 Storage within the VRT is signed. |
required |
copy
|
bool
|
No effect. |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The signed HREF or VRT |
Source code in teledetection/sdk/signing.py
sign_url_put(url)
¶
sign_urls(urls)
¶
sign_urls_put(urls)
¶
sign_vrt_string(vrt, copy=True)
¶
Sign a VRT-like string containing URLs from the storage.
Signing URLs allows read access to files in storage.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vrt
|
str
|
The GDAL VRT GDAL VRTs can combine many data sources into a single mosaic. A VRT can be built quickly from the GDAL STACIT driver https://gdal.org/drivers/raster/stacit.html. Each URL to S3 Storage within the VRT is signed. |
required |
copy
|
bool
|
No effect. |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The signed VRT |