if entry is None: return True if entry: return False return True except Exception as e: logging.error('connection redis failed with :%s' % (e)) if AppConfig.get_enable_cors(): cors = CORS(server, resources={r"/api/*": {"origins": "*"}}) for blueprint in vars(routes).values(): if isinstance(blueprint, Blueprint): server.register_blueprint(blueprint, url_prefix=AppConfig.get_api_url_prefix()) @server.route('/api/v1/info', methods=['GET']) @jwt_required def protected(): return jsonify({ 'message': 'Welcome to User API version 1.0', }), 200 if __name__ == "__main__": server.run(host=AppConfig.get_host(), port=AppConfig.get_port(), debug=AppConfig.get_debug())
try: revoked_store = redis.StrictRedis(host=AppConfig.get_redis_hostname(), port=AppConfig.get_redis_port(), db=0, decode_responses=True) entry = revoked_store.get(jti) logging.debug('token found %r' % (entry)) if entry is None: return True if entry: return False return True except Exception as e: logging.error('connection redis failed with :%s' % (e)) if AppConfig.get_enable_cors(): cors = CORS(server, resources={r"/api/*": {"origins": "*"}}) for blueprint in vars(routes).values(): if isinstance(blueprint, Blueprint): server.register_blueprint(blueprint, url_prefix=AppConfig.get_api_url_prefix()) @server.route('/api/v1/info', methods=['GET']) @jwt_required def protected(): return jsonify({ 'message': 'Welcome to FileServer API version 1.0', }), 200 if __name__ == "__main__": server.run(host=AppConfig.get_host(), port=AppConfig.get_port(), debug=AppConfig.get_debug())