INNER CODE UNIT · JavaScript

credentials

furey/mongodb-lens · mongodb-lens.js:272

        const credentials = authPart.substring(authIndex + 3)
        if (credentials.includes(':')) {
          const [username, ...passwordParts] = credentials.split(':')
          return `${protocol}${username}:********@${restPart}`
        }
      }
    }
    return uri
  } catch (error) {
    log(`Error obfuscating URI: ${error.message}`, true)
    return uri
  }
}

const changeConnection = async (uri, validate = true) => {
  isChangingConnection = true
  try {
    if (mongoClient) await mongoClient.close()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…