Is there any guidance/document about how to write App-provided slots

Simon Fels simon.fels at canonical.com
Mon Nov 14 13:29:04 UTC 2016


On 14.11.2016 11:56, Enwei Zhang wrote:
> Thanks David. Did you forget to add Morphis and Zyga? :)
> Loop Simon.
> Simon told me here is the latest bluez snap,
> https://code.launchpad.net/~snappy-hwe-team/snappy-hwe-snaps/+git/bluez
> <https://code.launchpad.net/%7Esnappy-hwe-team/snappy-hwe-snaps/+git/bluez>
> Simon told me that bluez snap only declares bluez slot in its
> snapcraft.yaml.
> 
> IMHO, after the bluez snap declares "bluez" slot in snapcraft.yaml, it
> will have *bluezPermanentSlotAppArmor* capability defined in
> https://github.com/snapcore/snapd/blob/master/interfaces/builtin/bluez.go#L28
> <https://github.com/snapcore/snapd/blob/master/interfaces/builtin/bluez.go#L28>
> So it seems to me by defining "bluez" slot, the bluez snap have more
> power/permissions to do some privileged work,
> *but* it doesn't *provide* anything to other snaps. From my experiment,
> if a new snap connects to the bluez slot in bluez snap, the new snap
> will not get the extra permissions.

The connecting snap (the plug side) will get the bluezConnectedPlug
snippets from the interface definitions which actually allow the
application to talk to bluez over dbus. So the bluez snap provides
something to other services, a dbus service.

If you want to know more in deep things about interfaces and how they
work have a look at Zygmunds great post about how to write an interface
at
http://www.zygoon.pl/2016/08/creating-your-first-snappy-interface.html
It will tell about all the details and the different snippets you can use.

regards,
Simon





More information about the Snapcraft mailing list