(username, password, database, options)
return _build_credentials_tuple(
        mechanism, source, username, password, options)
Parse authentication credentials.
Parse authentication credentials.
Parse authentication credentials .
def _parse_credentials(username, password, database, options):
    """Parse authentication credentials."""
    mechanism = options.get('authmechanism', 'DEFAULT')
    if username is None and mechanism != 'MONGODB-X509':
        return None
    source = options.get('authsource', database or 'admin')
    return _build_credentials_tuple(
        mechanism, source, username, password, options)
def _parse_credentials ( username , password , database , options ) : mechanism = options . get ( 'authmechanism' , 'DEFAULT' ) if username is None and mechanism != 'MONGODB-X509' : return None source = options . get ( 'authsource' , database or 'admin' ) return _build_credentials_tuple ( mechanism , source , username , password , options )