(self, all_credentials)
Update this socket's authentication.

        Log in or out to bring this socket's credentials up to date with
        those provided. Can raise ConnectionFailure or OperationFailure.

        :Parameters:
          - `all_credentials`: dict, maps auth source to MongoCredential.
Update this socket's authentication.
Update this socket s authentication .
def check_auth(self, all_credentials):
        """Update this socket's authentication.

        Log in or out to bring this socket's credentials up to date with
        those provided. Can raise ConnectionFailure or OperationFailure.

        :Parameters:
          - `all_credentials`: dict, maps auth source to MongoCredential.
        """
        if all_credentials or self.authset:
            cached = set(itervalues(all_credentials))
            authset = self.authset.copy()

            # Logout any credentials that no longer exist in the cache.
            for credentials in authset - cached:
                auth.logout(credentials.source, self)
                self.authset.discard(credentials)

            for credentials in cached - authset:
                auth.authenticate(credentials, self)
                self.authset.add(credentials)
def check_auth ( self , all_credentials ) : if all_credentials or self . authset : cached = set ( itervalues ( all_credentials ) ) authset = self . authset . copy ( ) # Logout any credentials that no longer exist in the cache. for credentials in authset - cached : auth . logout ( credentials . source , self ) self . authset . discard ( credentials ) for credentials in cached - authset : auth . authenticate ( credentials , self ) self . authset . add ( credentials )