Commit Graph

399 Commits

Author SHA1 Message Date
Brad Fitzpatrick dfb470cc49 oauth2: fix typo in Token docs and clarify mutability of Token
Change-Id: I1093cffbd4b6fe25cd5b7cfb31e820b15fcfa41f
Reviewed-on: https://go-review.googlesource.com/2197
Reviewed-by: Burcu Dogan <jbd@google.com>
2014-12-31 03:26:08 +00:00
Brad Fitzpatrick a379e41d44 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>
2014-12-30 22:27:30 +00:00
Jay Weisskopf e5909d4679 oauth2: remove duplicate package doc and import comments
The comments already live in oauth2.go.

Change-Id: I103113fbc8138b242cb6f79052fdc6b29bf6f031
Reviewed-on: https://go-review.googlesource.com/2131
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-28 23:09:48 +00:00
Jay Weisskopf 158e906f14 oauth2: update "review" to "codereview" in CONTRIBUTING
Ticks have also been added around commands for style.

Change-Id: Ie2f1934503f73a106cc60d8f9e122dcee69bd000
Reviewed-on: https://go-review.googlesource.com/2130
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-28 23:09:26 +00:00
Burcu Dogan 0a3f39965a oauth2: fix the broken appengine build
Change-Id: I7d1af87be35d9e3bd3d0b5dcd659d07cde873b56
Reviewed-on: https://go-review.googlesource.com/1925
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-21 23:30:00 +00:00
Brad Fitzpatrick 78bedfddc3 oauth2: support CancelRequest when Transport.Base is nil
Fixes #54

Change-Id: If00d0ce8e1c0cf32a4b7dba5506187b9012940bc
Reviewed-on: https://go-review.googlesource.com/1879
Reviewed-by: Burcu Dogan <jbd@google.com>
2014-12-21 05:42:19 +00:00
Brad Fitzpatrick f5b40b26f1 oauth2: use a JSON struct types instead of empty interface maps
Change-Id: Ifd66ea35c15dbd14acca0c945b533ec755de12e4
Reviewed-on: https://go-review.googlesource.com/1872
Reviewed-by: Burcu Dogan <jbd@google.com>
2014-12-20 06:52:21 +00:00
Brad Fitzpatrick 9abe144dd5 oauth2: move Token into its own file (no code changes)
Change-Id: I5248f48cc1af68a0f78a8ddf7e28b91a729f5460
Reviewed-on: https://go-review.googlesource.com/1870
Reviewed-by: David Symonds <dsymonds@golang.org>
2014-12-19 04:29:46 +00:00
Burcu Dogan 289b5d10a0 oauth2: handle token expiry for JWT
Change-Id: I84b4c282ef00e87d13a9b16fdcebd97ea5ed4f4e
Reviewed-on: https://go-review.googlesource.com/1650
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2014-12-18 22:13:51 +00:00
Burcu Dogan 13407478f7 oauth2/google: better instructions for the PKCS12 to PEM conversion
Change-Id: Ibcbde1e0131e0a1f90f66978d9b9a7f3aa3dceb6
Reviewed-on: https://go-review.googlesource.com/1660
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2014-12-17 00:34:13 +00:00
Dave Day 928c2dd7dc oauth2: make sure travis runs at the target commit, not head
Also, change the target Go version to 1.4 and make the 'go get' command
only perform the download step (no building).

