Don't provide a Transport interface but provide a http.RoundTripper implementation.

This commit is contained in:
Burcu Dogan
2014-08-13 22:22:35 -07:00
parent b314823c0b
commit ee77246177
7 changed files with 38 additions and 64 deletions

8
jwt.go
View File

@@ -78,14 +78,14 @@ type JWTConfig struct {
// NewTransport creates a transport that is authorize with the
// parent JWT configuration.
func (c *JWTConfig) NewTransport() Transport {
return NewAuthorizedTransport(http.DefaultTransport, c, &Token{})
func (c *JWTConfig) NewTransport() *Transport {
return NewTransport(http.DefaultTransport, c, &Token{})
}
// NewTransportWithUser creates a transport that is authorized by
// the client and impersonates the specified user.
func (c *JWTConfig) NewTransportWithUser(user string) Transport {
return NewAuthorizedTransport(http.DefaultTransport, c, &Token{Subject: user})
func (c *JWTConfig) NewTransportWithUser(user string) *Transport {
return NewTransport(http.DefaultTransport, c, &Token{Subject: user})
}
// fetchToken retrieves a new access token and updates the existing token