Skip to content

Commit 7f322c1

Browse files
authored
fix: don't quote an already quoted url field (#433)
At present, CST doesn't connect to UTA databases correctly if the password has special characters. The database URL includes a password field, which is already embedded within a valid URL. The value was url quoted when the URL was generated, so it doesn't need to be quoted a second time when the URL is consumed by the UTA database code. I tested this using a password `local@$%dev` and it attempted to authenticate with the password `local%40%24%25dev`. After this PR, it correctly uses the single-unquoted value.
1 parent bfb017a commit 7f322c1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/cool_seq_tool/sources/uta_database.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from os import environ
66
from typing import Any, Literal, TypeVar
77
from urllib.parse import ParseResult as UrlLibParseResult
8-
from urllib.parse import quote, unquote, urlparse
8+
from urllib.parse import unquote, urlparse
99

1010
import asyncpg
1111
import boto3
@@ -101,8 +101,7 @@ def __init__(self, db_url: str = UTA_DB_URL) -> None:
101101
"""
102102
self.schema = None
103103
self._connection_pool = None
104-
original_pwd = db_url.split("//")[-1].split("@")[0].split(":")[-1]
105-
self.db_url = db_url.replace(original_pwd, quote(original_pwd))
104+
self.db_url = db_url
106105
self.args = self._get_conn_args()
107106

108107
def _get_conn_args(self) -> DbConnectionArgs:

0 commit comments

Comments
 (0)