Skip to content
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
16 changes: 12 additions & 4 deletions wren-ui/src/apollo/server/dataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,23 @@ const dataSource = {
DataSourceName.ATHENA,
connectionInfo,
);
const { awsAccessKey, awsRegion, awsSecretKey, s3StagingDir, schema, webIdentityToken, roleArn, roleSessionName } =
decryptedConnectionInfo as ATHENA_CONNECTION_INFO;

const {
awsAccessKey,
awsRegion,
awsSecretKey,
s3StagingDir,
schema,
webIdentityToken,
roleArn,
roleSessionName,
} = decryptedConnectionInfo as ATHENA_CONNECTION_INFO;

// Base fields shared by both authentication methods
const base = {
region_name: awsRegion,
s3_staging_dir: s3StagingDir,
schema_name: schema,
};
};
// If OIDC fields are provided → send OIDC config
if (webIdentityToken && roleArn) {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,7 @@ export default function AthenaProperties(props: Props) {

const initialTypeRef = useRef<ATHENA_AUTH_METHOD | null>(null);

const authType = Form.useWatch(
'athenaAuthType',
form,
) as ATHENA_AUTH_METHOD;
const authType = Form.useWatch('athenaAuthType', form) as ATHENA_AUTH_METHOD;

// Set default auth type when creating
useEffect(() => {
Expand Down Expand Up @@ -193,7 +190,7 @@ export default function AthenaProperties(props: Props) {
>
<Input placeholder="us-east-1" disabled={isEditMode} />
</Form.Item>

{/* Authentication method switch */}
<Form.Item label="Authentication method" name="athenaAuthType">
<Radio.Group buttonStyle="solid">
Expand All @@ -214,16 +211,14 @@ export default function AthenaProperties(props: Props) {

{authType === ATHENA_AUTH_METHOD.oidc && (
<AthenaOIDCFields
isEditMode={getIsEditModeForComponent(
ATHENA_AUTH_METHOD.oidc,
)}
isEditMode={getIsEditModeForComponent(ATHENA_AUTH_METHOD.oidc)}
/>
)}

{authType === ATHENA_AUTH_METHOD.instance_profile && (
<div className="gray-8" style={{ fontStyle: 'italic'}}>
We will automatically detect AWS credentials from the Instance Profile role
assigned to this compute environment (EC2, ECS, EKS).
<div className="gray-8" style={{ fontStyle: 'italic' }}>
We will automatically detect AWS credentials from the Instance Profile
role assigned to this compute environment (EC2, ECS, EKS).
</div>
)}
</>
Expand Down