treetopllc / goauth2

Automatically exported from code.google.com/p/goauth2
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Client returned by goauth2/appengine/servcieaccount.NewClient has a fixed deadline of 5 seconds #37

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This is an enhancement request:

goauth2/appengine/serviceaccount.NewClient() returns an http.Client containing 
an urlfetch.Transport with the default Deadline of just 5 seconds.
This is not enough when trying to handle large files on Google Cloud Storage. 
(I actually encountered the problem while transfering files  larger than 
approx. 12mb from blobstore to GCS).
Thus it's desirable to have a way of setting the deadline manually.

As property Transport in http.Client is declared as http.RoundTripper there is 
no direct way to change the Deadline Property on the client returned.

Possible solutions:
1. Have an exported method of serviceaccount.transport like SetDeadline(), so 
an interface "SetDeadliner" could be used to access it.
Package serviceaccount could eventually provide the interface as well.

2. Have an alternative Constructor like
NewClientFromTransport(t urlfetch.Transport, scopes ...string)  
This would have the benefit that AllowInvalidServerCertificate could be set by 
the user as well.

Alternatively the default Deadline could be increased in NewClient(), but 
anything below the max allowed request time on appengine will likely be too 
short for somebody at some point.

Original issue reported on code.google.com by holger.k...@gmail.com on 2 Jul 2014 at 6:49

GoogleCodeExporter commented 9 years ago
We're rewriting this package. Could you give github.com/golang/oauth2 a try?

It allows you to create a authenticated Transport with your service account 
credentials, you can initiate any client that fits your needs.

http://godoc.org/github.com/golang/oauth2/google#ComputeEngineConfig.NewTranspor
t

Original comment by j...@google.com on 7 Jul 2014 at 3:54

GoogleCodeExporter commented 9 years ago
Finally switched to the new oauth2 package and love it!
Much better than before, and being able to just use a json key file for 
servcieaccount jwt auth on the dev server is a big plus as well.

Original comment by holger.k...@gmail.com on 6 Sep 2014 at 3:40

GoogleCodeExporter commented 9 years ago

Original comment by a...@golang.org on 8 Sep 2014 at 2:07