Add endpoint for presigned uploads

This commit is contained in:
biondizzle
2025-06-05 19:39:58 -04:00
parent 8d950cf042
commit a6bee5be15
5 changed files with 130 additions and 0 deletions

View File

@@ -589,6 +589,32 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/CreatePresignedUrlResponse'
/api/buckets/{bucketName}/objects/{objectKey}/presigned-upload:
parameters:
- $ref: '#/components/parameters/BucketName'
- $ref: '#/components/parameters/ObjectKey'
post:
operationId: createPresignedUpload
tags:
- Management - Presigned URLs
summary: Create presigned upload URL
description: Creates an empty object and returns a presigned URL for uploading content
security:
- ApiKey: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreatePresignedUploadRequest'
responses:
'201':
description: Presigned URL created
content:
application/json:
schema:
$ref: '#/components/schemas/CreatePresignedUrlResponse'
components:
schemas:
CreatePresignedUrlResponse:
@@ -597,6 +623,24 @@ components:
url:
type: string
example: /my-bucket/file.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20230115%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230115T103000Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=abc123&hash=def456
CreatePresignedUploadRequest:
type: object
required:
- access_key
properties:
access_key:
type: string
example: "AKIAIOSFODNN7EXAMPLE"
expires_in:
type: integer
minimum: 1
maximum: 604800
default: 3600
example: 3600
content_type:
type: string
default: "application/octet-stream"
example: "image/jpeg"
ObjectSummary:
type: object
properties:

View File

@@ -573,6 +573,32 @@
application/json:
schema:
$ref: './schemas.yaml#/CreatePresignedUrlRequest'
responses:
'201':
description: Presigned URL created
content:
application/json:
schema:
$ref: './schemas.yaml#/CreatePresignedUrlResponse'
/api/buckets/{bucketName}/objects/{objectKey}/presigned-upload:
parameters:
- $ref: './parameters.yaml#/BucketName'
- $ref: './parameters.yaml#/ObjectKey'
post:
operationId: createPresignedUpload
tags:
- Management - Presigned URLs
summary: Create presigned upload URL
description: Creates an empty object and returns a presigned URL for uploading content
security:
- ApiKey: []
requestBody:
required: true
content:
application/json:
schema:
$ref: './schemas.yaml#/CreatePresignedUploadRequest'
responses:
'201':
description: Presigned URL created

View File

@@ -628,6 +628,25 @@ CreatePresignedUrlRequest:
type: string
example: "AKIAIOSFODNN7EXAMPLE"
CreatePresignedUploadRequest:
type: object
required:
- access_key
properties:
access_key:
type: string
example: "AKIAIOSFODNN7EXAMPLE"
expires_in:
type: integer
minimum: 1
maximum: 604800
default: 3600
example: 3600
content_type:
type: string
default: "application/octet-stream"
example: "image/jpeg"
CreatePresignedUrlResponse:
type: object
properties: