def credentials_match(self, user_detail, key):
        if user_detail:
            creds = user_detail.get('auth')
            auth_type = creds.split(':')[0]
            auth_encoder = getattr(swauth.authtypes, auth_type.title(), None)
            if auth_encoder is None:
                self.logger.error('Invalid auth_type %s' % auth_type)
                return False
        return user_detail and auth_encoder().match(key, creds)
Returns True if the key is valid for the user_detail.
dataset/ETHPy150Open openstack/swauth/swauth/middleware.py/Swauth.credentials_match