Python 是烧瓶缓存';文件系统缓存是否安全?
我想使用cache.memoize decorator缓存身份验证函数的结果 但是,身份验证函数将用户名和密码作为参数,我需要维护安全性Python 是烧瓶缓存';文件系统缓存是否安全?,python,caching,flask,flask-cache,Python,Caching,Flask,Flask Cache,我想使用cache.memoize decorator缓存身份验证函数的结果 但是,身份验证函数将用户名和密码作为参数,我需要维护安全性 Cache(config={'CACHE_TYPE': 'filesystem'}) @cache.memoize def authenticate(username, password) # some logic return True/False Flask缓存的文件系统缓存安全吗?有没有办法通过模块设置flask缓存文件的所有权/权限
Cache(config={'CACHE_TYPE': 'filesystem'})
@cache.memoize
def authenticate(username, password)
# some logic
return True/False
Flask缓存的文件系统缓存安全吗?有没有办法通过模块设置flask缓存文件的所有权/权限?将原始密码存储在任意位置一段时间听起来不是个好主意 根据您检查密码的方式以及瓶颈所在的位置,您可以缓存密码哈希,然后只需对此进行检查 例如,如果您在数据库中存储了密码哈希,而检索是瓶颈:
def authenticate(username, password):
hash = get_password_hash()
return check_password(password, hash)
@cache.memoize
def get_password_hash(username):
return retrieve_hash_from_database()