-
- Downloads
Mb db connection uri parsing (#14716)
* Parse mb-db-connection-uri when it contains a password Using the raw jdbc string when its of the form `username:password@host:port` causes problems if passed directly to jdbc. Clojure.java.jdbc has some special handling for username and passwords ```clojure (if-let [user-info (.getUserInfo uri)] {:user (first (str/split user-info #":")) :password (second (str/split user-info #":"))}) ``` Our logic here is: 1. if mb-db-connection-uri is set and not an older style password, return that, possibly prepending jdbc: to it 2. if mb-db-connection-uri is set and is an older style passowrd, then we use the old parsing code which doesn't support all of the crazy stuff individual connection strings may offer and return a db-spec 3. if all the individual parts are supplied (mb-db-host, mb-db-port, etc) are used to construct a db-spec * Correct what old style means for conn-uri accidentally thought user@host/metabase?password=password was ok. Any credentially in the host spot is not supported * Cleanup documentation don't refer to old password style but call it inline credentials * Fixups for connection parsing - ensure we turn postgres: to postgresql: in connection string - ensure we warn about postgres ssl edge case when using raw connection string - make warnings testable * Space in inline credentials warning * Strip jdbc from connection when checking if inline credentials * Fix for old credential style
Please register or sign in to comment