WEFT_OS/crates/weft-pack
Marco Allegretti 3186e524ab
feat: grant an app only the capabilities the user approved
Every capability a package declared was granted at launch, so a signed
package received all the permissions it asked for. Blueprint 5.2 rules
that out.

A package now gets only the capabilities the user approved. weft-pack
install --approve approves those the installed package declares, and
weft-pack approve <id> approves those of the installed app later.
Without approval, install lists what still needs it. The approval is
recorded in $XDG_DATA_HOME/weft/approvals/<id>. weft-appd refuses to
launch an app declaring a capability the record does not hold, with
403 and the capabilities named, after refusing unknown or unsupported
ones as before.

An update that declares a new capability needs approval again, and
uninstalling forgets the approval. Private app data is a minimal
execution resource and needs no approval, so Notes and the existing
fixtures are unchanged.

Unit tests cover the approval record, install and approve, an update
adding a capability, uninstall, and appd refusing and then launching.
tests/frame/check_update.py launches a real app declaring notifications:
it is refused until weft-pack approve, then runs.
2026-10-09 19:11:53 +00:00
..
src feat: grant an app only the capabilities the user approved 2026-10-09 19:11:53 +00:00
Cargo.toml fix(pack): copy packages by directory descriptor so swapped links cannot redirect the copy 2026-10-09 14:17:09 +00:00