Merge lp:~jamesh/storage-framework/fix-fake-oa into lp:storage-framework/devel

Proposed by James Henstridge
Status: Merged
Approved by: Michi Henning
Approved revision: 94
Merged at revision: 93
Proposed branch: lp:~jamesh/storage-framework/fix-fake-oa
Merge into: lp:storage-framework/devel
Diff against target: 194 lines (+2/-159)
2 files modified
tests/utils/com.ubuntu.OnlineAccounts.Manager.xml (+0/-153)
tests/utils/fake-online-accounts-daemon.py (+2/-6)
To merge this branch: bzr merge lp:~jamesh/storage-framework/fix-fake-oa
Reviewer Review Type Date Requested Status
unity-api-1-bot continuous-integration Approve
Michi Henning (community) Approve
Review via email: mp+310962@code.launchpad.net

Commit message

Update fake-online-accounts-daemon.py to work with online-accounts-api 0.1+17.04.20161110-0ubuntu1

Description of the change

Update fake-online-accounts-daemon.py to work with online-accounts-api 0.1+17.04.20161110-0ubuntu1

To post a comment you must log in.
94. By James Henstridge

Remove copy of online accounts introspection XML.

Revision history for this message
Michi Henning (michihenning) wrote :

Looks good, thanks!

review: Approve
Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

