palladius / goauth2

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

Cannot set urlfetch.Transport.Deadline on appengine.NewClient() #46

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
If you look at the code:hm 
ttps://code.google.com/p/goauth2/source/browse/appengine/serviceaccount/servicea
ccount.go#45

There is no way to set the Deadline to be anything more than 5 seconds (0 is 5 
seconds by default in GAE).

This is a problem if you are using this client to upload larger files to Cloud 
Storage, as it can take longer than 5 seconds. 

I'm wondering if we should have an implementation of `NewClientWithTransport(c 
appengine.Context, t urlfetech.Transport, scopes ...string) (*http.Client, 
error)`

In which you can pass through a custom urlfetch.Transport, and can control 
aspects such as Deadline etc.

The other option (I can see) is to make serviceaccount.transport public, so you 
can cast to it, and pull out the public Transport property from that type (but 
IMHO the above solution is better) 

Original issue reported on code.google.com by mark.man...@gmail.com on 4 Dec 2014 at 6:29