feat: add support for postgres ssl mode and root cert (#3182)

this PR adds support for configuring `sslmode` and `sslrootcert` when
initiating the psycopg2 connection.

closes #3181
This commit is contained in:
Maor Friedman 2025-08-18 20:24:24 +03:00 committed by GitHub
parent fa431e15e0
commit 739b18edf8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View file

@ -75,6 +75,8 @@ class PostgresKVStoreConfig(CommonConfig):
db: str = "llamastack"
user: str
password: str | None = None
ssl_mode: str | None = None
ca_cert_path: str | None = None
table_name: str = "llamastack_kvstore"
@classmethod

View file

@ -30,6 +30,8 @@ class PostgresKVStoreImpl(KVStore):
database=self.config.db,
user=self.config.user,
password=self.config.password,
sslmode=self.config.ssl_mode,
sslrootcert=self.config.ca_cert_path,
)
self.conn.autocommit = True
self.cursor = self.conn.cursor(cursor_factory=DictCursor)