Change-Id: Iafa3c218d2418b2a2681ce2c03bd1ff833afb317
Reviewed-on: https://go-review.googlesource.com/1702
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Burcu Dogan <jbd@google.com>
2014-12-17 00:27:35 +00:00
Burcu Dogan 7512128337 oauth2/jws: minor readability improvements
Change-Id: I8bcf0bc88b3db49ac281531524e792e8547e1e07
Reviewed-on: https://go-review.googlesource.com/1671
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2014-12-17 00:04:31 +00:00
Dave Day 7bbf2199a5 oauth2: add func NewClient as per issue #66
Change-Id: Icfae8530e725f2f31774e395319e6e6db330262a
Reviewed-on: https://go-review.googlesource.com/1701
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2014-12-17 00:04:06 +00:00
Burcu Dogan 79dad4e0f4 oauth2: add CONTRIBUTING
Change-Id: I8775dc83b8fda3954032921f120eab223d1551b4
Reviewed-on: https://go-review.googlesource.com/1651
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2014-12-17 00:02:23 +00:00
Johan Euphrosine a360c4ed80 oauth2: fix typo
Change-Id: Ic39a63c50a042ab836bbc496db9aea7fb52870d2
Reviewed-on: https://go-review.googlesource.com/1652
Reviewed-by: Burcu Dogan <jbd@google.com>
2014-12-16 18:11:04 +00:00
Brad Fitzpatrick 1679411e42 github: new package with Github's Endpoint
Change-Id: I4a64493f521678570a89d5da76604c258fb9ceac
Reviewed-on: https://go-review.googlesource.com/1631
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-16 06:37:13 +00:00
Burcu Dogan 9b6b7610ad oauth2: rewrite google package, fix the broken build
Change-Id: I2753a88d7be483bdbc0cac09a1beccc4806ea4bc
Reviewed-on: https://go-review.googlesource.com/1361
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-16 06:20:58 +00:00
Brad Fitzpatrick a568078818 oauth2: redesign the API
Tests and examples aren't updated yet. The tree will be broken after this,
but nobody should be using this yet anyway.

Change-Id: I0004c738f40919ab46d107c71c011c510fbc748f
Reviewed-on: https://go-review.googlesource.com/1246
Reviewed-by: Burcu Dogan <jbd@google.com>
2014-12-16 06:20:49 +00:00
Burcu Dogan b3f9a68f05 oauth2: fix lint errors
Change-Id: I9cc4c61767be5e6eda189468430e9a89fe2f3796
2014-12-01 18:03:32 -08:00
Andrew Gerrand 3ec35f1969 Merge branch 'master' of https://github.com/golang/oauth2 2014-11-28 10:17:23 +11:00
Burcu Dogan e750a2fd5a oauth2: add vanity URL import comments, use the vanity URL on builds
Change-Id: Ia20e40d98aa709e3d598388e0a15501584152ab5
2014-11-26 11:47:34 -08:00
Burcu Dogan 5fd31d511c Merge pull request #50 from snikch/fix-json-expiry
Handle expiry correctly in json response
2014-11-25 19:48:01 -08:00
Burcu Dogan b846388564 oauth2: Removing the inconsistent and duplicate features, better naming
- Removed Flow, flow is a nothing but options.
- Renamed Cacher to Storer.
- Removed the setter from the Transport. Store should do the initial set.
  Getter is not removed, because extra fields are available through
  Transport.Token.Extra(). It's not pleasant to implement a custom Storer
  implementation to read such values.

oauth2: Remove VMs from the AppEngine example title
2014-11-25 14:36:49 -08:00
Mal Curtis 778494f9ec Handle expiry correctly in json response
Go treats json numbers as float64 not int. Previously json response
expiry information was ignored since it was expected to be an int.
2014-11-21 13:07:44 +13:00
Burcu Dogan c048af9da2 Add Cacher interface. 2014-11-13 15:41:14 +11:00
Burcu Dogan 2d3ce25e9a Don't mutate the authorization endpoint.
Flow should be reusable, Options object should not be
mutated by the calls performed on the flow.
2014-11-12 10:02:14 +11:00
Burcu Dogan 0b8fcbadce Avoid setting an explicit token fetcher for the known flows. 2014-11-11 11:22:30 +11:00
Burcu Dogan 13cbb8b617 Disable builds for classic App Engine.
Current build file doesn't build the subdirectories, therefore succeeds
without building the actual packages. We need to add the appengine
and appengine_internal manually to the GOPATH and enable the
appengine build again.
2014-11-10 16:03:50 +11:00
Burcu Dogan 0cf6f9b144 Introduce an option function type
- Reduce the duplicate code by merging the flows and
determining the flow type by looking at the provided options.
- Options as a function type allows us to validate an individual
an option in its scope and makes it easier to compose the
built-in options with the third-party ones.
2014-11-08 09:46:26 +11:00
Burcu Dogan 49f4824137 Merge pull request #48 from gmlewis/cache-mock
Cache oauth tokens locally and with Memcache.
2014-10-31 17:13:19 -07:00
Glenn Lewis 94c2b61903 Locally cache oauth tokens.
This change is for both App Engine and Managed VMs so that these apps can scale without running into the app_identity_service quota limit due to calling appengine.AccessToken too frequently.  An added benefit of caching is that calls to Google APIs will be significantly sped up due to removing the round-trip calls to the api_identity_service.
2014-10-31 16:04:03 -07:00
Burcu Dogan 68ff865055 Merge pull request #47 from rakyll/build
Build against the appengine runtime
2014-10-29 20:02:47 -07:00
Burcu Dogan 8fcd49950f Build against the appengine runtime. 2014-10-29 19:51:15 -07:00
Burcu Dogan 0ae3d4edc9 Allow users to get extra fields from a token response. 2014-10-27 20:01:11 -07:00
Burcu Dogan 2e27b6b6cb Handle non-2xx for metadata server responses. 2014-10-23 10:06:00 -07:00
Burcu Dogan 4b407cace1 Support token expiration for Facebook OAuth 2.0.
Facebook's OAuth 2.0 implementation seems to be broken and
returns expires_in value in expires. Fallback to expires field to
handle the expiration time for Facebook.
2014-10-21 10:43:33 -07:00
Burcu Dogan 7e2b7b4a79 Merge pull request #45 from secondbit/master
Update metadata server URL to be a FQDN.
2014-10-07 16:21:44 -07:00
Paddy Foran ad051cf1e6 Update metadata server URL to be a FQDN.
Without a fully qualified domain name, containers (like Docker) can't
connect to the metadata server. Update the address for the metadata
server to be a FQDN so containers can use the library. See #44.
2014-10-07 17:38:45 -04:00
Andrew Gerrand 8f816d62a2 Merge pull request #43 from mjibson/master
SoundCloud and spelling fixes
2014-10-04 17:10:03 +10:00
Matt Jibson 123b41c5cb Add SoundCloud to the providers not supporting Auth headers 2014-10-04 02:16:01 -04:00
Matt Jibson 311200b953 Spelling 2014-10-04 02:15:35 -04:00
Andrew Gerrand c03fd6cc9b Merge branch 'master' of github.com:golang/oauth2 2014-09-30 07:38:32 +10:00
Andrew Gerrand 040e271ca2 use variadics and fix build tags for App Engine files 2014-09-30 07:38:10 +10:00
Burcu Dogan 271b19bc29 Merge branch 'master' of github.com:golang/oauth2 2014-09-22 08:46:15 -07:00
Burcu Dogan 7ffb9a8fe1 Fixing path.join for URL generation. 2014-09-22 08:37:20 -07:00
Burcu Dogan f8fee03cb3 Godoc links should seem to be linking to godoc.org 2014-09-18 00:42:53 -07:00
Burcu Dogan 29bcba0a21 Merge pull request #39 from clsung/master
Add Linkedin to the providers not supporting Auth headers.
2014-09-11 18:56:33 -07:00
CL Sung 099e4f09b0 Add Linkedin to the providers not supporting Auth headers. 2014-09-11 10:49:49 +08:00
Burcu Dogan 6d51104f2c Build should use the exact build tag configuration of GAE managed VMs. 2014-09-08 15:05:45 -07:00
Burcu Dogan bda32de83f Travis build should keep building appenginevm configuration. 2014-09-08 14:56:32 -07:00