-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add App Engine implementations #1
Comments
@nf, could we provide appengine related implementations in the |
It should be go-gettable with "goapp get". But I'm not sure what the question is here. Are you asking if we can put the implementation in the google.golang.org/appengine repo? Or just its own package inside the oauth2 repo? |
This is what I'm asking. I don't want to import "appengine" in the oauth2/google/appengine package (the way goauth2 is currently doing). If I did |
If we put the package in Why don't you want to use specific build rules? If you make all the files in the appengine package use
then But there's another issue: which app engine import paths to use? There's currently
So we'd have files that import Kind of ugly, but it's only ugliness that we have to deal with. To the user it should be transparent. The one final issue is that godoc.org doesn't display docs from packages with build constraints. This we can fix in the godoc.org codebase. |
// +build appenginevm Do I need it? The file that imports
Because build tags exist for different implementations of the same interface. I think my generic appengine Config implementation could have been at the I will give the appengine build tags a try. I'm still not happy with it, because I don't want to ignore it during CI, and I still need to provide some build rules to make it happen. |
Yeah, I feel you. It's not ideal. FWIW, there's another god object on the horizon: http://godoc.org/code.google.com/p/go.net/context#Context |
This is still a good idea though, all I need is a type assertion.
Whoa :( |
You could pass in an *http.Request instead of appengine.Context, then you get type safety and the appengine stuff can be transparently hidden behind a build tag. Thoughts? |
It's unfortunately not possible. Look at this signature: https://github.com/golang/appengine/blob/dd45e2517b8cf23d0caeae3868c4f407a461b7ae/identity.go#L78 Only context knows about which project the caller app belongs to :( On the other hand, I don't want to end up with having a signature like |
Here's an idea: we provide an "oauth2/appengine" package that uses |
Are you saying we should duplicate the implementation for "appengine" and "google.golang.org/appengine"? That's likely, the code is tiny. |
I created a CL for the discussion: https://codereview.appspot.com/104200044/ |
No description provided.
The text was updated successfully, but these errors were encountered: