def testCred(cred, username=None, password=None):
    cred_username = cred.get("username", None)
    cred_password = cred.get("password", None)

    user_match = True
    if cred_username is not None:
        user_match = (cred_username == username)

    password_match = True
    if cred_password is not None:
        password_match = cryptcontext.verify(password, cred_password)

    return (user_match and password_match)
Test if given credentials matches specified credentials
dataset/ETHPy150Open thinkst/opencanary/opencanary/honeycred.py/testCred