예제 #1
0
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)
예제 #2
0
파일: api.py 프로젝트: CERT-Polska/cuckoo
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)