Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use numeric port value in params and update postgres ssl configuration #194

Merged
merged 2 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions spiceaidocs/docs/data-accelerators/postgres/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ datasets:
engine: postgres
params:
pg_host: localhost
pg_port: '5432'
pg_port: 5432
pg_db: my_database
pg_user: my_user
pg_pass_key: my_secret
Expand All @@ -57,7 +57,7 @@ datasets:
name: my_dataset
params:
pg_host: localhost
pg_port: '5432'
pg_port: 5432
pg_db: data_store
pg_user: my_user
pg_pass_key: my_secret
Expand All @@ -66,7 +66,7 @@ datasets:
engine_secret: pg_backend
params:
pg_host: localhost
pg_port: '5433'
pg_port: 5433
pg_db: data_store
pg_user: my_user
pg_pass_key: my_secret
Expand Down
2 changes: 1 addition & 1 deletion spiceaidocs/docs/data-connectors/mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ datasets:
name: my_dataset
params:
mysql_host: localhost
mysql_port: '3306'
mysql_port: 3306
mysql_db: my_database
mysql_user: my_user
mysql_pass_key: my_secret
Expand Down
30 changes: 22 additions & 8 deletions spiceaidocs/docs/data-connectors/postgres/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ The connection to PostgreSQL can be configured by providing the following `param
- `pg_pass_key`: The secret key containing the password to connect with.
- `pg_pass`: The raw password to connect with, ignored if `pg_pass_key` is provided.
- `pg_sslmode`: Optional parameter, specifies the SSL/TLS behavior for the connection, supported values:
- `prefer`: (default) This mode will try to establish a secure SSL connection if possible, but will connect insecurely if the server does not support SSL.
- `required`: This mode requires an SSL connection. If a secure connection cannot be established, server will not connect.
- `verify-full`: (default) This mode requires an SSL connection, a valid root certificate, and the server host name to match the one specified in the certificate.
- `verify-ca`: This mode requires an SSL connection and a valid root certificate.
- `required`: This mode requires an SSL connection.
- `prefer`: This mode will try to establish a secure SSL connection if possible, but will connect insecurely if the server does not support SSL.
- `disable`: This mode will not attempt to use an SSL connection, even if the server supports it.
- `pg_insecure`: Optional parameter, Allows TLS connectivity to servers with invalid/expired certificates.
- `pg_sslrootcert`: Optional parameter specifying the path to a custom PEM certificate that the connector will trust.

Configuration `params` are provided either in the top level `dataset` for a dataset source and federated SQL query, or in the `acceleration` section for a data store.

Expand All @@ -38,12 +40,24 @@ datasets:
name: my_dataset
params:
pg_host: localhost
pg_port: '5432'
pg_port: 5432
pg_db: my_database
pg_user: my_user
pg_pass_key: my_secret
pg_sslmode: required
pg_insecure: 'true'
```

```yaml
datasets:
- from: postgres:path.to.my_dataset
name: my_dataset
params:
pg_host: localhost
pg_port: 5432
pg_db: my_database
pg_user: my_user
pg_pass_key: my_secret
pg_sslmode: verify-ca
pg_sslrootcert: ./custom_cert.pem
```

Additionally, an `engine_secret` may be provided when configuring a PostgreSQL data store to allow for using a different secret store to specify the password for a dataset using PostgreSQL as both the data source and data store.
Expand All @@ -54,7 +68,7 @@ datasets:
name: my_dataset
params:
pg_host: localhost
pg_port: '5432'
pg_port: 5432
pg_db: data_store
pg_user: my_user
pg_pass_key: my_secret
Expand All @@ -63,7 +77,7 @@ datasets:
engine_secret: pg_backend
params:
pg_host: localhost
pg_port: '5433'
pg_port: 5433
pg_db: data_store
pg_user: my_user
pg_pass_key: my_secret
Expand Down