Skip to content

Commit 1228464

Browse files
Vitexusclaude
andcommitted
docs(multiflexi-web): document new logoimage.php endpoint for credential-type logos
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent c29a787 commit 1228464

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

source/development/credential-prototype.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,33 @@ In your ``debian/*.install`` file, install the logo to the shared path:
209209

210210
Do **not** install logos to ``/usr/share/multiflexi-web/images/`` — that path is reserved for web UI assets. All application and credential prototype logos go to ``/usr/share/multiflexi/images/``.
211211

212+
Serving logos in multiflexi-web
213+
--------------------------------
214+
215+
``CredentialProtoType::logo()`` (and the ``logo`` column on a saved
216+
``CredentialType``) returns a **bare filename** — e.g. ``my-service.svg`` — not a
217+
path. ``multiflexi-web`` resolves that filename to actual bytes through
218+
``src/logoimage.php``, the credential-type counterpart of ``src/appimage.php``
219+
(which serves application icons by ``uuid``).
220+
221+
``MultiFlexi\Ui\CredentialTypeLogo`` routes any bare filename through it:
222+
223+
.. code-block:: text
224+
225+
logoimage.php?file=my-service.svg
226+
227+
``logoimage.php`` looks the file up in, in order:
228+
229+
1. ``src/images/`` (development source tree)
230+
2. ``/usr/share/multiflexi/images/`` (deb-installed application/credential-prototype logos)
231+
232+
falling back to ``images/apps.svg`` if not found. The ``file`` parameter is
233+
passed through ``basename()`` before use, so only a bare filename can ever be
234+
requested — no path traversal into arbitrary filesystem locations.
235+
236+
Only the built-in "none" placeholder logo (a ``data:image/svg+xml;base64,...``
237+
URI) bypasses ``logoimage.php`` and is used directly as the ``<img src>``.
238+
212239
Database Schema
213240
---------------
214241

0 commit comments

Comments
 (0)