- Convert all existing .bru files from JSON to Bruno DSL format - Remove obsolete files (conflicts/api.bru, kobo/Kobo Initialization.bru) - Update auth configuration to use 'inherit' instead of explicit bearer tokens - Add comprehensive documentation to all test files - Improve test scripts with proper assertions and error handling
68 lines
1.3 KiB
Plaintext
68 lines
1.3 KiB
Plaintext
meta {
|
|
name: Update System Configuration
|
|
type: http
|
|
seq: 4
|
|
}
|
|
|
|
put {
|
|
url: {{base_url}}/api/system/config
|
|
body: json
|
|
auth: inherit
|
|
}
|
|
|
|
headers {
|
|
Authorization: Bearer {{admin_token}}
|
|
Content-Type: application/json
|
|
}
|
|
|
|
body:json {
|
|
{
|
|
"base_url": "https://bookhoard.example.com",
|
|
"opds_base_url": "https://bookhoard.example.com/opds",
|
|
"api_base_url": "https://bookhoard.example.com/api"
|
|
}
|
|
}
|
|
|
|
script:post-response {
|
|
function onResponse(res) {
|
|
if (res.getStatus() === 200) {
|
|
const body = res.getBody();
|
|
tests('Status is success', body.status === "success");
|
|
}
|
|
}
|
|
onResponse(res);
|
|
}
|
|
|
|
settings {
|
|
encodeUrl: true
|
|
timeout: 0
|
|
}
|
|
|
|
docs {
|
|
## Update System Configuration
|
|
|
|
Updates system-wide configuration settings for the Bookhoard instance.
|
|
|
|
**Method:** PUT
|
|
|
|
**Endpoint:** /api/system/config
|
|
|
|
**Authentication:** Bearer token (admin only)
|
|
|
|
**Request Body:**
|
|
- `base_url` (string): Base URL for the instance
|
|
- `opds_base_url` (string): OPDS endpoint base URL
|
|
- `api_base_url` (string): API endpoint base URL
|
|
|
|
**Response:**
|
|
- `status` (string): Update status
|
|
- `config` (object): Updated configuration
|
|
|
|
**Status Codes:**
|
|
- 200: Success
|
|
- 400: Invalid configuration
|
|
- 401: Unauthorized
|
|
- 403: Forbidden (admin only)
|
|
- 500: Internal server error
|
|
}
|