1 2 3 4 5 6 7 8 9 10 11 12 13
from flask import current_app from flask.ext.httpauth import HTTPDigestAuth httpauth = HTTPDigestAuth() @httpauth.get_password def get_pw(username): if username in current_app.config['ENNSTATUS_SERVERS']: return current_app.confg['ENNSTATUS_SERVERS'][username]['PASSWORD'] return None