Exemplo n.º 1
0
def bake(username, password):
    """Return the cookie foe newly baked user, error if exists."""
    #I want to chek for existance here, but I also wont to check for existance before get here
    #if exists(username):
    #    return  None
    #in current scenario user added without check (which is improbable) will be adeed but removed when two users with same name will be detected
    (hmacPsw, salt) = crypto.make(password)
    (userCookie, pepper) = crypto.bake(username)
    user = User(name=username, password=hmacPsw, salt=salt, pepper=pepper)
    user.put()
    return userCookie
Exemplo n.º 2
0
def bake(username, password):
    """Return the cookie foe newly baked user, error if exists."""
    #I want to chek for existance here, but I also wont to check for existance before get here
    #if exists(username):
    #    return  None  
    #in current scenario user added without check (which is improbable) will be adeed but removed when two users with same name will be detected
    (hmacPsw,salt) = crypto.make(password);            
    (userCookie,pepper) = crypto.bake(username);
    user = User(name = username, password = hmacPsw, salt = salt, pepper = pepper)
    user.put()
    return userCookie;
Exemplo n.º 3
0
 def bake(self):
     (userCookie, pepper) = crypto.bake(self.name)
     self.pepper = pepper
     self.put()
     return userCookie
Exemplo n.º 4
0
 def bake(self):
     (userCookie,pepper) = crypto.bake(self.name)
     self.pepper = pepper
     self.put()
     return userCookie