16 lines
399 B
Python
16 lines
399 B
Python
from flask import current_app
|
|
|
|
|
|
def get_users():
|
|
users = {}
|
|
authfile = current_app.config['AUTHFILE']
|
|
|
|
current_app.logger.debug('Reading %s for users', authfile)
|
|
|
|
with current_app.open_resource(authfile) as f:
|
|
for entry in f:
|
|
users.update({
|
|
tuple(entry.decode('ascii').strip().split(':', 1))})
|
|
current_app.logger.debug(users)
|
|
return users
|