def check_authentication(): token = config("cuckoo:cuckoo:api_token") if token: expect = "Bearer " + token auth = request.headers.get("Authorization") if not constant_time_compare(auth, expect): abort(401)