diff --git a/google/appengine.go b/google/appengine.go index 24ffad0..3fb36b4 100644 --- a/google/appengine.go +++ b/google/appengine.go @@ -19,7 +19,7 @@ import ( // If you are implementing a 3-legged OAuth 2.0 flow on App Engine // that involves user accounts, see oauth2.Config instead. // -// You are required to provide a valid appengine.Context as context. +// The provided context must have come from appengine.NewContext. func AppEngineTokenSource(ctx oauth2.Context, scope ...string) oauth2.TokenSource { return &appEngineTokenSource{ ctx: ctx, diff --git a/google/appenginevm.go b/google/appenginevm.go index f31f0d3..daf9a9f 100644 --- a/google/appenginevm.go +++ b/google/appenginevm.go @@ -9,6 +9,7 @@ package google import ( "time" + "golang.org/x/net/context" "golang.org/x/oauth2" "google.golang.org/appengine" ) @@ -18,7 +19,7 @@ import ( // If you are implementing a 3-legged OAuth 2.0 flow on App Engine // that involves user accounts, see oauth2.Config instead. // -// You are required to provide a valid appengine.Context as context. +// The provided context must have come from appengine.NewContext. func AppEngineTokenSource(ctx oauth2.Context, scope ...string) oauth2.TokenSource { return &appEngineTokenSource{ ctx: ctx, @@ -28,7 +29,7 @@ func AppEngineTokenSource(ctx oauth2.Context, scope ...string) oauth2.TokenSourc } var aeVMFetcherFunc = func(ctx oauth2.Context, scope ...string) (string, time.Time, error) { - c, ok := ctx.(appengine.Context) + c, ok := ctx.(context.Context) if !ok { return "", time.Time{}, errInvalidContext } diff --git a/google/source_appengine.go b/google/source_appengine.go index d0eb3da..689a1c7 100644 --- a/google/source_appengine.go +++ b/google/source_appengine.go @@ -21,7 +21,7 @@ var ( aeTokens = make(map[string]*tokenLock) // key is '\0'-separated scopes ) -var errInvalidContext = errors.New("oauth2: a valid appengine.Context is required") +var errInvalidContext = errors.New("oauth2: context must come from appengine.NewContext") type tokenLock struct { mu sync.Mutex // guards t; held while updating t