def require_basic_auth(): if not app.config.get('AUTHENTICATOR'): app.config['AUTHENTICATOR'] = Authenticator() if request.endpoint != "healthcheck" and not app.config['AUTHENTICATOR'].authenticate(): return Authenticator.challenge()