Expand description
Permissioned widget manifests, signed catalogue data, and safe package installation.
Structsยง
- Catalogue
- The signed list of reviewed widgets.
- Catalogue
Entry - A widget listed in the catalogue.
- Installed
Metadata ๐ - Install record written to
.installed.jsonbeside the manifest. - Installed
Widget - A widget installed on this device.
- Widget
Manifest - A widgetโs
widget.json. - Widget
Process - A process a widget declares.
Enumsยง
- Widget
Permission - An action a widget may be granted, named as in manifests.
Constantsยง
- MAX_
ARCHIVE_ ๐BYTES - Largest widget package download, in bytes.
- MAX_
EXPANDED_ ๐BYTES - Largest total size of a packageโs extracted files, in bytes.
- MAX_
FILES ๐ - Most entries a package may contain.
Functionsยง
- discover_
installed - Reads every installed widget, sorted by ID. Hidden folders, such as staging folders, are skipped, and each unreadable widget yields an error.
- extract_
archive ๐ - Extracts a ZIP into
staging, rejecting unsafe or duplicate paths, symlinks, too many entries, and oversized content. - install_
archive - Installs a widget package, replacing any installed version only after every check passes.
- read_
installed ๐ - Reads an installed widget and checks its install record, including that
widget.jsonhasnโt changed since install. Debug builds accept widgets without a record. - read_
manifest ๐ - Reads and validates
widget.json, which may be at most 128 KB. - replace_
atomically ๐ - Moves
stagingtodestination, keeping the old folder inbackupand restoring it if the move fails. - uninstall_
widget - Removes an installed widgetโs folder. A missing widget succeeds.
- validate_
archive_ ๐path - Rejects archive paths with parent, root, or drive components.
- validate_
https_ ๐origin - Accepts bare HTTPS origins, such as
https://example.com, without a path, query, or credentials. - validate_
process_ ๐id - Accepts IDs of 1 to 64 ASCII letters, digits,
_, and-. - validate_
relative_ ๐file - Requires a non-empty relative path that doesnโt leave the package.
- validate_
sha256 ๐ - Requires 64 hex characters.
- validate_
widget_ ๐id - Accepts IDs of 1 to 64 lowercase letters, digits, and underscores.
- verify_
signature ๐ - Verifies a base64 Ed25519 signature with a base64 raw 32-byte public key.
- write_
installed_ ๐metadata - Writes
.installed.jsonfor a staged widget.