PASSED: Continuous integration, rev:93
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/202/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build/1083
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/1090
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/880
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/880/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/880
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=zesty/880/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/880
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/880/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/880
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=zesty/880/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/880
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/880/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/880
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=zesty/880/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-storage-framework-ci/202/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== removed file 'tests/utils/com.ubuntu.OnlineAccounts.Manager.xml'
--- tests/utils/com.ubuntu.OnlineAccounts.Manager.xml 2016-07-12 02:25:26 +0000
+++ tests/utils/com.ubuntu.OnlineAccounts.Manager.xml 1970-01-01 00:00:00 +0000
@@ -1,153 +0,0 @@
1<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
2"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
3
4<node name="/com/ubuntu/OnlineAccounts/Manager">
5 <interface name="com.ubuntu.OnlineAccounts.Manager">
6
7 <!--
8 Global concepts:
9
10 Clients are identified by their "applicationId", which is the
11 "<package>_<app>" of the client.
12
13 The "serviceId" is an application-specific name for an account provider.
14 That is, the "serviceId" contains the information about the application
15 which will use it, and the account provider (e.g. "google", "facebook").
16 "serviceId"s are backed by files shipped with the application, which can
17 contain application/account-provider specific information, such as the
18 ClientId and ClientSecret to be used when authentication with OAuth 2.0.
19 An application can ship more than one "serviceId", if they refer to
20 different account providers; that is, one application can have a
21 serviceId for Google and one for Facebook, but the same application
22 cannot have one for GMail and another for Picasa.
23 -->
24
25 <!--
26 GetAccounts: returns a list of account IDs that satisfy the given
27 filters.
28
29 Allowed keys for the "filters" parameter (any combination is allowed,
30 though not all combinations might make sense):
31
32 - "applicationId" ("s"): the "<package>_<app>" of the client. An
33 unconfined application can specify this in order to restrict the set
34 of results to only those accounts that the application has been
35 authorized to use. For confined apps, OA will deduce the
36 applicationId from the apparmor label of the caller.
37
38 - "serviceId" ("s"): if the application wants to list only those
39 accounts coming from a specific provider (e.g., "Facebook").
40
41 - "accountId" ("u"): the ID of an account.
42
43 In any case, an application will receive only those accounts which the
44 user has authorized the application to use. See
45 http://wiki.ubuntu.com/OnlineAccounts
46 for an overview of the UI experience.
47
48 Disabled accounts will not be returned.
49 -->
50 <method name="GetAccounts">
51 <arg name="filters" type="a{sv}" direction="in" />
52 <!--
53 The return value is a list of account IDs paired with a dictionary of account data.
54 This will always include:
55 - "serviceId" (s)
56 - "displayName" (s)
57 Other settings stored on the account will also be included, such as the
58 server address and port of an owncloud or IMAP account, but we haven't
59 defined exactly how. Possibly, all account-specific keys will be
60 prefixed by "settings/", in order not to clash with the keys defined at
61 the framework level.
62 -->
63 <arg name="accounts" type="a(ua{sv})" direction="out" />
64 <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/>
65 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0"
66 value="QList&lt;AccountInfo&gt;"/>
67 </method>
68
69 <!--
70 Authenticate: request authentication credentials for the given
71 account ID in the context of a particular service.
72
73 If "interactive" is false, an error will be returned if
74 user interaction would be required to retrieve the
75 credentials.
76
77 If "invalidate" is true, any stored credentials will be
78 ignored and new credentials will be requested from the account
79 provider.
80 -->
81 <method name="Authenticate">
82 <arg name="accountId" type="u" direction="in" />
83 <arg name="serviceId" type="s" direction="in" />
84 <arg name="interactive" type="b" direction="in" />
85 <arg name="invalidate" type="b" direction="in" />
86 <!--
87 This dictionary can be used to specify OAuth client keys or permission
88 scopes. While it's possible to statically define them a the "serviceId"
89 level, some apps might want to change this information at runtime.
90 Possible use cases:
91 1) OAuth keys are retrieved from a server (so that they can be updated
92 when the old ones are revoked).
93 2) An app might want to use different keys when talking to GMail and
94 Picasa.
95 3) The scope list can also be dynamic, and depending on how the user is
96 using the app.
97 4) SASL: the parameters would contain the latest challenge got from the
98 server.
99 -->
100 <arg name="parameters" type="a{sv}" direction="in" />
101 <arg name="credentials" type="a{sv}" direction="out" />
102 <annotation name="org.qtproject.QtDBus.QtTypeName.In4" value="QVariantMap"/>
103 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/>
104 </method>
105
106 <!--
107 RequestAccess: register a new account for use with the given
108 service.
109 This method also performs the authentication, since that's what apps
110 would do as soon as they get the account.
111 -->
112 <method name="RequestAccess">
113 <arg name="serviceId" type="s" direction="in" />
114 <arg name="parameters" type="a{sv}" direction="in" />
115 <arg name="account" type="(ua{sv})" direction="out" />
116 <arg name="credentials" type="a{sv}" direction="out" />
117 <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
118 <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="AccountInfo"/>
119 <annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/>
120 </method>
121
122 <!--
123 AccountChanged: emitted when account details are changed.
124
125 The apparmor policy will NOT ALLOW confined applications to receive
126 this signal on the account manager object path (which might be
127 /com/ubuntu/OnlineAccounts/Manager). Only unconfined applications will
128 be able to listen to this signal from that object path.
129
130 Confined apps will have to catch this signal from a different object path:
131 /com/ubuntu/OnlineAccounts/Manager/@{APP_PKGNAME_DBUS}, which will
132 deliver the signal only for those accounts which the app has been
133 authorized to use.
134 -->
135 <signal name="AccountChanged">
136 <!--
137 The serviceId will also be included in the "account" dictionary. The
138 reason for having it also here is to allow clients to filter D-Bus
139 messages by arg0. This can be important for unconfined clients, which
140 would otherwise be woken up by any account change, even those not
141 relevant to them.
142 -->
143 <arg name="serviceId" type="s" />
144 <!--
145 The dictionary contains a changeType key, type "u", whose value is
146 enum { enabled, disabled, changed }
147 -->
148 <arg name="account" type="(ua{sv})" />
149 <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="AccountInfo"/>
150 </signal>
151
152 </interface>
153</node>
1540
=== modified file 'tests/utils/fake-online-accounts-daemon.py'
--- tests/utils/fake-online-accounts-daemon.py 2016-11-01 03:36:29 +0000
+++ tests/utils/fake-online-accounts-daemon.py 2016-11-16 06:09:36 +0000
@@ -17,7 +17,6 @@
1717
18"""A fake version of the OnlineAccounts D-Bus service."""18"""A fake version of the OnlineAccounts D-Bus service."""
1919
20import os
21import sys20import sys
2221
23import dbus.service22import dbus.service
@@ -28,9 +27,6 @@
28OBJECT_PATH = "/com/ubuntu/OnlineAccounts/Manager"27OBJECT_PATH = "/com/ubuntu/OnlineAccounts/Manager"
29OA_IFACE = "com.ubuntu.OnlineAccounts.Manager"28OA_IFACE = "com.ubuntu.OnlineAccounts.Manager"
3029
31INTERFACE_XML = os.path.join(os.path.dirname(__file__),
32 "com.ubuntu.OnlineAccounts.Manager.xml")
33
34AUTH_OAUTH1 = 130AUTH_OAUTH1 = 1
35AUTH_OAUTH2 = 231AUTH_OAUTH2 = 2
36AUTH_PASSWORD = 332AUTH_PASSWORD = 3
@@ -114,12 +110,12 @@
114 self.accounts = accounts110 self.accounts = accounts
115111
116 @dbus.service.method(dbus_interface=OA_IFACE,112 @dbus.service.method(dbus_interface=OA_IFACE,
117 in_signature="a{sv}", out_signature="a(ua{sv})")113 in_signature="a{sv}", out_signature="a(ua{sv})aa{sv}")
118 def GetAccounts(self, filters):114 def GetAccounts(self, filters):
119 #print("GetAccounts %r" % filters)115 #print("GetAccounts %r" % filters)
120 sys.stdout.flush()116 sys.stdout.flush()
121 return dbus.Array([a.serialise() for a in self.accounts],117 return dbus.Array([a.serialise() for a in self.accounts],
122 signature="a(ua{sv})")118 signature="a(ua{sv})"), dbus.Array(signature="a{sv}")
123119
124 @dbus.service.method(dbus_interface=OA_IFACE,120 @dbus.service.method(dbus_interface=OA_IFACE,
125 in_signature="usbba{sv}", out_signature="a{sv}")121 in_signature="usbba{sv}", out_signature="a{sv}")

Subscribers

People subscribed via source and target branches