or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/cloudinary@1.44.x
tile.json

tessl/pypi-cloudinary

tessl install tessl/pypi-cloudinary@1.44.0

Python and Django SDK for Cloudinary, a cloud-based image and video management service with comprehensive transformation, optimization, and delivery capabilities

Agent Success

Agent success rate when using this tile

94%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.08x

Baseline

Agent success rate without this tile

87%

task.mdevals/scenario-9/

Secure Asset Search Service

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.

Requirements

Your service should provide functionality to:

  1. Generate signed search URLs with configurable expiration times
  2. Support different time-to-live (TTL) values for different use cases
  3. Ensure URLs are properly secured with cryptographic signatures
  4. Handle search query parameters correctly

Implementation

@generates

API

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
    """
    pass

Tests

Generates signed URL with default TTL

  • Calling generate_search_url("resource_type:image") returns a valid URL string @test
  • The generated URL contains signature parameters @test

Generates signed URL with custom TTL

  • Calling generate_search_url("tags:landscape", ttl=600) generates a URL with 10-minute expiration @test
  • Calling generate_search_url("format:jpg", ttl=120) generates a URL with 2-minute expiration @test

Convenience methods work correctly

  • Calling generate_short_lived_url("resource_type:video") generates a URL that expires in 60 seconds @test
  • Calling generate_long_lived_url("uploaded_at>2024-01-01") generates a URL that expires in 1 hour @test

Dependencies { .dependencies }

cloudinary { .dependency }

Provides cloud-based asset management and secure URL generation capabilities.

@satisfied-by