Currently, snapd supports the `environment` keyword in the root of the
`snap.yaml`, as well as nested under individual `apps`. However, it does
not support them under individual `hooks`. Add support for this, which
lays more of the groundwork necessary for the snapcraft CLI to get rid
of its wrappers.
Signed-off-by: Kyle Fazzari <kyrofa@ubuntu.com>
Currently snapd will happily load any hooks provided by the snap. Only
certain hooks will ever be called by snapd itself, but this means that
arbitrary hooks could be called via `snap run`, which may not be desired
behavior. This commit implements a whitelist of supported hooks that
will be loaded-- every other hook will be ignored.
Updates: #1586465
Signed-off-by: Kyle Fazzari <kyle@canonical.com>