Skip to content

Commit 77476df

Browse files
committed
0.9.4.1 - add toggle for encoding password for postgres
1 parent 5ead946 commit 77476df

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Copyright (C) - 2023 - 2025 - Cosmo Tech
22
# Licensed under the MIT license.
33

4-
__version__ = '0.9.4'
4+
__version__ = '0.9.4.1'

cosmotech/coal/utils/postgresql.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,14 @@ def generate_postgresql_full_uri(
2121
postgres_port: str,
2222
postgres_db: str,
2323
postgres_user: str,
24-
postgres_password: str, ) -> str:
24+
postgres_password: str,
25+
force_encode: bool = False) -> str:
2526
# Check if password needs percent encoding (contains special characters)
2627
# We don't log anything about the password for security
27-
encoded_password = quote(postgres_password, safe='')
28+
encoded_password = postgres_password
29+
if force_encode:
30+
encoded_password = quote(postgres_password, safe='')
31+
2832
return ('postgresql://' +
2933
f'{postgres_user}'
3034
f':{encoded_password}'

0 commit comments

Comments
 (0)