Skip to content

Commit e0a66c9

Browse files
AdamF42vins01-4science
authored andcommitted
Merged in task/dspace-cris-2024_02_x/IIIF-203 (pull request DSpace#81)
[IIIF-203] Updated bitstreams contract Approved-by: Vincenzo Mecca
2 parents e1fcabb + 89a6c05 commit e0a66c9

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

bitstreams.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,45 @@ The supported **Request Headers** are:
117117
* Range: not implemented yet. Provide support to partial content download
118118
* If-None-Match: not implemented yet. Support for cache control
119119

120+
### Presigned URL
121+
122+
**GET /api/core/bitstreams/<:uuid>/signedurl**
123+
124+
This endpoint returns a presigned URL that allows direct, temporary access to the bitstream content stored in the configured storage backend (e.g., S3). Clients can use this URL to download the bitstream without passing through the DSpace server, improving performance and offloading bandwidth.
125+
126+
#### Security
127+
128+
- Requires READ permission on the specified bitstream (`hasPermission(#uuid, 'BITSTREAM','READ')`).
129+
130+
131+
#### Response
132+
133+
A JSON object containing:
134+
135+
- `presignedUrl`: The generated presigned URL granting temporary access.
136+
137+
Example response body:
138+
139+
```json
140+
{
141+
"presignedUrl": "https://bucket.s3.amazonaws.com/object?X-Amz-Algorithm=...",
142+
}
143+
```
144+
145+
146+
#### Error Responses
147+
148+
- **404 Not Found**: If the bitstream with the given UUID does not exist or a presigned URL cannot be generated.
149+
- **401 Unauthorized**: If the requester is anonymous and the bitstream does not have read permissions.
150+
- **403 Forbidden**: If the requester lacks sufficient permissions to read the bitstream.
151+
- **500 Internal Server Error**: If an unexpected error occurs during processing.
152+
153+
154+
#### Notes
155+
156+
- The expiration time of the presigned URL is configurable via the DSpace configuration property `assetstore.s3.presigned.url.expiration.seconds`.
157+
- This URL is intended for temporary direct access and should be used promptly before expiration.
158+
120159
### Main Thumbnail
121160
**/api/core/bitstreams/<:uuid>/thumbnail**
122161

0 commit comments

Comments
 (0)