mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-21 01:15:10 +00:00
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:
parent
fa431e15e0
commit
739b18edf8
2 changed files with 4 additions and 0 deletions
|
@ -75,6 +75,8 @@ class PostgresKVStoreConfig(CommonConfig):
|
||||||
db: str = "llamastack"
|
db: str = "llamastack"
|
||||||
user: str
|
user: str
|
||||||
password: str | None = None
|
password: str | None = None
|
||||||
|
ssl_mode: str | None = None
|
||||||
|
ca_cert_path: str | None = None
|
||||||
table_name: str = "llamastack_kvstore"
|
table_name: str = "llamastack_kvstore"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
|
@ -30,6 +30,8 @@ class PostgresKVStoreImpl(KVStore):
|
||||||
database=self.config.db,
|
database=self.config.db,
|
||||||
user=self.config.user,
|
user=self.config.user,
|
||||||
password=self.config.password,
|
password=self.config.password,
|
||||||
|
sslmode=self.config.ssl_mode,
|
||||||
|
sslrootcert=self.config.ca_cert_path,
|
||||||
)
|
)
|
||||||
self.conn.autocommit = True
|
self.conn.autocommit = True
|
||||||
self.cursor = self.conn.cursor(cursor_factory=DictCursor)
|
self.cursor = self.conn.cursor(cursor_factory=DictCursor)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue