Help with store declarations for snap connections

I have set up a brand store to which I have uploaded a custom gadget snap and also some application snaps. I would like to set up auto connect between my application snaps and other snaps (e.g. the gadget snap, snaps like network-manager and between the application snaps themselves). Initially I understood that the way to do this was through the gadget snap but recently it was advised that I should do this using store declarations for connections. Can some give some advice on the above and also maybe point to some documentation / examples.

I think I need to create a snap-declaration assertion. There are examples of this however I am not sure what to do with the assertion file. Does it get included in the snap? Or uploaded to the store separately?

Hi,

The snap-declaration is created automatically when the snap is registered, and by default it contains only very basic information and default permissions.

As you observed, as your snap starts requiring more specific interfaces, tweaking the snap declaration to allow installation or auto-connection is going to be required. In essence, what you put in your snap.yaml is an indication that your snap wants to use those interfaces; and what gets put in the snap-declaration is the authorization to use or auto-connect those interfaces.

Some of the interfaces can be granted by any reviewer or administration of your brand store, and these are listed here. However, other interfaces are sensitive, privileged, or require complex configuration rules, and thus they require both review from Canonical and enablement by a Snap Store administrator.

So if you declare a plug or slot using a particular interface and your snap fails automated review usually due to “allow-installation” or “allow-auto-connection”, the first thing you can do is go into the snap’s capabilities page (like https://dashboard.snapcraft.io/snaps/YOUR_SNAP/ and then click on “review capabilities”). If the interface in question has a radio toggle that you can enable, then you can grant the use of the interface yourself (here, “you” and “yourself” assume someone with permission to admin or review snaps in your brand store). If it doesn’t have such a toggle, and it’s not in the list of self-service interfaces I noted above, then you need to file a support case indicating the snap in question and the interface you need us to enable, so we can review it and grant it.

Let me know if that helps in this case.

  • Daniel

Yes that does help a lot. However the piece of information I am missing is how to specify which plugs and slots should auto connect. So for example if I have an application snap in my store which has a raw-usb plug that I want to auto connect to core:raw-usb how/where do I specify that.

This is done via a support case; specifically because raw-usb is a privileged interface.

  • Daniel

I will move this discussion to a support case.