Skip to content

GenDatabricks produces incorrect DSN valuesΒ #48

@jbeemster

Description

@jbeemster

The DSN generator for databricks is producing very strange results (https://github.com/xo/dburl/blob/master/dsn.go#L223-L241)

When digging into the code:

s := fmt.Sprintf("token:%s@%s.databricks.com:%s/sql/1.0/endpoints/%s", user, pass, port, host)
  1. The username (token) is being put into the password
  2. The password is then being put into the URL (this immediately creates a leak of the password in logs)
  3. The port is correct πŸŽ‰
  4. The host is then appended onto the end of the path
  • Host like this also prevents other types of clusters from being used

Ideally this should be updated to the following:

s := fmt.Sprintf("token:%s@%s:%s%s", pass, host, port, path)

To get around this issue for the moment I am doing the following with the uri dburl.URL value:

sql.Open("databricks", fmt.Sprintf("%s@%s%s?%s", uri.User, uri.Host, uri.Path, uri.RawQuery))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions