def verify_secret(self, authcid, secret, authzid):
     username = authcid.lower() if lower_case else authcid
     try:
         assert dict[username] == secret
     except (KeyError, AssertionError):
         raise CredentialsInvalidError()
     return username
Exemple #2
0
 def get_secret(self, cid, zid=None):
     if cid != 'testuser':
         raise CredentialsInvalidError()
     if zid is not None and zid != 'testzid':
         raise CredentialsInvalidError()
     return 'testpassword', 'testidentity'
Exemple #3
0
 def verify_secret(self, cid, secret, zid=None):
     if cid != 'testuser' or secret != 'testpassword':
         raise CredentialsInvalidError()
     if zid is not None and zid != 'testzid':
         raise CredentialsInvalidError()
     return (cid, zid)
 def get_secret(self, authcid, authzid):
     username = authcid.lower() if lower_case else authcid
     try:
         return dict[username], username
     except KeyError:
         raise CredentialsInvalidError()
Exemple #5
0
 def get_secret(self, username, identity=None):
     try:
         return credentials[username], username
     except KeyError:
         raise CredentialsInvalidError()
Exemple #6
0
 def verify_secret(self, username, password, identity=None):
     try:
         assert credentials[username] == password
     except (KeyError, AssertionError):
         raise CredentialsInvalidError()
     return username
 def get_secret(self, *args):
     raise CredentialsInvalidError()