oauth2, oauth2/google: add, use ReuseTokenSource

Token caching is now done whenever you make a Client, and
ReuseTokenSource is exported from the oauth2 package and used by the
Google TokenSources (Compute and App Engine).

Token.Expired is now Token.Valid, and works on nil receivers.

Some other wording cleanups in the process.

All tests pass. App Engine should pass, but is untested.

Change-Id: Ibe1d2599ac3ccfe9b399b1672f74bb24cfc8d311
Reviewed-on: https://go-review.googlesource.com/2195
Reviewed-by: Burcu Dogan <jbd@google.com>
10 files changed
tree: 8757b0bead4dd7193c6ffb18513262fa2e1d2a16
  1. github/
  2. google/
  3. internal/
  4. jws/
  5. .travis.yml
  6. AUTHORS
  7. client_appengine.go
  8. CONTRIBUTING.md
  9. CONTRIBUTORS
  10. example_test.go
  11. jwt.go
  12. jwt_test.go
  13. LICENSE
  14. oauth2.go
  15. oauth2_test.go
  16. README.md
  17. token.go
  18. transport.go
  19. transport_test.go
README.md

OAuth2 for Go

Build Status

oauth2 package contains a client implementation for OAuth 2.0 spec.

Installation

go get golang.org/x/oauth2

See godoc for further documentation and examples.