Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
interfaces: add an interface for gnome-online-accounts D-Bus service #4140
Conversation
|
Hey @jhenstridge, thank you for the interface and the test. I will review it now. My suggestion on the test snap is to rename it to test-snapd-gnome-online-accounts, add it to the tree (as source) and work with @mvo5 to upload it to the store for testing. |
zyga
requested changes
Nov 3, 2017
Looks good in general.
Before merging this, please work on uploading the test snap into the store and adding the source code to tests/lib/snaps. Please also consider changing the summary of the interface as I think it is not accurate at the moment.
| + | ||
| +package builtin | ||
| + | ||
| +const gnomeOnlineAccountsServiceSummary = `allows operating as the GNOME Online Accounts service` |
zyga
Nov 3, 2017
Contributor
I think this allows either to operate as GNOME Online Accounts service or to talk to it, correct?
| + bus=session | ||
| + interface=org.freedesktop.DBus.ObjectManager | ||
| + path=/org/gnome/OnlineAccounts | ||
| + peer=(label=unconfined), |
zyga
Nov 3, 2017
Contributor
This is only true on classic. On core this would be confined. If this interface is only for classic then I'd suggest renaming the summary to say something like allows interacting with the GNOME Online Accounts service.
jdstrand
Dec 7, 2017
Contributor
FYI, this is only on classic (implicitOnCore is not set). The summary of the language looks fine AFAICT in this context.
| + registerIface(&commonInterface{ | ||
| + name: "gnome-online-accounts-service", | ||
| + summary: gnomeOnlineAccountsServiceSummary, | ||
| + implicitOnCore: false, |
|
Thanks for the review comments. I had adapted the interface summary from the existing This interface is pretty much exclusively designed for classic at this point: the API is very much all or nothing. If it was reworked to make it confinement-friendly, we'd probably want to merge it into the desktop interface. While it remains unsafe, it probably makes sense to be reserved for OS and implicit on classic only. I've also added the source for the test snap to the tree. |
zyga
approved these changes
Nov 3, 2017
+1 once you add a spread test for this.
Please work with @sergiocazzolato to get the test snap in the store.
|
@jhenstridge tests are failing on
|
pedronis
requested a review
from
jdstrand
Nov 9, 2017
codecov-io
commented
Nov 10, 2017
•
Codecov Report
@@ Coverage Diff @@
## master #4140 +/- ##
==========================================
+ Coverage 78.04% 78.04% +<.01%
==========================================
Files 450 451 +1
Lines 30904 30913 +9
==========================================
+ Hits 24118 24127 +9
Misses 4774 4774
Partials 2012 2012
Continue to review full report at Codecov.
|
|
Looks good to me, once @jdstrand approves this can go in |
|
@sergiocazzolato can you please confirm if the new test snap is uploaded to the store? |
|
I uploaded the amd64 version of the snap to the store now and shared with Sergio. If more people need access please let me know. |
jhenstridge
added some commits
Nov 2, 2017
jdstrand
approved these changes
Dec 7, 2017
Thanks for the PR! :)
One question and a couple of comment suggestions but otherwise LGTM. This interface grants complete access to GOA, so the base declaration denying auto-connection is spot on.
| + slot-snap-type: | ||
| + - core | ||
| + deny-auto-connection: true | ||
| +` |
| + bus=session | ||
| + interface=org.freedesktop.DBus.ObjectManager | ||
| + path=/org/gnome/OnlineAccounts | ||
| + peer=(label=unconfined), |
zyga
Nov 3, 2017
Contributor
This is only true on classic. On core this would be confined. If this interface is only for classic then I'd suggest renaming the summary to say something like allows interacting with the GNOME Online Accounts service.
jdstrand
Dec 7, 2017
Contributor
FYI, this is only on classic (implicitOnCore is not set). The summary of the language looks fine AFAICT in this context.
| + bus=session | ||
| + interface=org.freedesktop.DBus.Properties | ||
| + path=/org/gnome/OnlineAccounts{,/**} | ||
| + peer=(label=unconfined), |
jdstrand
Dec 7, 2017
Contributor
This also allows 'Set()', is that intended? If so, perhaps # Allow getting/setting properties on accounts.
| + path=/org/gnome/OnlineAccounts{,/**} | ||
| + peer=(label=unconfined), | ||
| + | ||
| +# Allow access to OnlineAccounts methods |
| + . $TESTSLIB/pkgdb.sh | ||
| + echo "Ensure we have a working goa-daemon" | ||
| + distro_install_package gnome-online-accounts | ||
| + snap install --edge test-snapd-gnome-online-accounts |
jdstrand
Dec 7, 2017
Contributor
It would be nice if this didn't have to be installed over the network, but I guess there is currently no way to create a snap with compiled code in tests/lib/snaps....
|
@jhenstridge - once you decide what to do with my comments, this can go in (based on @mvo5's previous comment). After it is in, I suggest creating a PR against release/2.30 (ideally by Monday) so this can go in this month. |
jhenstridge
added some commits
Dec 7, 2017
|
The test failures are related: |
|
I'm not exactly sure why the For the |
|
@jhenstridge - thanks! Can you fix up the conflict? |
jhenstridge
added some commits
Dec 13, 2017
pedronis
added
the
Blocked
label
Dec 15, 2017
|
what would happen to snap on 14.04 that needs the interface? it can it be made compatible with the old service? |
|
@pedronis - that is a great observation. In terms of snapd security policy, I suspect there would be no denials since this policy is sufficiently broad. However your question is very interesting because snapd interfaces are contracts between the slot side and the plugs side. With implicit classic interfaces, the slot side is whatever happens to be running on classic so 14.04 classic distro isn't in a good position to honor the slot side of the contract with series 16 snaps, particularly with fast-moving software like GNOME. Your observation is not limited to gnome-online-accounts, but to really any of the implicit classic interfaces (of course, 14.04 will be able to honor many of them; DBus APIs would be the most problematic). This was definitely brought up in other contexts-- eg, there is no guarantee that a series 16 snap can work with whatever NetworkManager happens to be running on an arbitrary classic distro. |
|
So if I understand it right, this interface should be no different to any other "implicit on classic" interface that grants access to a D-Bus service (e.g. NetworkManager). If we're not making API guarantees for those interfaces, is it actually a problem for this interface? |
|
@jhenstridge - my comments were not meant to be construed as a blocker but to acknowledge the difficulties with implicit interfaces. My approval for this PR remains. |
jhenstridge commentedNov 3, 2017
Add an interface exposing the GNOME online accounts system, which provides access to accounts configured through the control center. I've added this as a new
gnome-online-accounts-serviceinterface because:the underlying D-Bus service is not designed with confinement in mind: at the AppArmor level, we either expose everything or nothing. So it doesn't make sense to expose this by default through
desktop.the existing
online-accounts-serviceinterface covers the Ubuntu Online Accounts version 2 API designed for the phone. This service was designed with confinement in mind, so the interface was a candidate for wide auto connection.So I've put this in its own interface for now. Let me know if you want these rules moved elsewhere.
To test, I've put together this small snap containing the "list-accounts" example program from gnome-online-accounts:
http://people.canonical.com/~jamesh/goa-test_0.1_amd64.snap
With the interface disconnected,
goa-test.list-accountssegfaults. After runningsnap connect goa-test:gnome-online-accounts-service, it should be able to enumerate the registered accounts.