Let a theme bring its own files: fonts, vector graphics and images inlined when drawing, and shown in the preview #343
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#343
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A theme cannot bring a file of its own. The templates plugin is asked that "every template must hold its assets, so fonts, logos, icons, or other graphical elements can be printed", vector graphics preferred (postulo/postulo-templates#8).
What exists today
src/postulo/plugins/logos.py).URLFetcher(allowed_protocols={"data"}, allow_redirects=False)and nobase_url; Chromium runspage.route("**/*", lambda route: route.abort())(src/postulo/documents/pdf.py). That is deliberate (#163), andtests/security/test_pdf_fetching.pyholds it.data:address". Nothing helps a theme do that: no tag or loader turns a file in its package into one.check_fontsprobes system fonts only (#74).src/postulo/config/settings/base.py):img-src 'self' data:,font-src 'self',style-src 'self'with a nonce. Adata:image shows; adata:font does not; astyleattribute or a<style>without the nonce, inside an inline SVG included, is refused.Proposal
data:address, a font as an@font-facerule with adata:source. The path is held to the package's own directory, and the types and sizes are limited.Decisions
theme:address the fetcher maps to package files, which keeps each document smaller and opens the fetcher a little.data:fonts in the preview. Recommended: allowed on the document preview only, not on Postulo's pages.Needed by
postulo/postulo-templates#8.
Done when
tests/security/test_pdf_fetching.pystill passes unchanged.postulo.plugins.apiget their line in the wiki's Writing a plugin (tests/test_wiki_surface.py) and a test intests/test_plugin_surface.py; new pages join the page-coverage walk (tests/test_page_coverage.py) and the isolation sweep (tests/security/test_isolation_sweep.py); new strings go in the working catalogues (English, French, and European and Brazilian Portuguese as drafts).From the list of template improvements of 2026-09-30.