Esempio n. 1
0
    def ban_key(cls, key_value, reason=""):

        key = SecurityKey.get_by_key_name(key_value)
        key.banned = True
        key.banned_reason = reason

        key.put()
Esempio n. 2
0
    def retrieve_key(cls, key_value):

        k = SecurityKey.get_by_key_name(key_value)
        k.last_use = datetime.datetime.now()

        k.put()

        return k
Esempio n. 3
0
    def use_key(cls, key_value):

        k = SecurityKey.get_by_key_name(key_value)
        k.last_use = datetime.datetime.now()
        k.use_tally = k.use_tally + 1

        k.put()

        return k
Esempio n. 4
0
    def expire_key(cls, key_value):

        key = SecurityKey.get_by_key_name(key_value)
        key.expired = True
        key.put()