After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 723370 - Request cloudprint scope for google provider
Request cloudprint scope for google provider
Status: RESOLVED FIXED
Product: gnome-online-accounts
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME Online Accounts maintainer(s)
GNOME Online Accounts maintainer(s)
: 726374 (view as bug list)
Depends on:
Blocks: 723368
 
 
Reported: 2014-01-31 14:52 UTC by Tim Waugh
Modified: 2014-03-15 07:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch which adds the right scope (949 bytes, patch)
2014-01-31 14:52 UTC, Tim Waugh
needs-work Details | Review
gnome-online-accounts-cloudprint.patch (7.28 KB, patch)
2014-01-31 17:56 UTC, Tim Waugh
reviewed Details | Review
patch with fixes from comments (8.45 KB, patch)
2014-02-03 17:02 UTC, Tim Waugh
reviewed Details | Review
Added Printers capability and use it in google backend (7.82 KB, patch)
2014-02-03 17:31 UTC, Debarshi Ray
committed Details | Review

Description Tim Waugh 2014-01-31 14:52:09 UTC
The cloudprint GTK+ print module described in bug #723368 depends on an addition scope being requested by the google goa provider.
Comment 1 Tim Waugh 2014-01-31 14:52:59 UTC
Created attachment 267735 [details] [review]
patch which adds the right scope
Comment 2 Bastien Nocera 2014-01-31 15:26:18 UTC
Review of attachment 267735 [details] [review]:

As with the patch in https://bugzilla.gnome.org/show_bug.cgi?id=723091 you should also add a new capability, so that printing can be toggled off.
Comment 3 Debarshi Ray 2014-01-31 15:55:26 UTC
Review of attachment 267735 [details] [review]:

This is really cool! I am worried about one thing, though. If gtk+ depends on gnome-online-accounts, which already depends on gtk+, won't it create a circular dependency?

Apart from what Bastien said ...

::: src/goabackend/goagoogleprovider.c
@@ +147,1 @@
          /* Google Talk */

Also, bump the credentials generation so that OAuth 2.0 tokens obtained with the old set of scopes are refreshed with the new set.
Comment 4 Tim Waugh 2014-01-31 17:56:50 UTC
Created attachment 267746 [details] [review]
gnome-online-accounts-cloudprint.patch

Is this better?

As an aside:
Now that I look closer at gnome-online-accounts, it looks like it would be possible to move the actual code that enumerates printers, gets printer details, and submits print jobs into the goa provider.

That sort of chimes with some thoughts I've been having about how to unify different types of "cloud printing":
http://cyberelk.net/tim/2012/03/08/session-printing/
Comment 5 Debarshi Ray 2014-02-03 15:20:30 UTC
Review of attachment 267746 [details] [review]:

Thanks for the patch. This looks good apart from some minor issues.

::: data/dbus-interfaces.xml
@@ +166,3 @@
     <property name="DocumentsDisabled" type="b" access="readwrite"/>
 
+    <!-- PrintersDisabled:

@since: 3.12.0

@@ +672,3 @@
 
+  <!--
+      org.gnome.OnlineAccounts.Printers:

@since: 3.12.0

::: src/goabackend/goagoogleprovider.c
@@ +144,3 @@
 
+	 /* Google Cloud Print */
+	 "https://www.googleapis.com/auth/cloudprint "

Where is this scope documented? I tried looking at various places under https://developers.google.com/cloud-print/docs/overview but could not find it.

Could you please add the URL where the scope is documented to README? We deal with quite a large number of providers and services and it helps to have the relevant URLs at hand.
Comment 6 Debarshi Ray 2014-02-03 15:33:43 UTC
(In reply to comment #4)
> As an aside:
> Now that I look closer at gnome-online-accounts, it looks like it would be
> possible to move the actual code that enumerates printers, gets printer
> details, and submits print jobs into the goa provider.

It would be possible but I do not want to do that. I do not want to have lots of "domain-specific" code in GOA. eg., it is also tempting have full blown IMAP and SMTP support in GOA so that MUAs do not need to have their own.

I want to limit GOA to being a "dumb" account store, that exports just enough information that:
 - a user would have to otherwise manually enter into an application
 - is needed to uniquely identify an account

eg., the username, provider branding, email server address:port, WebDAV URLs, etc..

... leaving the "domain-specific" stuff to the particular libraries and applications. eg., libgdata implements a bunch of the Google APIs and you can optionally use GOA with it, similarly libzapojit for Windows Live, evolution/e-d-s for mail/calendaring/contacts, gvfs for WebDAV, and now gtk+ for printing.
Comment 7 Tim Waugh 2014-02-03 17:02:17 UTC
Created attachment 267969 [details] [review]
patch with fixes from comments

Yes, OK.

Here's a patch with the suggested improvements.
Comment 8 Tim Waugh 2014-02-03 17:06:36 UTC
Actually this feature is aimed at 3.11 so I guess it should read "@since: 3.11.0"...
(https://wiki.gnome.org/ThreePointEleven/Features/CloudPrinting)
Comment 9 Bastien Nocera 2014-02-03 17:09:12 UTC
(In reply to comment #8)
> Actually this feature is aimed at 3.11 so I guess it should read "@since:
> 3.11.0"...
> (https://wiki.gnome.org/ThreePointEleven/Features/CloudPrinting)

"Since" means "First stable version containing the API". Not when it appeared in devel versions.
Comment 10 Tim Waugh 2014-02-03 17:10:23 UTC
Thanks, got it.
Comment 11 Debarshi Ray 2014-02-03 17:29:46 UTC
Review of attachment 267746 [details] [review]:

::: src/goabackend/goagoogleprovider.c
@@ +477,3 @@
+        {
+          printers = goa_printers_skeleton_new ();
+          goa_object_skeleton_set_documents (object, printers);

Typo alert! Should be goa_object_skeleton_set_printers, and not _set_documents.
Comment 12 Debarshi Ray 2014-02-03 17:30:24 UTC
Review of attachment 267969 [details] [review]:

Looks good, apart from the minor typo that I forgot to point out before.
Comment 13 Debarshi Ray 2014-02-03 17:31:12 UTC
Created attachment 267976 [details] [review]
Added Printers capability and use it in google backend

Fixed the typo.
Comment 14 Debarshi Ray 2014-02-03 17:31:43 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Comment 15 Debarshi Ray 2014-03-15 07:44:11 UTC
*** Bug 726374 has been marked as a duplicate of this bug. ***