forked from claw/flaskpaste
docs: update for v1.4.0 features
- Add anti-flood, rate limiting, scheduled cleanup to feature lists - Update version to 1.4.0, test count to 205 - Document /pastes endpoint with query parameters - Add anti-flood fields to /challenge response - Update CLI docs with new commands (list, search, export) - Add decision log entries for recent features
This commit is contained in:
@@ -52,13 +52,30 @@ Host: localhost:5000
|
||||
"enabled": true,
|
||||
"nonce": "a1b2c3d4e5f6a7b8a1b2c3d4e5f6a7b8",
|
||||
"difficulty": 20,
|
||||
"base_difficulty": 20,
|
||||
"elevated": false,
|
||||
"expires": 1700000300,
|
||||
"token": "a1b2c3d4...:1700000300:20:signature"
|
||||
}
|
||||
```
|
||||
|
||||
**Response (PoW enabled, anti-flood active):**
|
||||
```json
|
||||
{
|
||||
"enabled": true,
|
||||
"nonce": "a1b2c3d4e5f6a7b8a1b2c3d4e5f6a7b8",
|
||||
"difficulty": 24,
|
||||
"base_difficulty": 20,
|
||||
"elevated": true,
|
||||
"expires": 1700000300,
|
||||
"token": "a1b2c3d4...:1700000300:24:signature"
|
||||
}
|
||||
```
|
||||
|
||||
The client must find a number `N` such that `SHA256(nonce + ":" + N)` has at least `difficulty` leading zero bits.
|
||||
|
||||
When `elevated` is true, the difficulty has been increased due to high request volume (anti-flood protection). The `base_difficulty` shows the normal difficulty level.
|
||||
|
||||
---
|
||||
|
||||
### GET /health
|
||||
@@ -123,6 +140,55 @@ Host: localhost:5000
|
||||
|
||||
---
|
||||
|
||||
### GET /pastes
|
||||
|
||||
List pastes for the authenticated user. Requires authentication.
|
||||
|
||||
**Request:**
|
||||
```http
|
||||
GET /pastes HTTP/1.1
|
||||
Host: localhost:5000
|
||||
X-SSL-Client-SHA1: a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2
|
||||
```
|
||||
|
||||
**Query Parameters:**
|
||||
| Parameter | Type | Description |
|
||||
|-----------|------|-------------|
|
||||
| `limit` | int | Maximum results (default: 100, max: 1000) |
|
||||
| `offset` | int | Skip first N results (default: 0) |
|
||||
| `type` | string | Filter by MIME type (glob pattern, e.g., `image/*`) |
|
||||
| `after` | int | Created after timestamp (Unix epoch) |
|
||||
| `before` | int | Created before timestamp (Unix epoch) |
|
||||
|
||||
**Response (200 OK):**
|
||||
```json
|
||||
{
|
||||
"pastes": [
|
||||
{
|
||||
"id": "a1b2c3d4e5f6",
|
||||
"size": 1234,
|
||||
"mime_type": "text/plain",
|
||||
"created_at": "2024-12-20T10:30:00Z",
|
||||
"expires_at": "2024-12-25T10:30:00Z",
|
||||
"burn_after_read": false,
|
||||
"password_protected": false
|
||||
}
|
||||
],
|
||||
"total": 42,
|
||||
"limit": 100,
|
||||
"offset": 0
|
||||
}
|
||||
```
|
||||
|
||||
**Response (401 Unauthorized):**
|
||||
```json
|
||||
{
|
||||
"error": "Authentication required"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### POST /
|
||||
|
||||
Create a new paste.
|
||||
@@ -223,6 +289,7 @@ Password protected content
|
||||
- Minimum: disabled by default (`FLASKPASTE_MIN_SIZE`, e.g. 64 bytes for encryption enforcement)
|
||||
- Anonymous: 3 MiB (configurable via `FLASKPASTE_MAX_ANON`)
|
||||
- Authenticated: 50 MiB (configurable via `FLASKPASTE_MAX_AUTH`)
|
||||
|
||||
---
|
||||
|
||||
### GET /{id}
|
||||
|
||||
Reference in New Issue
Block a user