node-red / node-red/node-red-nodes

Can't have "@" in the password field

Open
#219 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.1k
Forks
612
Avg merge
13h 57m
Merged PRs (30d)
3

Description

It looks like having an "@" in the password field breaks the connection with the database. The error message that I am getting shows:

For a password: 123@ab

Error [ab:27017]

Where ab comes from the password and 27017 is the default port.

My guess is that the fields are being concatenated to form the URL: mongodb//user:password@hostname:port

And when nodejs finds the first "@" it thinks that what comes after that is the hostname.

A workaround for this issue is to use the db.authenticate(...) method.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the MongoDB connection entry point that builds the connection URL; the issue does not name a file or test. Reproduce with password 123@ab, compare the authenticate(...) workaround, and consider it done when that password connects without treating “ab” as the hostname.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, mongodb
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.