Merge lp:~mardy/online-accounts-api/dbus-api into lp:online-accounts-api
- dbus-api
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~mardy/online-accounts-api/dbus-api |
Merge into: | lp:online-accounts-api |
Diff against target: |
481 lines (+157/-158) 6 files modified
src/daemon/aacontext.cpp (+31/-26) src/daemon/aacontext.h (+2/-2) src/daemon/main.cpp (+2/-1) src/daemon/manager.cpp (+77/-64) src/daemon/manager.h (+26/-22) src/daemon/manager.xml (+19/-43) |
To merge this branch: | bzr merge lp:~mardy/online-accounts-api/dbus-api |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
James Henstridge | Needs Fixing | ||
Review via email: mp+249089@code.launchpad.net |
This proposal has been superseded by a proposal from 2015-02-11.
Commit message
Update D-Bus API, fix warnings
Description of the change
Update D-Bus API, fix warnings
Alberto Mardegan (mardy) wrote : | # |
> Many of these changes seem to be things that we disagreed about in the meeting
> previously. I have also been working on updating the interface as we
> discussed at that meeting, so can we hold off on this?
I'm proposing this exactly in order to discuss about the disagreements. :-)
Keep in mind that what we currently have in trunk has not been agreed upon either. Anyway, I won't merge this until we've got a consensus, or until we come to the conclusion that a consensus cannot be reached.
On the other hand, defining this interface is our top priority, because all the client side will be blocked until we settle this.
- 5. By Alberto Mardegan
-
Update
Alberto Mardegan (mardy) wrote : | # |
I just pushed a new commit, taking your comments into account. I also replied to them, but in order to see my replies you'll have to select the "r4 into r3" diff into the "Preview Diff" selection box below.
James Henstridge (jamesh) wrote : | # |
Replies to r4 comments.
James Henstridge (jamesh) wrote : | # |
Now for r5:
As a general question, what style guide are you trying to convert this code to conform to exactly? I'd really appreciate it if you didn't mix these kinds of code clean ups in with functional changes: all it does is obscure what you're changing.
- 6. By Alberto Mardegan
-
merge from style
- 7. By Alberto Mardegan
-
Update
- 8. By Alberto Mardegan
-
style
- 9. By Alberto Mardegan
-
merge style
- 10. By Alberto Mardegan
-
from trunk
- 11. By Alberto Mardegan
-
Update docstring
Unmerged revisions
Preview Diff
1 | === modified file 'src/daemon/aacontext.cpp' | |||
2 | --- src/daemon/aacontext.cpp 2015-02-10 08:12:59 +0000 | |||
3 | +++ src/daemon/aacontext.cpp 2015-02-10 16:00:33 +0000 | |||
4 | @@ -1,47 +1,52 @@ | |||
5 | 1 | #include <QDBusConnection> | ||
6 | 2 | #include <QDBusMessage> | ||
7 | 3 | #include <QDebug> | ||
8 | 1 | #include "aacontext.h" | 4 | #include "aacontext.h" |
9 | 2 | #include <stdexcept> | ||
10 | 3 | #include <sys/apparmor.h> | 5 | #include <sys/apparmor.h> |
24 | 4 | #include <QDebug> | 6 | |
25 | 5 | #include <QDBusConnection> | 7 | const int maxCacheSize = 50; |
26 | 6 | #include <QDBusMessage> | 8 | |
27 | 7 | 9 | AppArmorContext::AppArmorContext() | |
28 | 8 | const int max_cache_size = 50; | 10 | { |
29 | 9 | 11 | } | |
30 | 10 | AppArmorContext::AppArmorContext() { | 12 | |
31 | 11 | } | 13 | AppArmorContext::~AppArmorContext() |
32 | 12 | 14 | { | |
33 | 13 | AppArmorContext::~AppArmorContext() { | 15 | } |
34 | 14 | } | 16 | |
35 | 15 | 17 | QString AppArmorContext::getPeerSecurityContext(const QDBusConnection &bus, | |
36 | 16 | QString AppArmorContext::getPeerSecurityContext(const QDBusConnection &bus, const QDBusMessage &message) { | 18 | const QDBusMessage &message) |
37 | 19 | { | ||
38 | 17 | if (!aa_is_enabled()) { | 20 | if (!aa_is_enabled()) { |
39 | 18 | return "unconfined"; | 21 | return "unconfined"; |
40 | 19 | } | 22 | } |
41 | 20 | 23 | ||
42 | 21 | QString peer_address = message.service(); | 24 | QString peer_address = message.service(); |
46 | 22 | try { | 25 | QString &context = m_contexts[peer_address]; |
47 | 23 | return contexts.at(peer_address); | 26 | /* If the peer_address was now known, it's now been added as an empty |
48 | 24 | } catch (const std::out_of_range &e) { | 27 | * QString. */ |
49 | 28 | if (!context.isEmpty()) { | ||
50 | 29 | return context; | ||
51 | 25 | } | 30 | } |
52 | 26 | 31 | ||
56 | 27 | QDBusMessage msg = QDBusMessage::createMethodCall( | 32 | QDBusMessage msg = |
57 | 28 | "org.freedesktop.DBus", "/org/freedesktop/DBus", | 33 | QDBusMessage::createMethodCall("org.freedesktop.DBus", |
58 | 29 | "org.freedesktop.DBus", "GetConnectionAppArmorSecurityContext"); | 34 | "/org/freedesktop/DBus", |
59 | 35 | "org.freedesktop.DBus", | ||
60 | 36 | "GetConnectionAppArmorSecurityContext"); | ||
61 | 30 | msg << peer_address; | 37 | msg << peer_address; |
62 | 31 | QDBusMessage reply = bus.call(msg, QDBus::Block); | 38 | QDBusMessage reply = bus.call(msg, QDBus::Block); |
63 | 32 | 39 | ||
64 | 33 | QString context; | ||
65 | 34 | if (reply.type() == QDBusMessage::ReplyMessage) { | 40 | if (reply.type() == QDBusMessage::ReplyMessage) { |
66 | 35 | context = reply.arguments().value(0).value<QString>(); | 41 | context = reply.arguments().value(0).value<QString>(); |
67 | 36 | } else { | 42 | } else { |
70 | 37 | qWarning() << "Could not determine AppArmor context: " | 43 | qWarning() << "Could not determine AppArmor context: " << |
71 | 38 | << reply.errorName() << ": " << reply.errorMessage(); | 44 | reply.errorName() << ": " << reply.errorMessage(); |
72 | 39 | } | 45 | } |
73 | 40 | 46 | ||
74 | 41 | // If the context cache has hit the maximum size, clear it | 47 | // If the context cache has hit the maximum size, clear it |
77 | 42 | if (contexts.size() >= max_cache_size) { | 48 | if (m_contexts.size() >= maxCacheSize) { |
78 | 43 | contexts.clear(); | 49 | m_contexts.clear(); |
79 | 44 | } | 50 | } |
80 | 45 | contexts[peer_address] = context; | ||
81 | 46 | return context; | 51 | return context; |
82 | 47 | } | 52 | } |
83 | 48 | 53 | ||
84 | === modified file 'src/daemon/aacontext.h' | |||
85 | --- src/daemon/aacontext.h 2015-02-09 05:18:22 +0000 | |||
86 | +++ src/daemon/aacontext.h 2015-02-10 16:00:33 +0000 | |||
87 | @@ -1,9 +1,9 @@ | |||
88 | 1 | #ifndef AACONTEXT_H | 1 | #ifndef AACONTEXT_H |
89 | 2 | #define AACONTEXT_H | 2 | #define AACONTEXT_H |
90 | 3 | 3 | ||
91 | 4 | #include <map> | ||
92 | 5 | #include <QDBusConnection> | 4 | #include <QDBusConnection> |
93 | 6 | #include <QDBusMessage> | 5 | #include <QDBusMessage> |
94 | 6 | #include <QHash> | ||
95 | 7 | #include <QString> | 7 | #include <QString> |
96 | 8 | 8 | ||
97 | 9 | class AppArmorContext { | 9 | class AppArmorContext { |
98 | @@ -14,7 +14,7 @@ | |||
99 | 14 | QString getPeerSecurityContext(const QDBusConnection &bus, const QDBusMessage &message); | 14 | QString getPeerSecurityContext(const QDBusConnection &bus, const QDBusMessage &message); |
100 | 15 | 15 | ||
101 | 16 | private: | 16 | private: |
103 | 17 | std::map<QString,QString> contexts; | 17 | QHash<QString,QString> m_contexts; |
104 | 18 | }; | 18 | }; |
105 | 19 | 19 | ||
106 | 20 | #endif | 20 | #endif |
107 | 21 | 21 | ||
108 | === modified file 'src/daemon/main.cpp' | |||
109 | --- src/daemon/main.cpp 2015-02-10 06:24:38 +0000 | |||
110 | +++ src/daemon/main.cpp 2015-02-10 16:00:33 +0000 | |||
111 | @@ -1,7 +1,8 @@ | |||
112 | 1 | #include "manager.h" | 1 | #include "manager.h" |
113 | 2 | #include "manageradaptor.h" | 2 | #include "manageradaptor.h" |
114 | 3 | 3 | ||
116 | 4 | int main(int argc, char **argv) { | 4 | int main(int argc, char **argv) |
117 | 5 | { | ||
118 | 5 | QCoreApplication app(argc, argv); | 6 | QCoreApplication app(argc, argv); |
119 | 6 | 7 | ||
120 | 7 | qDBusRegisterMetaType<AccountInfo>(); | 8 | qDBusRegisterMetaType<AccountInfo>(); |
121 | 8 | 9 | ||
122 | === modified file 'src/daemon/manager.cpp' | |||
123 | --- src/daemon/manager.cpp 2015-02-10 06:24:38 +0000 | |||
124 | +++ src/daemon/manager.cpp 2015-02-10 16:00:33 +0000 | |||
125 | @@ -1,40 +1,48 @@ | |||
127 | 1 | #include "manager.h" | 1 | #include <QDBusMessage> |
128 | 2 | #include <QDebug> | 2 | #include <QDebug> |
129 | 3 | #include <QDBusMessage> | ||
130 | 4 | #include "aacontext.h" | 3 | #include "aacontext.h" |
133 | 5 | 4 | #include "manager.h" | |
132 | 6 | using namespace std; | ||
134 | 7 | 5 | ||
135 | 8 | static const char FORBIDDEN_ERROR[] = "com.ubuntu.OnlineAccounts.Error.Forbidden"; | 6 | static const char FORBIDDEN_ERROR[] = "com.ubuntu.OnlineAccounts.Error.Forbidden"; |
136 | 9 | 7 | ||
154 | 10 | QDBusArgument &operator<<(QDBusArgument &argument, const AccountInfo &info) { | 8 | QDBusArgument &operator<<(QDBusArgument &argument, const AccountInfo &info) |
155 | 11 | argument.beginStructure(); | 9 | { |
156 | 12 | argument << info.account_id << info.details; | 10 | argument.beginStructure(); |
157 | 13 | argument.endStructure(); | 11 | argument << info.accountId << info.details; |
158 | 14 | return argument; | 12 | argument.endStructure(); |
159 | 15 | } | 13 | return argument; |
160 | 16 | 14 | } | |
161 | 17 | const QDBusArgument &operator>>(const QDBusArgument &argument, AccountInfo &info) { | 15 | |
162 | 18 | argument.beginStructure(); | 16 | const QDBusArgument &operator>>(const QDBusArgument &argument, |
163 | 19 | argument >> info.account_id >> info.details; | 17 | AccountInfo &info) |
164 | 20 | argument.endStructure(); | 18 | { |
165 | 21 | return argument; | 19 | argument.beginStructure(); |
166 | 22 | } | 20 | argument >> info.accountId >> info.details; |
167 | 23 | 21 | argument.endStructure(); | |
168 | 24 | 22 | return argument; | |
169 | 25 | struct Manager::Private { | 23 | } |
170 | 26 | AppArmorContext apparmor; | 24 | |
171 | 25 | class ManagerPrivate { | ||
172 | 26 | public: | ||
173 | 27 | AppArmorContext m_apparmor; | ||
174 | 27 | }; | 28 | }; |
175 | 28 | 29 | ||
185 | 29 | Manager::Manager(QObject *parent) | 30 | Manager::Manager(QObject *parent): |
186 | 30 | : QObject(parent), p(new Private) { | 31 | QObject(parent), |
187 | 31 | } | 32 | d_ptr(new ManagerPrivate) |
188 | 32 | 33 | { | |
189 | 33 | Manager::~Manager() { | 34 | } |
190 | 34 | } | 35 | |
191 | 35 | 36 | Manager::~Manager() | |
192 | 36 | bool Manager::canAccess(const QString &service_id) { | 37 | { |
193 | 37 | QString context = p->apparmor.getPeerSecurityContext(connection(), message()); | 38 | } |
194 | 39 | |||
195 | 40 | bool Manager::canAccess(const QString &serviceId) | ||
196 | 41 | { | ||
197 | 42 | Q_D(Manager); | ||
198 | 43 | |||
199 | 44 | QString context = d->m_apparmor.getPeerSecurityContext(connection(), | ||
200 | 45 | message()); | ||
201 | 38 | // Could not determine peer's AppArmor context, so deny access | 46 | // Could not determine peer's AppArmor context, so deny access |
202 | 39 | if (context.isEmpty()) { | 47 | if (context.isEmpty()) { |
203 | 40 | return false; | 48 | return false; |
204 | @@ -55,51 +63,56 @@ | |||
205 | 55 | // Do the same on the service ID: we are only dealing with | 63 | // Do the same on the service ID: we are only dealing with |
206 | 56 | // confined apps at this point, so only $pkgname prefixed | 64 | // confined apps at this point, so only $pkgname prefixed |
207 | 57 | // services are accessible. | 65 | // services are accessible. |
209 | 58 | pos = service_id.indexOf('_'); | 66 | pos = serviceId.indexOf('_'); |
210 | 59 | if (pos < 0) { | 67 | if (pos < 0) { |
211 | 60 | return false; | 68 | return false; |
212 | 61 | } | 69 | } |
244 | 62 | return service_id.left(pos) == pkgname; | 70 | return serviceId.left(pos) == pkgname; |
245 | 63 | } | 71 | } |
246 | 64 | 72 | ||
247 | 65 | bool Manager::checkAccess(const QString &service_id) { | 73 | bool Manager::checkAccess(const QString &serviceId) |
248 | 66 | bool has_access = canAccess(service_id); | 74 | { |
249 | 67 | if (!has_access) { | 75 | bool hasAccess = canAccess(serviceId); |
250 | 68 | sendErrorReply(FORBIDDEN_ERROR, QString("Access to service ID %1 forbidden").arg(service_id)); | 76 | if (!hasAccess) { |
251 | 69 | } | 77 | sendErrorReply(FORBIDDEN_ERROR, |
252 | 70 | return has_access; | 78 | QString("Access to service ID %1 forbidden").arg(serviceId)); |
253 | 71 | } | 79 | } |
254 | 72 | 80 | return hasAccess; | |
255 | 73 | QList<AccountInfo> Manager::GetAccounts(const QStringList &service_ids) { | 81 | } |
256 | 74 | for (const auto &service_id : service_ids) { | 82 | |
257 | 75 | if (!checkAccess(service_id)) { | 83 | QList<AccountInfo> Manager::GetAccounts(const QVariantMap &filters) |
258 | 76 | return QList<AccountInfo>(); | 84 | { |
259 | 77 | } | 85 | Q_UNUSED(filters); |
260 | 78 | } | 86 | |
261 | 79 | 87 | return QList<AccountInfo>(); | |
262 | 80 | return QList<AccountInfo>({AccountInfo(0, QVariantMap())}); | 88 | } |
263 | 81 | } | 89 | |
264 | 82 | 90 | QVariantMap Manager::Authenticate(quint32 accountId, const QString &serviceId, | |
265 | 83 | AccountInfo Manager::GetAccountInfo(const QString &service_id, uint account_id) { | 91 | bool interactive, bool invalidate, |
266 | 84 | if (!checkAccess(service_id)) { | 92 | const QVariantMap ¶meters) |
267 | 85 | return AccountInfo(); | 93 | { |
268 | 86 | } | 94 | Q_UNUSED(accountId); |
269 | 87 | 95 | Q_UNUSED(interactive); | |
270 | 88 | return AccountInfo(account_id, QVariantMap()); | 96 | Q_UNUSED(invalidate); |
271 | 89 | } | 97 | Q_UNUSED(parameters); |
272 | 90 | 98 | ||
273 | 91 | QVariantMap Manager::Authenticate(const QString &service_id, uint account_id, bool interactive, bool invalidate) { | 99 | if (!checkAccess(serviceId)) { |
243 | 92 | if (!checkAccess(service_id)) { | ||
274 | 93 | return QVariantMap(); | 100 | return QVariantMap(); |
275 | 94 | } | 101 | } |
276 | 95 | 102 | ||
277 | 96 | return QVariantMap(); | 103 | return QVariantMap(); |
278 | 97 | } | 104 | } |
279 | 98 | 105 | ||
282 | 99 | AccountInfo Manager::Register(const QString &service_id, QVariantMap &credentials) { | 106 | AccountInfo Manager::RequestAccess(const QString &serviceId, |
283 | 100 | if (!checkAccess(service_id)) { | 107 | const QVariantMap ¶meters, |
284 | 108 | QVariantMap &credentials) | ||
285 | 109 | { | ||
286 | 110 | Q_UNUSED(parameters); | ||
287 | 111 | |||
288 | 112 | if (!checkAccess(serviceId)) { | ||
289 | 101 | return AccountInfo(); | 113 | return AccountInfo(); |
290 | 102 | } | 114 | } |
291 | 103 | 115 | ||
292 | 116 | credentials = QVariantMap(); | ||
293 | 104 | return AccountInfo(); | 117 | return AccountInfo(); |
294 | 105 | } | 118 | } |
295 | 106 | 119 | ||
296 | === modified file 'src/daemon/manager.h' | |||
297 | --- src/daemon/manager.h 2015-02-10 06:24:38 +0000 | |||
298 | +++ src/daemon/manager.h 2015-02-10 16:00:33 +0000 | |||
299 | @@ -1,50 +1,54 @@ | |||
300 | 1 | |||
301 | 2 | #ifndef MANAGER_H | 1 | #ifndef MANAGER_H |
302 | 3 | #define MANAGER_H | 2 | #define MANAGER_H |
303 | 4 | 3 | ||
305 | 5 | #include <memory> | 4 | #include <QDBusArgument> |
306 | 5 | #include <QDBusContext> | ||
307 | 6 | #include <QList> | 6 | #include <QList> |
308 | 7 | #include <QObject> | 7 | #include <QObject> |
309 | 8 | #include <QVariantMap> | 8 | #include <QVariantMap> |
310 | 9 | #include <QDBusArgument> | ||
311 | 10 | #include <QDBusContext> | ||
312 | 11 | 9 | ||
313 | 12 | struct AccountInfo { | 10 | struct AccountInfo { |
315 | 13 | uint account_id = 0; | 11 | quint32 accountId; |
316 | 14 | QVariantMap details; | 12 | QVariantMap details; |
317 | 15 | 13 | ||
322 | 16 | AccountInfo() {} | 14 | AccountInfo(): accountId(0) {} |
323 | 17 | AccountInfo(uint account_id, const QVariantMap &details) | 15 | AccountInfo(uint accountId, const QVariantMap &details): |
324 | 18 | : account_id(account_id), details(details) {} | 16 | accountId(accountId), details(details) {} |
321 | 19 | |||
325 | 20 | }; | 17 | }; |
326 | 21 | Q_DECLARE_METATYPE(AccountInfo) | 18 | Q_DECLARE_METATYPE(AccountInfo) |
327 | 22 | 19 | ||
328 | 23 | QDBusArgument &operator<<(QDBusArgument &argument, const AccountInfo &info); | 20 | QDBusArgument &operator<<(QDBusArgument &argument, const AccountInfo &info); |
330 | 24 | const QDBusArgument &operator>>(const QDBusArgument &argument, AccountInfo &info); | 21 | const QDBusArgument &operator>>(const QDBusArgument &argument, |
331 | 22 | AccountInfo &info); | ||
332 | 25 | 23 | ||
334 | 26 | class Manager : public QObject, protected QDBusContext { | 24 | class ManagerPrivate; |
335 | 25 | class Manager: public QObject, protected QDBusContext | ||
336 | 26 | { | ||
337 | 27 | Q_OBJECT | 27 | Q_OBJECT |
339 | 28 | struct Private; | 28 | |
340 | 29 | public: | 29 | public: |
342 | 30 | explicit Manager(QObject *parent=nullptr); | 30 | explicit Manager(QObject *parent = 0); |
343 | 31 | ~Manager(); | 31 | ~Manager(); |
344 | 32 | 32 | ||
345 | 33 | public Q_SLOTS: | 33 | public Q_SLOTS: |
350 | 34 | QList<AccountInfo> GetAccounts(const QStringList &service_ids); | 34 | QList<AccountInfo> GetAccounts(const QVariantMap &filters); |
351 | 35 | AccountInfo GetAccountInfo(const QString &service_id, uint account_id); | 35 | QVariantMap Authenticate(quint32 accountId, const QString &serviceId, |
352 | 36 | QVariantMap Authenticate(const QString &service_id, uint account_id, bool interactive, bool invalidate); | 36 | bool interactive, bool invalidate, |
353 | 37 | AccountInfo Register(const QString &service_id, QVariantMap &credentials); | 37 | const QVariantMap ¶meters); |
354 | 38 | AccountInfo RequestAccess(const QString &serviceId, | ||
355 | 39 | const QVariantMap ¶meters, | ||
356 | 40 | QVariantMap &credentials); | ||
357 | 38 | 41 | ||
358 | 39 | Q_SIGNALS: | 42 | Q_SIGNALS: |
361 | 40 | void AccountChanged(const QString &service_id, uint account_id, bool enabled); | 43 | void AccountChanged(AccountInfo accountInfo); |
360 | 41 | void CredentialsChanged(const QString &service_id, uint account_id); | ||
362 | 42 | 44 | ||
363 | 43 | private: | 45 | private: |
366 | 44 | bool canAccess(const QString &service_id); | 46 | bool canAccess(const QString &serviceId); |
367 | 45 | bool checkAccess(const QString &service_id); | 47 | bool checkAccess(const QString &serviceId); |
368 | 46 | QString getPeerSecurityContext(); | 48 | QString getPeerSecurityContext(); |
370 | 47 | std::unique_ptr<Private> p; | 49 | |
371 | 50 | Q_DECLARE_PRIVATE(Manager) | ||
372 | 51 | ManagerPrivate *d_ptr; | ||
373 | 48 | }; | 52 | }; |
374 | 49 | 53 | ||
375 | 50 | #endif | 54 | #endif |
376 | 51 | 55 | ||
377 | === modified file 'src/daemon/manager.xml' | |||
378 | --- src/daemon/manager.xml 2015-02-10 07:33:36 +0000 | |||
379 | +++ src/daemon/manager.xml 2015-02-10 16:00:33 +0000 | |||
380 | @@ -5,27 +5,18 @@ | |||
381 | 5 | <interface name="com.ubuntu.OnlineAccounts.Manager"> | 5 | <interface name="com.ubuntu.OnlineAccounts.Manager"> |
382 | 6 | 6 | ||
383 | 7 | <!-- | 7 | <!-- |
386 | 8 | GetAccounts: returns a list containing account information for | 8 | GetAccounts: returns a list of account IDs that satisfy the given |
387 | 9 | accounts that provide one of a list of service IDs. | 9 | filters. |
388 | 10 | --> | 10 | --> |
389 | 11 | <method name="GetAccounts"> | 11 | <method name="GetAccounts"> |
391 | 12 | <arg name="service_ids" type="as" direction="in" /> | 12 | <arg name="filters" type="a{sv}" direction="in" /> |
392 | 13 | <arg name="accounts" type="a(ua{sv})" direction="out" /> | 13 | <arg name="accounts" type="a(ua{sv})" direction="out" /> |
393 | 14 | <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/> | ||
394 | 14 | <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" | 15 | <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" |
395 | 15 | value="QList<AccountInfo>"/> | 16 | value="QList<AccountInfo>"/> |
396 | 16 | </method> | 17 | </method> |
397 | 17 | 18 | ||
398 | 18 | <!-- | 19 | <!-- |
399 | 19 | GetAccountInfo: return information about a given account ID | ||
400 | 20 | --> | ||
401 | 21 | <method name="GetAccountInfo"> | ||
402 | 22 | <arg name="service_id" type="s" direction="in" /> | ||
403 | 23 | <arg name="account_id" type="u" direction="in" /> | ||
404 | 24 | <arg name="details" type="(ua{sv})" direction="out" /> | ||
405 | 25 | <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="AccountInfo"/> | ||
406 | 26 | </method> | ||
407 | 27 | |||
408 | 28 | <!-- | ||
409 | 29 | Authenticate: request authentication credentials for the given | 20 | Authenticate: request authentication credentials for the given |
410 | 30 | account ID in the context of a particualr service. | 21 | account ID in the context of a particualr service. |
411 | 31 | 22 | ||
412 | @@ -38,54 +29,39 @@ | |||
413 | 38 | provider. | 29 | provider. |
414 | 39 | --> | 30 | --> |
415 | 40 | <method name="Authenticate"> | 31 | <method name="Authenticate"> |
418 | 41 | <arg name="service_id" type="s" direction="in" /> | 32 | <arg name="accountId" type="u" direction="in" /> |
419 | 42 | <arg name="account_id" type="u" direction="in" /> | 33 | <arg name="serviceId" type="s" direction="in" /> |
420 | 43 | <arg name="interactive" type="b" direction="in" /> | 34 | <arg name="interactive" type="b" direction="in" /> |
421 | 44 | <arg name="invalidate" type="b" direction="in" /> | 35 | <arg name="invalidate" type="b" direction="in" /> |
423 | 45 | <!-- <arg name="reply_socket" type="h" direction="in" /> --> | 36 | <arg name="parameters" type="a{sv}" direction="in" /> |
424 | 46 | <arg name="credentials" type="a{sv}" direction="out" /> | 37 | <arg name="credentials" type="a{sv}" direction="out" /> |
425 | 38 | <annotation name="org.qtproject.QtDBus.QtTypeName.In4" value="QVariantMap"/> | ||
426 | 47 | <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/> | 39 | <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/> |
427 | 48 | </method> | 40 | </method> |
428 | 49 | 41 | ||
429 | 50 | <!-- | 42 | <!-- |
431 | 51 | Register: register a new account for use with the given | 43 | RequestAccess: register a new account for use with the given |
432 | 52 | service. | 44 | service. |
433 | 53 | --> | 45 | --> |
437 | 54 | <method name="Register"> | 46 | <method name="RequestAccess"> |
438 | 55 | <arg name="service_id" type="s" direction="in" /> | 47 | <arg name="serviceId" type="s" direction="in" /> |
439 | 56 | <!-- <arg name="reply_socket" type="h" direction="in" /> --> | 48 | <arg name="parameters" type="a{sv}" direction="in" /> |
440 | 57 | <arg name="account" type="(ua{sv})" direction="out" /> | 49 | <arg name="account" type="(ua{sv})" direction="out" /> |
441 | 50 | <arg name="credentials" type="a{sv}" direction="out" /> | ||
442 | 51 | <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/> | ||
443 | 58 | <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="AccountInfo"/> | 52 | <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="AccountInfo"/> |
444 | 59 | <arg name="credentials" type="a{sv}" direction="out" /> | ||
445 | 60 | <annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/> | 53 | <annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/> |
446 | 61 | </method> | 54 | </method> |
447 | 62 | 55 | ||
448 | 63 | <!-- | 56 | <!-- |
449 | 64 | AccountChanged: emitted when account details are changed. | 57 | AccountChanged: emitted when account details are changed. |
450 | 65 | |||
451 | 66 | This signal will be emitted when new accounts are enabled, and | ||
452 | 67 | when existing accounts are disabled. Clients can detect these | ||
453 | 68 | cases by checking the "enabled" flag and comparing the account | ||
454 | 69 | ID with the list of accounts they currently know about. | ||
455 | 70 | |||
456 | 71 | The actual changed account details can be retrieved with | ||
457 | 72 | GetAccountInfo(). | ||
458 | 73 | --> | 58 | --> |
459 | 74 | <signal name="AccountChanged"> | 59 | <signal name="AccountChanged"> |
474 | 75 | <arg name="service_id" type="s" /> | 60 | <!-- the dictionary ontains a changeType key, type "u", whose value is |
475 | 76 | <arg name="account_id" type="u" /> | 61 | enum { enabled, disabled, changed } |
476 | 77 | <arg name="enabled" type="b" /> | 62 | --> |
477 | 78 | </signal> | 63 | <arg name="account" type="(ua{sv})" /> |
478 | 79 | 64 | <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="AccountInfo"/> | |
465 | 80 | <!-- | ||
466 | 81 | CredentialsChanged: emitted when the credentials for the given | ||
467 | 82 | service ID on the given account change. | ||
468 | 83 | |||
469 | 84 | The new credentials can be retrieved with Authenticate(). | ||
470 | 85 | --> | ||
471 | 86 | <signal name="CredentialsChanged"> | ||
472 | 87 | <arg name="service_id" type="s" /> | ||
473 | 88 | <arg name="account_id" type="u" /> | ||
479 | 89 | </signal> | 65 | </signal> |
480 | 90 | 66 | ||
481 | 91 | </interface> | 67 | </interface> |
Hi Alberto,
Many of these changes seem to be things that we disagreed about in the meeting previously. I have also been working on updating the interface as we discussed at that meeting, so can we hold off on this?
I've left some inline comments in the diff.