Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: bq iam auth (#12120)

Danny Xu0a0643041b02
diff --git a/frontend/src/components/InstanceForm/DataSourceSection/DataSourceForm.vue b/frontend/src/components/InstanceForm/DataSourceSection/DataSourceForm.vue
index da76124590..bc00f3a375 100644
--- a/frontend/src/components/InstanceForm/DataSourceSection/DataSourceForm.vue
+++ b/frontend/src/components/InstanceForm/DataSourceSection/DataSourceForm.vue
@@ -477,12 +477,35 @@
</div>
</div>
</template>
- <GcpCredentialInput
- v-if="basicInfo.engine === Engine.SPANNER || basicInfo.engine === Engine.BIGQUERY"
- v-model:value="dataSource.updatedPassword"
- :write-only="!isCreating"
- class="mt-4 sm:col-span-3 sm:col-start-1"
- />
+ <template
+ v-if="basicInfo.engine === Engine.SPANNER || basicInfo.engine === Engine.BIGQUERY"
+ >
+ <div
+ class="mt-2 sm:col-span-3 sm:col-start-1"
+ >
+ <NRadioGroup
+ v-model:value="dataSource.authenticationType"
+ class="textlabel"
+ :disabled="!allowEdit"
+ >
+ <NRadio :value="DataSource_AuthenticationType.PASSWORD">
+ {{ $t("common.credentials") }}
+ </NRadio>
+ <NRadio :value="DataSource_AuthenticationType.GOOGLE_CLOUD_SQL_IAM">
+ {{ $t("instance.password-type.google-iam") }}
+ </NRadio>
+ </NRadioGroup>
+ </div>
+
+ <GcpCredentialInput
+ v-if="
+ dataSource.authenticationType === DataSource_AuthenticationType.PASSWORD
+ "
+ v-model:value="dataSource.updatedPassword"
+ :write-only="!isCreating"
+ class="mt-4 sm:col-span-3 sm:col-start-1"
+ />
+ </template>
<template v-if="basicInfo.engine === Engine.ORACLE">
<OracleSIDAndServiceNameInput
diff --git a/frontend/src/components/InstanceForm/InstanceForm.vue b/frontend/src/components/InstanceForm/InstanceForm.vue
index 49d8bcc147..db89911834 100644
--- a/frontend/src/components/InstanceForm/InstanceForm.vue
+++ b/frontend/src/components/InstanceForm/InstanceForm.vue
@@ -1416,6 +1416,8 @@ const checkDataSource = (dataSources: DataSource[]) => {
if (
ds.authenticationType ===
DataSource_AuthenticationType.GOOGLE_CLOUD_SQL_IAM
+ &&
+ (basicInfo.value.engine === Engine.MYSQL || basicInfo.value.engine === Engine.POSTGRES)
) {
// CloudSQL instance name should be {project}:{region}:{cloud sql name}
return /.+:.+:.+/.test(ds.host);