def revoke_token(self, admin_token, token_id): self.__validate_token(admin_token) dtoken = db_api.token_get(token_id) if not dtoken: raise fault.ItemNotFoundFault("Token not found") db_api.token_delete(token_id)
def __get_dauth_data(self, token_id): """return token and user object for a token_id""" token = None user = None if token_id: token = db_api.token_get(token_id) if token: user = db_api.user_get(token.user_id) return (token, user)