Uploaded image for project: 'MariaDB Connector/node.js'
  1. MariaDB Connector/node.js
  2. CONJS-139

createConnection(string)` does not support URL-encoded credentials

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • 2.4.1
    • configuration
    • None

    Description

      reported from PR-115

      In a URL, user/password must be URL-encoded if they contain special characters.
      Let's say the password is foo@bar: the corresponding string is foo%40bar.

      So if we use a connection string to open a connection, the user/password must be URL-decoded otherwise an error occurs:

      mariadb.createConnection("mariadb://user:foo%40bar@localhost:3306/db");
      # Error: (conn=9, no: 1045, SQLState: 28000) Access denied for user 'user'@'localhost' (using password: YES)
      

      See: https://github.com/mariadb-corporation/mariadb-connector-nodejs/blob/master/lib/config/connection-options.js#L210
      Credentials are passed as-is.

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            diego dupin Diego Dupin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.