Skip to content

Commit 2ccaa13

Browse files
committed
Multipart uploads alpha working
This still need some QA and testing but it works.
1 parent 7a19a84 commit 2ccaa13

6 files changed

Lines changed: 408 additions & 111 deletions

File tree

DESIGN.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -331,13 +331,8 @@ Authorization: Bearer <JWT>
331331
**Request:**
332332

333333
```http
334-
POST /files
334+
POST /file
335335
Authorization: Bearer <JWT>
336-
Content-Type: application/json
337-
338-
{
339-
"total_size": 104857600
340-
}
341336
```
342337

343338
**Response:**
@@ -371,7 +366,7 @@ Content-Type: application/json
371366
**Request:**
372367

373368
```http
374-
GET /files/{file_id}/upload
369+
GET /file/{file_id}/upload
375370
Authorization: Bearer <JWT>
376371
```
377372

TODO.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
- Don't use "CREATE TABLE IF NOT EXISTS" on every request, create the table during a setup phase or check for its existence in a more efficient way
99
- User better rate limiting, probably involving CAPTCHAs for unauthenticated endpoints
1010
- Add tests for positive /auth/token and replay attacks
11+
- Fix test slowness due to reliance on R2.

r2-cors-dev.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"rules": [
3+
{
4+
"id": "cryptdrive-test-frontend",
5+
"allowed": {
6+
"origins": ["http://localhost:8787"],
7+
"methods": ["GET", "PUT", "POST", "DELETE", "HEAD"],
8+
"headers": ["*"]
9+
},
10+
"exposeHeaders": ["ETag", "Content-Length"],
11+
"maxAgeSeconds": 3600
12+
}
13+
]
14+
}

r2-cors.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"rules": [
3+
{
4+
"id": "cryptdrive-frontend",
5+
"Allowed": {
6+
"origin": "https://cryptdrive.gauthier.workers.dev",
7+
"methods": ["GET", "PUT", "POST", "DELETE", "HEAD"],
8+
"headers": ["*"]
9+
},
10+
"exposeHeaders": ["ETag", "Content-Length"],
11+
"maxAgeSeconds": 3600
12+
}
13+
]
14+
}

0 commit comments

Comments
 (0)