Add subspace-tv FastAPI service with Unraid deployment
Includes FastAPI application with device authentication, Docker configuration, Bruno API tests, and git-based deployment scripts for Unraid. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
30
bruno/Config - Authorized Device.bru
Normal file
30
bruno/Config - Authorized Device.bru
Normal file
@@ -0,0 +1,30 @@
|
||||
meta {
|
||||
name: Config - Authorized Device
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{baseUrl}}/api/v1/config
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
X-Password: 1
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
res.body.authorized: eq true
|
||||
res.body.config.url: isDefined
|
||||
res.body.config.username: isDefined
|
||||
res.body.config.password: isDefined
|
||||
}
|
||||
|
||||
docs {
|
||||
Get configuration for an authorized password.
|
||||
|
||||
This request uses password "1" which is in the authorized_devices.json list.
|
||||
Expected response includes full configuration with url, username, and password.
|
||||
}
|
||||
23
bruno/Config - Missing Header.bru
Normal file
23
bruno/Config - Missing Header.bru
Normal file
@@ -0,0 +1,23 @@
|
||||
meta {
|
||||
name: Config - Missing Header
|
||||
type: http
|
||||
seq: 4
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{baseUrl}}/api/v1/config
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 400
|
||||
res.body.detail: eq X-Password header is required
|
||||
}
|
||||
|
||||
docs {
|
||||
Attempt to get configuration without X-Password header.
|
||||
|
||||
This request intentionally omits the required X-Password header.
|
||||
Expected response is 400 Bad Request with error message.
|
||||
}
|
||||
28
bruno/Config - Unauthorized Device.bru
Normal file
28
bruno/Config - Unauthorized Device.bru
Normal file
@@ -0,0 +1,28 @@
|
||||
meta {
|
||||
name: Config - Unauthorized Device
|
||||
type: http
|
||||
seq: 3
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{baseUrl}}/api/v1/config
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
X-Password: invalid-password
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
res.body.authorized: eq false
|
||||
res.body.config: isEmpty
|
||||
}
|
||||
|
||||
docs {
|
||||
Get configuration for an unauthorized password.
|
||||
|
||||
This request uses a password that is NOT in the authorized_devices.json list.
|
||||
Expected response shows authorized: false with empty config object.
|
||||
}
|
||||
20
bruno/Health Check.bru
Normal file
20
bruno/Health Check.bru
Normal file
@@ -0,0 +1,20 @@
|
||||
meta {
|
||||
name: Health Check
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{baseUrl}}/health
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
assert {
|
||||
res.status: eq 200
|
||||
res.body.status: eq healthy
|
||||
}
|
||||
|
||||
docs {
|
||||
Health check endpoint to verify service is running.
|
||||
}
|
||||
5
bruno/bruno.json
Normal file
5
bruno/bruno.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"version": "1",
|
||||
"name": "Subspace TV Config API",
|
||||
"type": "collection"
|
||||
}
|
||||
3
bruno/environments/Local.bru
Normal file
3
bruno/environments/Local.bru
Normal file
@@ -0,0 +1,3 @@
|
||||
vars {
|
||||
baseUrl: http://localhost:8000
|
||||
}
|
||||
3
bruno/environments/Production.bru
Normal file
3
bruno/environments/Production.bru
Normal file
@@ -0,0 +1,3 @@
|
||||
vars {
|
||||
baseUrl: https://your-production-server.com:8000
|
||||
}
|
||||
Reference in New Issue
Block a user