#304: declare the font-list route's access rule explicitly
Some checks failed
CI / Build container images (pull_request) Successful in 3m51s
CI / Lint, typecheck, test (pull_request) Successful in 6m35s
CI / Auth e2e pack (pull_request) Failing after 3m6s
CI / Import/export fidelity gate (pull_request) Has been skipped

The route-permission fence (#52) failed in CI, not locally: I had run the
fonts and import-export suites, not the full api suite, and that fence needs
a database. `@AuthenticatedOnly()` is the rule the route always meant — a
session, no further permission.

Re-verified with the FULL api suite against a fresh database: 103 files /
575 tests passed.
This commit is contained in:
Claude Opus 5 2026-08-01 18:46:47 +02:00
parent f8c241b11a
commit ee6a11f9b0

View File

@ -23,6 +23,7 @@ import type { Response } from 'express';
import { SiteAdminGuard } from '../admin/site-admin.guard'; import { SiteAdminGuard } from '../admin/site-admin.guard';
import { AuthedRequest, Public } from '../auth/auth.guard'; import { AuthedRequest, Public } from '../auth/auth.guard';
import { AuthenticatedOnly } from '../permissions/permission.decorators';
import { CustomFontStorageService } from './custom-font-storage.service'; import { CustomFontStorageService } from './custom-font-storage.service';
import { CustomFontsService, WeightUpload } from './custom-fonts.service'; import { CustomFontsService, WeightUpload } from './custom-fonts.service';
@ -125,6 +126,10 @@ export class CustomFontsFileController {
private readonly fonts: CustomFontsService, private readonly fonts: CustomFontsService,
) {} ) {}
// Explicit access declaration, as every route needs (issue #52's fence
// `route-permissions.e2e.db.test.ts`): a session, no further permission —
// the list says which families exist, which is what the pickers offer.
@AuthenticatedOnly()
@Get() @Get()
list(): Promise<CustomFontView[]> { list(): Promise<CustomFontView[]> {
return this.fonts.list(); return this.fonts.list();