google-cloud-endpoints

Function User.getUserId() in Cloud endpoint api returns null for a user object that is not null

爱⌒轻易说出口 提交于 2019-11-30 14:49:04
问题 I have a problem with getting the userid for a cloud endpoint method. I have used oauth2 authentication in my android client and passed the credentials to my service. The below is similar to what my method looks like (simplified to make it more clear). I note that issue 8848 for python seems to be very similar to this problem. Is the same issue a problem in java api as well? The method public SuccessCode doSomething(WireFormat wire, User user){ log.info("User id: "+user.getUserId()); log.info

Function User.getUserId() in Cloud endpoint api returns null for a user object that is not null

吃可爱长大的小学妹 提交于 2019-11-30 12:28:22
I have a problem with getting the userid for a cloud endpoint method. I have used oauth2 authentication in my android client and passed the credentials to my service. The below is similar to what my method looks like (simplified to make it more clear). I note that issue 8848 for python seems to be very similar to this problem. Is the same issue a problem in java api as well? The method public SuccessCode doSomething(WireFormat wire, User user){ log.info("User id: "+user.getUserId()); log.info("Federated identity: "+user.getFederatedIdentity()); log.info("Email address: "+user.getEmail()); }

Dynamically created method and decorator, got error 'functools.partial' object has no attribute '__module__'

六眼飞鱼酱① 提交于 2019-11-30 08:14:57
I am currently using EndpointsModel to create a RESTful API for all my models on AppEngine. Since it is RESTful, these api have a lot of repeat code which I want to avoid. For example: class Reducer(EndpointsModel): name = ndb.StringProperty(indexed=False) @endpoints.api( name="bigdata", version="v1", description="""The BigData API""", allowed_client_ids=ALLOWED_CLIENT_IDS, ) class BigDataApi(remote.Service): @Reducer.method( path="reducer", http_method="POST", name="reducer.insert", user_required=True, ) def ReducerInsert(self, obj): pass ## and GET, POST, PUT, DELETE ## REPEATED for each

“Sessions” with Google Cloud Endpoints

核能气质少年 提交于 2019-11-30 05:59:48
问题 This question is only to confirm that I'm clear about this concept. As far as I understand, Google Cloud Endpoints are kind of Google's implementation of REST services, so that they can't keep any "session" data in memory, therefore: Users must send authentication data with each request. All the data I want to use later on must be persisted , namely, with each API request I receive, I have to access the Datastore, do something and store the data again. Is this correct? And if so, is this

What are ResourceContainers and how to use them for Cloud Endpoints?

故事扮演 提交于 2019-11-30 05:46:09
问题 Since Google AppEngine 1.8.5 there is a new warning in the development environment: WARNING 2013-09-27 10:10:53,035 api_config.py:1768] Method specifies path parameters but you are not using a ResourceContainer. This will fail in future releases; please switch to using ResourceContainer as soon as possible. What are ResourceContainers and how to use them? 回答1: They recently updated the docs to explain this change here: Google App Engine Docs Basically what you want to do is to separate the

Cloud Endpoints - Retrieving a single entity from datastore (by a property other than the helper methods provided by EndpointsModel)

自古美人都是妖i 提交于 2019-11-30 05:29:07
This question completely follows on from a related question I had asked (and was answered) here: Error when trying to retrieve a single entity As I understand, to retrieve a single entity from the datastore using a property other than helper methods already provided (e.g. 'id' ) requires turning a simple data property into an EndpointsAliasProperty ? If yes, how would I go about doing that? Or is it that we can only use 'id' (helper methods provided by EndpointsModel ) and we cannot use any of the properties that we define (in this case 'title' )? The distinction between the custom

AngularJS and google cloud endpoint: walk through needed

♀尐吖头ヾ 提交于 2019-11-30 05:28:43
I'm new to AngularJS but I really like the way AngularJS works so I want to deployed it as client side for my Google cloud endpoint backend. Then I immediately get two problems: 1, Where to put the myCallback , so it's able to work into the ANgularJs controller? <script src="https://apis.google.com/js/client.js?onload=myCallback"></script> 2, How I'm able to do the oauth2? and how the controller knows if the user authorized? gapi.auth.authorize({client_id: myCLIENT_ID, scope: mySCOPES,..... Any help is appreciated. For loading Google Javascript Library with AngularJs, the callback function

How can I pass custom information from an App Engine Authenticator to the Endpoint?

纵然是瞬间 提交于 2019-11-30 02:41:33
I am referencing @MinWan 's awesome answer in this post Google Cloud Endpoints and user's authentication , where he describes a way to add custom headers to a request against App Engine's Cloud Endpoints. It becomes clear that we can add a custom header and write an authenticator per each service (e.g. Google, Twitter, Facebook) against which we want to authenicate, where each authenticator reads a specific header and authenticates against the service. If the token is valid, a service typically returns a response with an email address or user id, plus some extra information [A], from which we

Modify HTTP headers in Google App Engine Endpoints (Android)

跟風遠走 提交于 2019-11-29 23:03:26
问题 I would like to add custom headers to the HTTP package sent to an Endpoint. I've read that I can access the raw HTTP data in the Endpoint method (by adding a HttpServletRequest parameter). What I am looking for is a solution (or a hack) to access and modify the data being sent by the (Android) client. 回答1: Http headers can be modified like this. I use this link as example. Since it's one of the Google's example. Read it and find EndpointsAsyncTask you can use GoogleClientRequestInitializer

How to retrieve custom User object in GAE endpoints?

江枫思渺然 提交于 2019-11-29 22:44:44
问题 I've just created my own custom authentication on my google app engine Java app. And it wasn't that much of a trouble as is the next thing I'm trying to do. Authentication works fine but now I'm trying to add some additional fields to the default User object so that I wouldn't have to make so many calls to the server. So what I've done so far is created a custom class that implements Authenticator. Based on whether the user is authenticated or not the authenticate method returns the User