Skip to content

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

chore: support vault app role (#15066)

ecmadao77b870315ff7
diff --git a/frontend/src/DummyRootView.ts b/frontend/src/DummyRootView.ts
index 4865397c34..7455b16e7a 100644
--- a/frontend/src/DummyRootView.ts
+++ b/frontend/src/DummyRootView.ts
@@ -49,7 +49,8 @@ export default defineComponent({
path.startsWith("/?") ||
path.startsWith("/#") ||
path.startsWith("/403") ||
- path.startsWith("/404")
+ path.startsWith("/404") ||
+ path.startsWith("/sql-editor")
) {
return fallback();
}
diff --git a/frontend/src/components/InstanceForm/DataSourceSection/DataSourceForm.vue b/frontend/src/components/InstanceForm/DataSourceSection/DataSourceForm.vue
index 301e836d7f..5b6ad1a55d 100644
--- a/frontend/src/components/InstanceForm/DataSourceSection/DataSourceForm.vue
+++ b/frontend/src/components/InstanceForm/DataSourceSection/DataSourceForm.vue
@@ -280,24 +280,33 @@
:placeholder="$t('instance.external-secret-vault.vault-url')"
/>
</div>
- <!-- AppRole is not enabled -->
- <!-- <div class="sm:col-span-2 sm:col-start-1 space-y-2">
- <label class="textlabel block">
- {{ $t("instance.external-secret-vault.vault-auth-type.self") }}
- </label>
- <NRadioGroup
- class="textlabel mb-2"
- :value="dataSource.externalSecret.authType"
- @update:value="changeExternalSecretAuthType"
- >
- <NRadio :value="DataSourceExternalSecret_AuthType.TOKEN">
- {{ $t("instance.external-secret-vault.vault-auth-type.token.self") }}
- </NRadio>
- <NRadio :value="DataSourceExternalSecret_AuthType.VAULT_APP_ROLE">
- {{ $t("instance.external-secret-vault.vault-auth-type.approle.self") }}
- </NRadio>
- </NRadioGroup>
- </div> -->
+ <div class="sm:col-span-2 sm:col-start-1 space-y-2">
+ <label class="textlabel block">
+ {{ $t("instance.external-secret-vault.vault-auth-type.self") }}
+ </label>
+ <NRadioGroup
+ class="textlabel mb-2"
+ :value="dataSource.externalSecret.authType"
+ @update:value="changeExternalSecretAuthType"
+ >
+ <NRadio :value="DataSourceExternalSecret_AuthType.TOKEN">
+ {{
+ $t(
+ "instance.external-secret-vault.vault-auth-type.token.self"
+ )
+ }}
+ </NRadio>
+ <NRadio
+ :value="DataSourceExternalSecret_AuthType.VAULT_APP_ROLE"
+ >
+ {{
+ $t(
+ "instance.external-secret-vault.vault-auth-type.approle.self"
+ )
+ }}
+ </NRadio>
+ </NRadioGroup>
+ </div>
<div
v-if="
dataSource.externalSecret.authType ===
@@ -851,6 +860,7 @@ import {
DataSourceExternalSecret,
DataSourceExternalSecret_AuthType,
DataSourceExternalSecret_SecretType,
+ DataSourceExternalSecret_AppRoleAuthOption,
DataSourceExternalSecret_AppRoleAuthOption_SecretType,
DataSource_AuthenticationType,
} from "@/types/proto/v1/instance_service";
@@ -1011,26 +1021,25 @@ const changeSecretType = (secretType: DataSourceExternalSecret_SecretType) => {
state.passwordType = secretType;
};
-// TODO: support change auth type.
-// const changeExternalSecretAuthType = (
-// authType: DataSourceExternalSecret_AuthType
-// ) => {
-// const ds = props.dataSource;
-// if (!ds.externalSecret) {
-// return;
-// }
-// if (authType === DataSourceExternalSecret_AuthType.VAULT_APP_ROLE) {
-// ds.externalSecret.appRole =
-// DataSourceExternalSecret_AppRoleAuthOption.fromPartial({
-// type: DataSourceExternalSecret_AppRoleAuthOption_SecretType.PLAIN,
-// });
-// ds.externalSecret.token = undefined;
-// } else {
-// ds.externalSecret.token = "";
-// ds.externalSecret.appRole = undefined;
-// }
-// ds.externalSecret.authType = authType;
-// };
+const changeExternalSecretAuthType = (
+ authType: DataSourceExternalSecret_AuthType
+) => {
+ const ds = props.dataSource;
+ if (!ds.externalSecret) {
+ return;
+ }
+ if (authType === DataSourceExternalSecret_AuthType.VAULT_APP_ROLE) {
+ ds.externalSecret.appRole =
+ DataSourceExternalSecret_AppRoleAuthOption.fromPartial({
+ type: DataSourceExternalSecret_AppRoleAuthOption_SecretType.PLAIN,
+ });
+ ds.externalSecret.token = undefined;
+ } else {
+ ds.externalSecret.token = "";
+ ds.externalSecret.appRole = undefined;
+ }
+ ds.externalSecret.authType = authType;
+};
const toggleUseEmptyPassword = (on: boolean) => {
const ds = props.dataSource;
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 46820894e6..76388b86d6 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -1192,11 +1192,13 @@
"external-secret-vault": {
"vault-url": "Vault URL",
"vault-auth-type": {
+ "self": "Auth type",
"token": {
"self": "Token",
"tips": "A root token without TTL."
},
"approle": {
+ "self": "AppRole",
"role-id": "Auth role id",
"secret-id": "Auth secret id",
"secret-id-plain-text": "Plain text for role secret id",
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index a7e0834175..a2ebdbda5e 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -1192,11 +1192,13 @@
"external-secret-vault": {
"vault-url": "Vault URL",
"vault-auth-type": {
+ "self": "Tipo de autenticación",
"token": {
"self": "Simbólico",
"tips": "Un token raíz sin TTL."
},
"approle": {
+ "self": "AppRole",
"role-id": "Auth role id",
"secret-id": "Auth secret id",
"secret-id-plain-text": "Texto sin formato para identificación secreta de rol",
@@ -2750,4 +2752,4 @@
"last-visit": "Última visita",
"changelog-for-version": "Registro de cambios para {version}"
}
-}
\ No newline at end of file
+}
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index b22075bd68..feacee751d 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -1192,11 +1192,13 @@
"external-secret-vault": {
"vault-url": "ボールトの URL",
"vault-auth-type": {
+ "self": "認証タイプ",
"token": {
"self": "トークン",
"tips": "有効期限のないルートトークン"
},
"approle": {
+ "self": "AppRole",
"role-id": "認証ロールID",
"secret-id": "認証シークレットID",
"secret-id-plain-text": "シークレットIDのプレーンテキスト",
@@ -2750,4 +2752,4 @@
"last-visit": "最終訪問",
"changelog-for-version": "{version} の変更履歴"
}
-}
\ No newline at end of file
+}
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index a191f6c364..b0f6cd1b4b 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -1192,11 +1192,13 @@
"external-secret-vault": {
"vault-url": "Vault URL",
"vault-auth-type": {
+ "self": "认证方式",
"token": {
"self": "Token",
"tips": "没有过期时限的根 token"
},
"approle": {
+ "self": "AppRole",
"role-id": "Auth role id",
"secret-id": "Auth secret id",
"secret-id-plain-text": "Secret id 明文",