Skip to content

Commit 6c254fc

Browse files
authored
Merge develop into main for 0.9.0-beta.154
release: 0.9.0-beta.154 — API key on remaining keyless Skaldleita call sites (#264)
2 parents 6764a47 + a75856c commit 6c254fc

2 files changed

Lines changed: 26 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
All notable changes to Library Manager will be documented in this file.
44

5+
## [0.9.0-beta.154] - 2026-07-14
6+
7+
### Fixed
8+
- **#264: Auth headers on all Skaldleita API calls** — Added signed headers + API key to 4 call sites that previously sent keyless requests to the Skaldleita API: `api_book_detail`, `api_author_detail`, `api_series_detail`, and `identify_ebook_from_filename`. These endpoints now require authentication after the gate was changed to key-or-401.
9+
510
## [0.9.0-beta.153] - 2026-06-12
611

712
### Security

app.py

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
- Multi-provider AI (Gemini, OpenRouter, Ollama)
1212
"""
1313

14-
APP_VERSION = "0.9.0-beta.153"
14+
APP_VERSION = "0.9.0-beta.154"
1515
GITHUB_REPO = "deucebucket/library-manager" # Your GitHub repo
1616

1717
# Versioning Guide:
@@ -2295,9 +2295,14 @@ def identify_ebook_from_filename(filename, folder_path, config):
22952295
search_query = f"{author} {title}" if author else title
22962296
logger.debug(f"[EBOOK] Searching BookDB for: {search_query}")
22972297

2298+
api_key = config.get('bookdb_api_key') or BOOKDB_PUBLIC_KEY
2299+
headers = get_signed_headers() or {}
2300+
headers['X-API-Key'] = api_key
2301+
22982302
resp = requests.get(
22992303
f"{BOOKDB_API_URL}/search",
23002304
params={'q': search_query[:100]}, # Limit query length
2305+
headers=headers,
23012306
timeout=10
23022307
)
23032308

@@ -11902,11 +11907,14 @@ def api_book_detail(book_id):
1190211907
"""
1190311908
Get full book details from BookBucket + ABS status.
1190411909
Used for hover cards and detail modals.
11905-
Uses public endpoint - no API key required.
1190611910
"""
1190711911
try:
1190811912
# Fetch full book details from BookBucket
11909-
resp = requests.get(f"{BOOKDB_API_URL}/book/{book_id}", timeout=10)
11913+
secrets = load_secrets()
11914+
api_key = secrets.get('bookdb_api_key') or BOOKDB_PUBLIC_KEY
11915+
headers = get_signed_headers() or {}
11916+
headers['X-API-Key'] = api_key
11917+
resp = requests.get(f"{BOOKDB_API_URL}/book/{book_id}", headers=headers, timeout=10)
1191011918

1191111919
if resp.status_code != 200:
1191211920
return jsonify({'error': f'Book not found (status {resp.status_code})'})
@@ -11977,10 +11985,13 @@ def api_author_detail(author_id):
1197711985
"""
1197811986
Get author details from BookBucket.
1197911987
Used for hover cards on author search results.
11980-
Uses public endpoint - no API key required.
1198111988
"""
1198211989
try:
11983-
resp = requests.get(f"{BOOKDB_API_URL}/author/{author_id}", timeout=10)
11990+
secrets = load_secrets()
11991+
api_key = secrets.get('bookdb_api_key') or BOOKDB_PUBLIC_KEY
11992+
headers = get_signed_headers() or {}
11993+
headers['X-API-Key'] = api_key
11994+
resp = requests.get(f"{BOOKDB_API_URL}/author/{author_id}", headers=headers, timeout=10)
1198411995

1198511996
if resp.status_code != 200:
1198611997
return jsonify({'error': f'Author not found (status {resp.status_code})'})
@@ -12000,10 +12011,13 @@ def api_series_detail(series_id):
1200012011
"""
1200112012
Get series details from BookBucket.
1200212013
Used for hover cards on series search results.
12003-
Uses public endpoint - no API key required.
1200412014
"""
1200512015
try:
12006-
resp = requests.get(f"{BOOKDB_API_URL}/series/{series_id}", timeout=10)
12016+
secrets = load_secrets()
12017+
api_key = secrets.get('bookdb_api_key') or BOOKDB_PUBLIC_KEY
12018+
headers = get_signed_headers() or {}
12019+
headers['X-API-Key'] = api_key
12020+
resp = requests.get(f"{BOOKDB_API_URL}/series/{series_id}", headers=headers, timeout=10)
1200712021

1200812022
if resp.status_code != 200:
1200912023
return jsonify({'error': f'Series not found (status {resp.status_code})'})

0 commit comments

Comments
 (0)