Skip to content

Commit 58c3ffe

Browse files
committed
Add OAuth2 support to IbisTrinoConnection
Add support for OAuth2 authentication in IbisTrinoConnection. * Add `OAuth2Authentication` interface to handle OAuth2 authentication in `wren-ui/src/apollo/server/adaptors/ibisAdaptor.ts`. * Update `IbisTrinoConnectionInfo` interface to include optional `auth` field for OAuth2 authentication. * Add fields for OAuth2 client ID, client secret, and token URL in `TrinoProperties` component in `wren-ui/src/components/pages/setup/dataSources/TrinoProperties.tsx`. * Update form submission logic to include OAuth2 fields in `TrinoProperties` component.
1 parent 33d8c19 commit 58c3ffe

2 files changed

Lines changed: 43 additions & 0 deletions

File tree

wren-ui/src/apollo/server/adaptors/ibisAdaptor.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export interface IbisTrinoConnectionInfo {
5353
schema: string;
5454
user: string;
5555
password: string;
56+
auth?: OAuth2Authentication;
5657
}
5758

5859
export interface IbisSnowflakeConnectionInfo {
@@ -63,6 +64,12 @@ export interface IbisSnowflakeConnectionInfo {
6364
schema: string;
6465
}
6566

67+
export interface OAuth2Authentication {
68+
clientId: string;
69+
clientSecret: string;
70+
tokenUrl: string;
71+
}
72+
6673
export type IbisConnectionInfo =
6774
| UrlBasedConnectionInfo
6875
| HostBasedConnectionInfo

wren-ui/src/components/pages/setup/dataSources/TrinoProperties.tsx

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,42 @@ export default function TrinoProperties({ mode }: Props) {
8989
>
9090
<Input.Password placeholder="Input password" />
9191
</Form.Item>
92+
<Form.Item
93+
label="OAuth2 Client ID"
94+
name="clientId"
95+
rules={[
96+
{
97+
required: false,
98+
message: ERROR_TEXTS.CONNECTION.CLIENT_ID.REQUIRED,
99+
},
100+
]}
101+
>
102+
<Input placeholder="OAuth2 Client ID" />
103+
</Form.Item>
104+
<Form.Item
105+
label="OAuth2 Client Secret"
106+
name="clientSecret"
107+
rules={[
108+
{
109+
required: false,
110+
message: ERROR_TEXTS.CONNECTION.CLIENT_SECRET.REQUIRED,
111+
},
112+
]}
113+
>
114+
<Input.Password placeholder="OAuth2 Client Secret" />
115+
</Form.Item>
116+
<Form.Item
117+
label="OAuth2 Token URL"
118+
name="tokenUrl"
119+
rules={[
120+
{
121+
required: false,
122+
message: ERROR_TEXTS.CONNECTION.TOKEN_URL.REQUIRED,
123+
},
124+
]}
125+
>
126+
<Input placeholder="OAuth2 Token URL" />
127+
</Form.Item>
92128
<Form.Item label="Use SSL" name="ssl" valuePropName="checked">
93129
<Switch />
94130
</Form.Item>

0 commit comments

Comments
 (0)