Skip to content

Commit 30ba614

Browse files
Document signed URL support in storage docs.
Add README examples and API reference entries for create_signed_url and SignedUrl types so SDK usage matches the new storage feature. Made-with: Cursor
1 parent 6fb89b7 commit 30ba614

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,14 @@ objects = storage.list()
126126
for obj in objects:
127127
print(obj.name, obj.size, obj.link)
128128

129+
# Create a signed URL (default expiry: 1 hour)
130+
signed = storage.create_signed_url('myfile.txt')
131+
print('Signed URL:', signed.url)
132+
print('Expires at:', signed.expires_at)
133+
134+
# Create a signed URL with custom expiry (in seconds)
135+
short_lived = storage.create_signed_url('myfile.txt', expires_in_seconds=300)
136+
129137
# Download a file
130138
content = storage.download('myfile.txt')
131139
with open('downloaded.txt', 'wb') as f:
@@ -383,6 +391,17 @@ Lists all files in YepCode storage.
383391

384392
**Returns:** List of StorageObject
385393

394+
##### `create_signed_url(name: str, expires_in_seconds: Optional[int] = None) -> SignedUrl`
395+
396+
Creates a temporary signed URL for a storage object.
397+
398+
**Parameters:**
399+
400+
- `name`: Name of the file in storage
401+
- `expires_in_seconds`: Expiration time for the URL in seconds (optional)
402+
403+
**Returns:** SignedUrl
404+
386405
#### Types
387406

388407
```python
@@ -398,6 +417,15 @@ class StorageObject:
398417
class CreateStorageObjectInput:
399418
name: str # File name
400419
file: Any # File content (bytes or file-like)
420+
421+
class CreateSignedUrlInput:
422+
path: str # File path in storage
423+
expires_in_seconds: Optional[int] # Expiration time in seconds
424+
425+
class SignedUrl:
426+
url: str # Temporary signed URL
427+
path: str # File path in storage
428+
expires_at: str # Expiration timestamp (ISO8601)
401429
```
402430

403431
## License

0 commit comments

Comments
 (0)