Skip to content

Commit f919b3b

Browse files
committed
no need to decrypt password if sqlite
1 parent 1fbdd1c commit f919b3b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/murfey/server/murfey_db.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ def url(security_config: Security | None = None) -> str:
1515
security_config = security_config or get_security_config()
1616
with open(security_config.murfey_db_credentials, "r") as stream:
1717
creds = yaml.safe_load(stream)
18-
f = Fernet(security_config.crypto_key.encode("ascii"))
19-
p = f.decrypt(creds["password"].encode("ascii"))
2018
if security_config.db == "sqlite":
2119
return f"sqlite:///{creds['database']}"
20+
f = Fernet(security_config.crypto_key.encode("ascii"))
21+
p = f.decrypt(creds["password"].encode("ascii"))
2222
return f"postgresql+psycopg2://{creds['username']}:{p.decode()}@{creds['host']}:{creds['port']}/{creds['database']}"
2323

2424

0 commit comments

Comments
 (0)