* daemon: support sideloading of components
* o/snapstate: check info in snap and component is coherent
Make sure that when we install a component it has been defined by the
owner snap and that the type is coherent betwee snap and component
metadata.
* cmd/snap: allow installation of local components
* tests/main: add spread test for components
* daemon: add component name to API data
* fixup! o/snapstate: check info in snap and component is coherent
* fixup! cmd/snap: allow installation of local components
* fixup! daemon: support sideloading of components
* fixup! tests/main: add spread test for components
* daemon: add helper for ErrorKindSnapNotInstalled errors
* fixup! daemon: support sideloading of components
This modification is needed to test the edge case of having one snap
failing with ErrSnapNotFound and another snap being successful.
It used to return 500 error instead of the more useful 404.
For context see: https://bugs.launchpad.net/snapd/+bug/2024858
Signed-off-by: Zeyad Gouda <zeyad.gouda@canonical.com>
apiError is a StructuredResponse (and also an error), the plan is to
use it everywhere instead of building the complicated respJSON for
errors directly
it can also be used as a return type for functions that are meant
exactly to build errors