Example #1
0
// NewTransport returns a transport that authorizes
// the requests with the application's service account.
func (c *AppEngineConfig) NewTransport() oauth2.Transport {
	if c.Transport != nil {
		return oauth2.NewAuthorizedTransport(c.Transport, c, nil)
	}
	transport := &urlfetch.Transport{
		Context:                       c.context,
		Deadline:                      0,
		AllowInvalidServerCertificate: false,
	}
	return oauth2.NewAuthorizedTransport(transport, c, nil)
}
Example #2
0
// NewTransport creates an authorized transport.
func (c *ComputeEngineConfig) NewTransport() oauth2.Transport {
	return oauth2.NewAuthorizedTransport(http.DefaultTransport, c, nil)
}