@staticmethod
    def verify(encoded, allowed_users):
        data, signature, client_creds = encoded
        key = (data, signature)
        try:
            credentials = _VERIFY_CACHE[key]
        except KeyError:
            credentials = Credentials(encoded)
            user = credentials.user
            for cred in _VERIFY_CACHE.values():
                if cred.user == user:
                    raise CredentialsError('Public key mismatch for %r' % user)
            else:
                _VERIFY_CACHE[key] = credentials

        if allowed_users is not None:
            try:
                pubkey = allowed_users[credentials.user]
            except KeyError:
                raise CredentialsError('User %r not in allowed_users' \
                                       % credentials.user)
            else:
                if (credentials.public_key.e != pubkey.e) or \
                   (credentials.public_key.n != pubkey.n):
                    raise CredentialsError('Allowed user mismatch for %r' \
                                           % credentials.user)

        credentials.client_creds = client_creds
        credentials.remote = True
        return credentials
Mark a review request as unstarred.
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/rbac.py/Credentials.verify--crossover with--dataset/ETHPy150Open reviewboard/reviewboard/reviewboard/accounts/models.py/Profile.unstar_review_request