This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CloudEndpointsUserInfo represents the data passed by the ESP in Google's Cloud Endpoints Service | |
type CloudEndpointsUserInfo struct { | |
Issuer string `json:"issuer"` | |
ID string `json:"id"` | |
Email string `json:"email"` | |
} | |
// CloudEndPointsWrapper will try to extract the ESP header and add it as a scope - NOT IDEAL | |
func CloudEndPointsWrapper(name string, authenticate security.ScopedTokenAuthentication) runtime.Authenticator { | |
const header = "X-Endpoint-API-UserInfo" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import webapp2 | |
import decimal | |
import logging | |
import random | |
import string | |
from google.appengine.api import datastore_errors | |
from google.appengine.datastore import entity_pb | |
from google.appengine.ext import db |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from google.appengine.ext.ndb import model, context, tasklets | |
from random import choice | |
import string | |
from werkzeug import Response | |
class Items(model.Model): | |
user = model.StringProperty() | |
@classmethod | |
@tasklets.tasklet |