Commit Graph

3 Commits

Author SHA1 Message Date
Georges-Antoine Assi
cca9f500f1 fix(auth): mask hidden platforms from the export endpoints
Both routes passed every caller-supplied platform_id straight to the
exporter. A permission group can grant platforms.write while hiding
individual platforms, so such a caller could export a platform hidden
from them -- reading its metadata and rewriting its gamelist.xml or
metadata.pegasus.txt.

Resolve and check every platform up front, the way update_platform and
delete_platform already do, so a rejected request writes nothing at all
rather than failing part way through a batch. A missing platform 404s
like a hidden one, so the response is not an oracle for whether the
platform exists.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-06 11:40:00 -04:00
Georges-Antoine Assi
11f6b89dd0 fix(auth): gate the export endpoints on platforms.write
Both export endpoints write into the library -- gamelist.xml and
metadata.pegasus.txt in the platform directory, plus media copied into
the per-type folders -- but were gated on roms.read, so any Viewer or
any roms.read client token could trigger a library write. Since #4368
those writes also merge the file already on disk, which makes a read
scope an even poorer fit.

platforms.write is the scope that already gates the sibling library
configuration writes in endpoints/configs.py, including the PUT /config/scan
that toggles the auto-export these endpoints mirror.

No UI change: nothing calls exportGamelistXml/exportPegasus, and the
generated frontend types carry no paths or scopes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-06 11:28:05 -04:00
Georges-Antoine Assi
770b8f94ac feat: add Pegasus Frontend metadata export support
Add metadata.pegasus.txt export alongside the existing gamelist.xml
export. Restructure the export system: rename the gamelist endpoint to
a general-purpose export endpoint (`/api/export/`) with sub-routes for
each format (`/gamelist-xml`, `/pegasus`). Move config from flat
`scan.export_gamelist` to nested `scan.export.gamelist_xml` and
`scan.export.pegasus` for auto-export on scan.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 16:09:20 -04:00