diff --git a/src/unstract/sdk/__init__.py b/src/unstract/sdk/__init__.py index cf45e2c5..e044f050 100644 --- a/src/unstract/sdk/__init__.py +++ b/src/unstract/sdk/__init__.py @@ -1,5 +1,4 @@ -__version__ = "0.39.0" - +__version__ = "0.40.0" def get_sdk_version(): diff --git a/src/unstract/sdk/adapters/vectordb/postgres/src/postgres.py b/src/unstract/sdk/adapters/vectordb/postgres/src/postgres.py index 9560c5d0..8ab057f1 100644 --- a/src/unstract/sdk/adapters/vectordb/postgres/src/postgres.py +++ b/src/unstract/sdk/adapters/vectordb/postgres/src/postgres.py @@ -20,6 +20,7 @@ class Constants: PORT = "port" USER = "user" SCHEMA = "schema" + ENABLE_SSL = "enable_ssl" class Postgres(VectorDBAdapter): @@ -82,12 +83,17 @@ def _get_vector_db_instance(self) -> BasePydanticVectorStore: table_name=self._collection_name, embed_dim=dimension, ) + if self._config.get(Constants.ENABLE_SSL, True): + ssl_mode = "require" + else: + ssl_mode = "disable" self._client = psycopg2.connect( database=self._config.get(Constants.DATABASE), host=self._config.get(Constants.HOST), user=self._config.get(Constants.USER), password=self._config.get(Constants.PASSWORD), port=str(self._config.get(Constants.PORT)), + sslmode=ssl_mode, ) return vector_db diff --git a/src/unstract/sdk/adapters/vectordb/postgres/src/static/json_schema.json b/src/unstract/sdk/adapters/vectordb/postgres/src/static/json_schema.json index 5da9c9e5..8ae51cc8 100644 --- a/src/unstract/sdk/adapters/vectordb/postgres/src/static/json_schema.json +++ b/src/unstract/sdk/adapters/vectordb/postgres/src/static/json_schema.json @@ -41,6 +41,12 @@ "title": "Password", "format": "password", "default": "" + }, + "enable_ssl": { + "type": "boolean", + "title": "Enable SSL", + "description": "On selecting the checkbox, data encryption using SSL is enabled", + "default": true } } }