Commit Graph

29 Commits

Author SHA1 Message Date
Tim Cooper ec22f46f87 oauth2: remove misleading Transport.RoundTrip comment
This removes any assumption about how the underlying TokenSource is
implemented.

Change-Id: I03521e2f26bd07e25eb6ba00a78c285ece1835cc
Reviewed-on: https://go-review.googlesource.com/114955
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-05-29 20:36:56 +00:00
Tim Cooper 30b72dfc06 oauth2: close request body if errors occur before base RoundTripper is invoked
Fixes golang/oauth#269

Change-Id: I25eb3273a0868a999a2e98961ae5e4040e44ad7a
Reviewed-on: https://go-review.googlesource.com/114956
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-05-29 20:36:26 +00:00
Andrew Gerrand 038cb4adce all: change copyright to 'Go Authors'
Fixes golang/go#12354

Change-Id: Ie4bbe9445e2a840c9db830c9bd52a783b7a6f9bc
Reviewed-on: https://go-review.googlesource.com/13952
Reviewed-by: Russ Cox <rsc@golang.org>
2015-10-22 04:14:42 +00:00
Aaron Torres a8c019d04a oauth2: add support for client credential grant type
Creates a new package called clientcredentials and
adds transport and token information to the internal
package. Also modifies the oauth2 package to make
use of the newly added files in the internal package.

The clientcredentials package allows for token requests
using a "client credentials" grant type.

Fixes https://github.com/golang/oauth2/issues/7

Change-Id: Iec649d1029870c27a2d1023baa9d52db42ff45e8
Reviewed-on: https://go-review.googlesource.com/2983
Reviewed-by: Burcu Dogan <jbd@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-04-18 00:13:27 +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 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
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
Burcu Dogan c048af9da2 Add Cacher interface. 2014-11-13 15:41:14 +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 0ae3d4edc9 Allow users to get extra fields from a token response. 2014-10-27 20:01:11 -07:00
Burcu Dogan 97a89b3be5 Access type and approval prompt should be set at URL generation. 2014-09-04 23:30:06 -07:00
Burcu Dogan ee77246177 Don't provide a Transport interface but provide a http.RoundTripper implementation. 2014-08-14 10:59:09 -07:00
Burcu Dogan a9dc52b3d3 Docs, code cleanups. 2014-08-12 19:50:34 -07:00
Burcu Dogan 0f597d5ad4 oauth2: don't use http.DefaultTransport.
http.DefaultTransport is not available on App Engine.
2014-07-11 10:57:28 -07:00
Johan Euphrosine 93ad3f4a9e remove cache 2014-07-08 22:27:34 -07:00
Burcu Dogan ad322e7e30 Caches should return an error instead of invoking a handler. 2014-06-22 15:38:39 -07:00
Burcu Dogan db2d8759b4 Add docs for NewAuthorizedTransportWithCache. 2014-06-17 16:24:27 +02:00
Burcu Dogan 4337573be3 oauth2: perform caching ops at the transport level 2014-06-17 16:09:09 +02:00
Burcu Dogan 58513eb0ea Provide a transport constructor for transporters with a cache. 2014-05-26 14:45:41 +02:00
Burcu Dogan 909f098dcd Cache read operation should be handled during construction. 2014-05-26 11:53:51 +02:00
Burcu Dogan 6bb3577bf0 Fixing styling issues for caching. 2014-05-22 14:33:36 +02:00
Burcu Dogan 0476447419 Moving error handlers to the cache implementations. 2014-05-21 15:56:44 +02:00
Burcu Dogan dd66946789 Merge branch 'cache' of github.com:rakyll/oauth2 into cache 2014-05-21 15:24:41 +02:00
Burcu Dogan 2e00ad50b1 Authorized transport should read from cache and write to cache. 2014-05-19 00:20:42 +02:00
Burcu Dogan abc4bcd940 Reverting the license back to the original. 2014-05-17 17:26:57 +02:00
Burcu Dogan d7c8bcd0d0 oauth2: adding license. 2014-05-13 21:06:46 +03:00
Burcu Dogan 2af52e700e oauth2: fixing abstractions to be able to provide external token fetchers 2014-05-10 09:41:39 +02:00
Burcu Dogan c32debaa6f Initial commit 2014-05-09 23:05:13 +02:00