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

Added TrustServerCertificate param in connectionInfo #746

Merged
merged 6 commits into from
Oct 23, 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
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ Please note that our [Code of Conduct](./CODE_OF_CONDUCT.md) applies to all Wren
<sub><b>grieve54706</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/hpatel292-seneca">
<img src="https://avatars.githubusercontent.com/u/100322816?v=4" width="100;" alt="hpatel292-seneca"/>
Expand Down Expand Up @@ -309,6 +311,13 @@ Please note that our [Code of Conduct](./CODE_OF_CONDUCT.md) applies to all Wren
<br />
<sub><b>Nishant Rana</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/saai-syvendra">
<img src="https://avatars.githubusercontent.com/u/157691467?v=4" width="100;" alt="saai-syvendra"/>
<br />
<sub><b>Saai Syvendra</b></sub>
</a>
</td>
</tr>
<tr>
Expand Down
14 changes: 12 additions & 2 deletions wren-ui/src/apollo/server/dataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,19 @@ const dataSource = {
DataSourceName.MSSQL,
connectionInfo,
);
const { host, port, database, user, password } =
const { host, port, database, user, password, trustServerCertificate } =
decryptedConnectionInfo as MS_SQL_CONNECTION_INFO;
return { host, port, database, user, password };

return {
host,
port,
database,
user,
password,
...(trustServerCertificate && {
kwargs: { trustServerCertificate: 'YES' },
}),
};
},
} as IDataSourceConnectionInfo<
MS_SQL_CONNECTION_INFO,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export interface MS_SQL_CONNECTION_INFO {
user: string;
password: string;
database: string;
trustServerCertificate: boolean;
}

export interface CLICK_HOUSE_CONNECTION_INFO {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Form, Input } from 'antd';
import { Form, Input, Switch } from 'antd';
import { ERROR_TEXTS } from '@/utils/error';
import { FORM_MODE } from '@/utils/enum';

Expand Down Expand Up @@ -88,6 +88,14 @@ export default function SQLServerProperties(props: Props) {
>
<Input placeholder="SQL Server database name" disabled={isEditMode} />
</Form.Item>
<Form.Item
extra="This parameter is used to skip server certificate validation. If you are using a trusted certificate, you can disable it."
label="Enable Trust Server Certificate"
name="trustServerCertificate"
valuePropName="checked"
>
<Switch defaultChecked />
</Form.Item>
</>
);
}