Python and Django SDK for Cloudinary, a cloud-based image and video management service with comprehensive transformation, optimization, and delivery capabilities
Overall
score
94%
Build a service that generates secure, time-limited search URLs for querying cloud-based assets. The service should create signed URLs that can be used by client applications to search for assets without exposing API credentials.
Your service should provide functionality to:
@generates
def generate_search_url(query: str, ttl: int = 300) -> str:
"""
Generate a signed search URL for querying assets.
Args:
query: The search expression (e.g., "resource_type:image AND tags:sunset")
ttl: Time-to-live in seconds (default: 300)
Returns:
A signed URL string that can be used to execute the search
"""
pass
def generate_short_lived_url(query: str) -> str:
"""
Generate a signed search URL with a 60-second expiration.
Args:
query: The search expression
Returns:
A signed URL string with 60-second TTL
"""
pass
def generate_long_lived_url(query: str) -> str:
"""
Generate a signed search URL with a 1-hour expiration.
Args:
query: The search expression
Returns:
A signed URL string with 3600-second TTL
"""
passgenerate_search_url("resource_type:image") returns a valid URL string @testgenerate_search_url("tags:landscape", ttl=600) generates a URL with 10-minute expiration @testgenerate_search_url("format:jpg", ttl=120) generates a URL with 2-minute expiration @testgenerate_short_lived_url("resource_type:video") generates a URL that expires in 60 seconds @testgenerate_long_lived_url("uploaded_at>2024-01-01") generates a URL that expires in 1 hour @testProvides cloud-based asset management and secure URL generation capabilities.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/pypi-cloudinarydocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10