mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-09 08:03:50 +00:00
feat: configurable expiry for presigned s3 public url signatures (#10835)
* feat: configurable expiry for presigned s3 public url signatures Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015JdZFeMXLGfeFNiQgx9QvA * fix: describe expiry_secs clamping in the spec and pin the bounds in a test Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015JdZFeMXLGfeFNiQgx9QvA * fix: omit null expiry_secs from the python sdk sign request Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015JdZFeMXLGfeFNiQgx9QvA --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
9fa8159ad1
commit
8a6dc27236
Generated
+36
-16
@@ -848,31 +848,35 @@ async deleteS3File(s3object: S3Object, workspace: string | undefined = undefined
|
||||
/**
|
||||
* Sign S3 objects to be used by anonymous users in public apps
|
||||
* @param s3objects s3 objects to sign
|
||||
* @param expirySecs how long the signature stays valid, in seconds (default 43200 = 12h, clamped to [60, 604800])
|
||||
* @returns signed s3 objects
|
||||
*/
|
||||
async signS3Objects(s3objects: S3Object[]): Promise<S3Object[]>
|
||||
async signS3Objects(s3objects: S3Object[], { expirySecs }: { expirySecs?: number } = {}): Promise<S3Object[]>
|
||||
|
||||
/**
|
||||
* Sign S3 object to be used by anonymous users in public apps
|
||||
* @param s3object s3 object to sign
|
||||
* @param expirySecs how long the signature stays valid, in seconds (default 43200 = 12h, clamped to [60, 604800])
|
||||
* @returns signed s3 object
|
||||
*/
|
||||
async signS3Object(s3object: S3Object): Promise<S3Object>
|
||||
async signS3Object(s3object: S3Object, { expirySecs }: { expirySecs?: number } = {}): Promise<S3Object>
|
||||
|
||||
/**
|
||||
* Generate a presigned public URL for an array of S3 objects.
|
||||
* If an S3 object is not signed yet, it will be signed first.
|
||||
* @param s3Objects s3 objects to sign
|
||||
* @param expirySecs how long the signature stays valid, in seconds (default 43200 = 12h, clamped to [60, 604800])
|
||||
* @returns list of signed public URLs
|
||||
*/
|
||||
async getPresignedS3PublicUrls(s3Objects: S3Object[], { baseUrl }: { baseUrl?: string } = {}): Promise<string[]>
|
||||
async getPresignedS3PublicUrls(s3Objects: S3Object[], { baseUrl, expirySecs }: { baseUrl?: string; expirySecs?: number } = {}): Promise<string[]>
|
||||
|
||||
/**
|
||||
* Generate a presigned public URL for an S3 object. If the S3 object is not signed yet, it will be signed first.
|
||||
* @param s3Object s3 object to sign
|
||||
* @param expirySecs how long the signature stays valid, in seconds (default 43200 = 12h, clamped to [60, 604800])
|
||||
* @returns signed public URL
|
||||
*/
|
||||
async getPresignedS3PublicUrl(s3Objects: S3Object, { baseUrl }: { baseUrl?: string } = {}): Promise<string>
|
||||
async getPresignedS3PublicUrl(s3Objects: S3Object, { baseUrl, expirySecs }: { baseUrl?: string; expirySecs?: number } = {}): Promise<string>
|
||||
|
||||
/**
|
||||
* Get URLs needed for resuming a flow after this step
|
||||
@@ -1631,31 +1635,35 @@ async deleteS3File(s3object: S3Object, workspace: string | undefined = undefined
|
||||
/**
|
||||
* Sign S3 objects to be used by anonymous users in public apps
|
||||
* @param s3objects s3 objects to sign
|
||||
* @param expirySecs how long the signature stays valid, in seconds (default 43200 = 12h, clamped to [60, 604800])
|
||||
* @returns signed s3 objects
|
||||
*/
|
||||
async signS3Objects(s3objects: S3Object[]): Promise<S3Object[]>
|
||||
async signS3Objects(s3objects: S3Object[], { expirySecs }: { expirySecs?: number } = {}): Promise<S3Object[]>
|
||||
|
||||
/**
|
||||
* Sign S3 object to be used by anonymous users in public apps
|
||||
* @param s3object s3 object to sign
|
||||
* @param expirySecs how long the signature stays valid, in seconds (default 43200 = 12h, clamped to [60, 604800])
|
||||
* @returns signed s3 object
|
||||
*/
|
||||
async signS3Object(s3object: S3Object): Promise<S3Object>
|
||||
async signS3Object(s3object: S3Object, { expirySecs }: { expirySecs?: number } = {}): Promise<S3Object>
|
||||
|
||||
/**
|
||||
* Generate a presigned public URL for an array of S3 objects.
|
||||
* If an S3 object is not signed yet, it will be signed first.
|
||||
* @param s3Objects s3 objects to sign
|
||||
* @param expirySecs how long the signature stays valid, in seconds (default 43200 = 12h, clamped to [60, 604800])
|
||||
* @returns list of signed public URLs
|
||||
*/
|
||||
async getPresignedS3PublicUrls(s3Objects: S3Object[], { baseUrl }: { baseUrl?: string } = {}): Promise<string[]>
|
||||
async getPresignedS3PublicUrls(s3Objects: S3Object[], { baseUrl, expirySecs }: { baseUrl?: string; expirySecs?: number } = {}): Promise<string[]>
|
||||
|
||||
/**
|
||||
* Generate a presigned public URL for an S3 object. If the S3 object is not signed yet, it will be signed first.
|
||||
* @param s3Object s3 object to sign
|
||||
* @param expirySecs how long the signature stays valid, in seconds (default 43200 = 12h, clamped to [60, 604800])
|
||||
* @returns signed public URL
|
||||
*/
|
||||
async getPresignedS3PublicUrl(s3Objects: S3Object, { baseUrl }: { baseUrl?: string } = {}): Promise<string>
|
||||
async getPresignedS3PublicUrl(s3Objects: S3Object, { baseUrl, expirySecs }: { baseUrl?: string; expirySecs?: number } = {}): Promise<string>
|
||||
|
||||
/**
|
||||
* Get URLs needed for resuming a flow after this step
|
||||
@@ -2508,31 +2516,35 @@ async deleteS3File(s3object: S3Object, workspace: string | undefined = undefined
|
||||
/**
|
||||
* Sign S3 objects to be used by anonymous users in public apps
|
||||
* @param s3objects s3 objects to sign
|
||||
* @param expirySecs how long the signature stays valid, in seconds (default 43200 = 12h, clamped to [60, 604800])
|
||||
* @returns signed s3 objects
|
||||
*/
|
||||
async signS3Objects(s3objects: S3Object[]): Promise<S3Object[]>
|
||||
async signS3Objects(s3objects: S3Object[], { expirySecs }: { expirySecs?: number } = {}): Promise<S3Object[]>
|
||||
|
||||
/**
|
||||
* Sign S3 object to be used by anonymous users in public apps
|
||||
* @param s3object s3 object to sign
|
||||
* @param expirySecs how long the signature stays valid, in seconds (default 43200 = 12h, clamped to [60, 604800])
|
||||
* @returns signed s3 object
|
||||
*/
|
||||
async signS3Object(s3object: S3Object): Promise<S3Object>
|
||||
async signS3Object(s3object: S3Object, { expirySecs }: { expirySecs?: number } = {}): Promise<S3Object>
|
||||
|
||||
/**
|
||||
* Generate a presigned public URL for an array of S3 objects.
|
||||
* If an S3 object is not signed yet, it will be signed first.
|
||||
* @param s3Objects s3 objects to sign
|
||||
* @param expirySecs how long the signature stays valid, in seconds (default 43200 = 12h, clamped to [60, 604800])
|
||||
* @returns list of signed public URLs
|
||||
*/
|
||||
async getPresignedS3PublicUrls(s3Objects: S3Object[], { baseUrl }: { baseUrl?: string } = {}): Promise<string[]>
|
||||
async getPresignedS3PublicUrls(s3Objects: S3Object[], { baseUrl, expirySecs }: { baseUrl?: string; expirySecs?: number } = {}): Promise<string[]>
|
||||
|
||||
/**
|
||||
* Generate a presigned public URL for an S3 object. If the S3 object is not signed yet, it will be signed first.
|
||||
* @param s3Object s3 object to sign
|
||||
* @param expirySecs how long the signature stays valid, in seconds (default 43200 = 12h, clamped to [60, 604800])
|
||||
* @returns signed public URL
|
||||
*/
|
||||
async getPresignedS3PublicUrl(s3Objects: S3Object, { baseUrl }: { baseUrl?: string } = {}): Promise<string>
|
||||
async getPresignedS3PublicUrl(s3Objects: S3Object, { baseUrl, expirySecs }: { baseUrl?: string; expirySecs?: number } = {}): Promise<string>
|
||||
|
||||
/**
|
||||
* Get URLs needed for resuming a flow after this step
|
||||
@@ -4225,19 +4237,23 @@ def delete_s3_object(s3object: S3Object | str, s3_resource_path: str | None = No
|
||||
#
|
||||
# Args:
|
||||
# s3_objects: List of S3 objects to sign
|
||||
# expiry_secs: How long the signature stays valid, in seconds
|
||||
# (defaults to 43200 = 12h, clamped to [60, 604800])
|
||||
#
|
||||
# Returns:
|
||||
# List of signed S3 objects
|
||||
def sign_s3_objects(s3_objects: list[S3Object | str]) -> list[S3Object]
|
||||
def sign_s3_objects(s3_objects: list[S3Object | str], expiry_secs: int | None = None) -> list[S3Object]
|
||||
|
||||
# Sign a single S3 object for use by anonymous users in public apps.
|
||||
#
|
||||
# Args:
|
||||
# s3_object: S3 object to sign
|
||||
# expiry_secs: How long the signature stays valid, in seconds
|
||||
# (defaults to 43200 = 12h, clamped to [60, 604800])
|
||||
#
|
||||
# Returns:
|
||||
# Signed S3 object
|
||||
def sign_s3_object(s3_object: S3Object | str) -> S3Object
|
||||
def sign_s3_object(s3_object: S3Object | str, expiry_secs: int | None = None) -> S3Object
|
||||
|
||||
# Generate presigned public URLs for an array of S3 objects.
|
||||
# If an S3 object is not signed yet, it will be signed first.
|
||||
@@ -4245,6 +4261,8 @@ def sign_s3_object(s3_object: S3Object | str) -> S3Object
|
||||
# Args:
|
||||
# s3_objects: List of S3 objects to sign
|
||||
# base_url: Optional base URL for the presigned URLs (defaults to WM_BASE_URL)
|
||||
# expiry_secs: How long the signatures stay valid, in seconds
|
||||
# (defaults to 43200 = 12h, clamped to [60, 604800])
|
||||
#
|
||||
# Returns:
|
||||
# List of signed public URLs
|
||||
@@ -4252,7 +4270,7 @@ def sign_s3_object(s3_object: S3Object | str) -> S3Object
|
||||
# Example:
|
||||
# >>> s3_objs = [S3Object(s3="/path/to/file1.txt"), S3Object(s3="/path/to/file2.txt")]
|
||||
# >>> urls = client.get_presigned_s3_public_urls(s3_objs)
|
||||
def get_presigned_s3_public_urls(s3_objects: list[S3Object | str], base_url: str | None = None) -> list[str]
|
||||
def get_presigned_s3_public_urls(s3_objects: list[S3Object | str], base_url: str | None = None, expiry_secs: int | None = None) -> list[str]
|
||||
|
||||
# Generate a presigned public URL for an S3 object.
|
||||
# If the S3 object is not signed yet, it will be signed first.
|
||||
@@ -4260,6 +4278,8 @@ def get_presigned_s3_public_urls(s3_objects: list[S3Object | str], base_url: str
|
||||
# Args:
|
||||
# s3_object: S3 object to sign
|
||||
# base_url: Optional base URL for the presigned URL (defaults to WM_BASE_URL)
|
||||
# expiry_secs: How long the signature stays valid, in seconds
|
||||
# (defaults to 43200 = 12h, clamped to [60, 604800])
|
||||
#
|
||||
# Returns:
|
||||
# Signed public URL
|
||||
@@ -4267,7 +4287,7 @@ def get_presigned_s3_public_urls(s3_objects: list[S3Object | str], base_url: str
|
||||
# Example:
|
||||
# >>> s3_obj = S3Object(s3="/path/to/file.txt")
|
||||
# >>> url = client.get_presigned_s3_public_url(s3_obj)
|
||||
def get_presigned_s3_public_url(s3_object: S3Object | str, base_url: str | None = None) -> str
|
||||
def get_presigned_s3_public_url(s3_object: S3Object | str, base_url: str | None = None, expiry_secs: int | None = None) -> str
|
||||
|
||||
# Get the current user information.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user