test: add Bruno API test collections for device authentication
- Device token regeneration tests (success, forbidden, not found, unauthorized) - OPDS authentication tests (Bearer token, query token) - Kobo sync tests with token authentication - Test various authentication methods and error cases
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
meta {
|
||||
name: Download Book - Query Token
|
||||
type: http
|
||||
seq: 3
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{opds_base_url}}/opds/devices/{{device_id}}/download/{{book_id}}?token={{device_token}}
|
||||
}
|
||||
|
||||
docs {
|
||||
## Download Book - Query Token
|
||||
|
||||
Tests OPDS book download using query parameter authentication.
|
||||
|
||||
**Method:** GET
|
||||
|
||||
**Endpoint:** /opds/devices/{device_id}/download/{book_id}?token={device_token}
|
||||
|
||||
**Authentication:** Query parameter (for Kobo devices)
|
||||
|
||||
**Path Parameters:**
|
||||
- `device_id` (string): Device UUID
|
||||
- `book_id` (string): Book UUID
|
||||
- `token` (string): Device auth_token
|
||||
|
||||
**Response:** Book file (EPUB)
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success (book file)
|
||||
- 401: Unauthorized (missing or invalid token)
|
||||
- 403: Device sync disabled
|
||||
- 404: Device not found
|
||||
- 500: Book not found
|
||||
|
||||
**Important:** Kobo devices use query parameter for OPDS downloads
|
||||
|
||||
**Use Case:** Kobo devices downloading books from OPDS
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
meta {
|
||||
name: Get Device Catalog - Bearer
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{opds_base_url}}/opds/devices/{{device_id}}/catalog
|
||||
}
|
||||
|
||||
docs {
|
||||
## Get Device OPDS Catalog - Bearer
|
||||
|
||||
Tests OPDS device catalog retrieval using Bearer token authentication.
|
||||
|
||||
**Method:** GET
|
||||
|
||||
**Endpoint:** /opds/devices/{device_id}/catalog
|
||||
|
||||
**Authentication:** Bearer token (for KOReader, API clients, other devices)
|
||||
|
||||
**Path Parameters:**
|
||||
- `device_id` (string): Device UUID
|
||||
|
||||
**Response:** OPDS Atom feed catalog
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success (OPDS catalog)
|
||||
- 401: Unauthorized (missing or invalid token)
|
||||
- 403: Device sync disabled
|
||||
- 404: Device not found
|
||||
|
||||
**Important:** Bearer token in Authorization header
|
||||
|
||||
**Use Case:** KOReader devices, API clients, or any device configured with Bearer token
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
meta {
|
||||
name: Get Device Catalog - Query Token
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{opds_base_url}}/opds/devices/{{device_id}}/catalog?token={{device_token}}
|
||||
}
|
||||
|
||||
docs {
|
||||
## Get Device OPDS Catalog - Query Token
|
||||
|
||||
Tests OPDS device catalog retrieval using query parameter authentication.
|
||||
|
||||
**Method:** GET
|
||||
|
||||
**Endpoint:** /opds/devices/{device_id}/catalog?token={device_token}
|
||||
|
||||
**Authentication:** Query parameter (for Kobo devices)
|
||||
|
||||
**Path Parameters:**
|
||||
- `device_id` (string): Device UUID
|
||||
- `token` (string): Device auth_token
|
||||
|
||||
**Response:** OPDS Atom feed catalog
|
||||
|
||||
**Status Codes:**
|
||||
- 200: Success (OPDS catalog)
|
||||
- 401: Unauthorized (missing or invalid token)
|
||||
- 403: Device sync disabled
|
||||
- 404: Device not found
|
||||
|
||||
**Important:** Kobo devices use query parameter for OPDS catalog
|
||||
|
||||
**Use Case:** Kobo devices accessing OPDS catalog
|
||||
}
|
||||
Reference in New Issue
Block a user