Skip to content

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

feat: feature guard for 3rd-party login (#537)

ecmadao0bfeffd01fac
diff --git a/frontend/src/locales/en.yml b/frontend/src/locales/en.yml
index 54b8ebdae2..6ad153c773 100644
--- a/frontend/src/locales/en.yml
+++ b/frontend/src/locales/en.yml
@@ -954,7 +954,7 @@ version-control:
Bytebase owners manage all the applicable VCSs here, so that project
owners can link the projects with their Git repositories from these VCSs.
description-highlight: Once configured, Bytebase will enable third party login via your
- configured VCSs
+ configured VCSs under paid subscription.
add-git-provider:
self: Add a Git provider
description: >-
@@ -1161,6 +1161,10 @@ subscription:
bb-feature-backward-compatibility:
title: Backward compatibility
desc: MySQL and TiDB support schema change with backward compatibility. @:{'subscription.upgrade'} to open this feature.
+ bb-feature-3rd-party-login:
+ title: 3rd-party login
+ desc: Bytebase auto-support 3rd-party login based on your VCS configuration. @:{'subscription.upgrade'} to open this feature.
+ login: "@:{'subscription.upgrade'} to open this feature"
bb-feature-schema-drift:
title: Schema drift
desc: "@:{'subscription.upgrade'} to unlock schema dirft auto-detection"
diff --git a/frontend/src/locales/zh-CN.yml b/frontend/src/locales/zh-CN.yml
index 78076eca29..040cd5765f 100644
--- a/frontend/src/locales/zh-CN.yml
+++ b/frontend/src/locales/zh-CN.yml
@@ -847,7 +847,7 @@ version-control:
Bytebase 支持 GitOps 工作流。该工作流下,数据库迁移脚本存储在版本控制系统上
(VCS),新创建的迁移脚本会自动触发对应的数据库变更。Bytebase 的所有者先在此配置 VCS,在这之后,项目的所有者就可以从所配置的 VCS
中选取他们的 Git 仓库。
- description-highlight: 配置 VCS 后,Bytebase 将自动开启通过 VCS 的第三方认证登录
+ description-highlight: 配置 VCS 后,在付费版订阅下,Bytebase 将自动开启通过 VCS 的第三方认证登录
add-git-provider:
self: 添加 Git 提供方
description: >-
@@ -1030,6 +1030,10 @@ subscription:
bb-feature-backward-compatibility:
title: 向后兼容
desc: MySQL 和 TiDB 支持向后兼容的 schema 迁移,可以通过@:{'subscription.upgrade'}来开启该功能。
+ bb-feature-3rd-party-login:
+ title: 第三方登录
+ desc: Bytebase 可自动根据您配置的 VCS 来支持相应的第三方登录。请通过@:{'subscription.upgrade'}来开启该功能。
+ login: "请@:{'subscription.upgrade'}来开启该功能"
bb-feature-schema-drift:
title: Schema 偏差
desc: "@:{'subscription.upgrade'}来解锁 schema 偏差异常的自动检测。"
diff --git a/frontend/src/views/SettingWorkspaceVCS.vue b/frontend/src/views/SettingWorkspaceVCS.vue
index 098943ada2..b837ee0682 100644
--- a/frontend/src/views/SettingWorkspaceVCS.vue
+++ b/frontend/src/views/SettingWorkspaceVCS.vue
@@ -16,6 +16,14 @@
</button>
</div>
<div class="pt-4 border-t">
+ <FeatureAttention
+ v-if="!has3rdPartyLoginFeature && vcsList.length > 0"
+ custom-class="mb-5"
+ feature="bb.feature.3rd-party-login"
+ :description="
+ $t('subscription.features.bb-feature-3rd-party-login.desc')
+ "
+ />
<div v-if="vcsList.length > 0" class="space-y-6">
<template v-for="(vcs, index) in vcsList" :key="index">
<VCSCard :vcs="vcs" />
@@ -65,10 +73,17 @@ export default {
});
};
+ const has3rdPartyLoginFeature = computed((): boolean => {
+ return store.getters["subscription/feature"](
+ "bb.feature.3rd-party-login"
+ );
+ });
+
return {
state,
vcsList,
addVCSProvider,
+ has3rdPartyLoginFeature,
};
},
};
diff --git a/frontend/src/views/auth/Signin.vue b/frontend/src/views/auth/Signin.vue
index 325bd38996..9335e66657 100644
--- a/frontend/src/views/auth/Signin.vue
+++ b/frontend/src/views/auth/Signin.vue
@@ -15,6 +15,8 @@
>
<n-button
class="w-full h-10 mb-2"
+ :class="'tooltip-wrapper'"
+ :disabled="!has3rdPartyLoginFeature"
@click.prevent="
() => {
state.activeAuthProvider = authProvider;
@@ -30,13 +32,21 @@
? $t("auth.sign-in.gitlab")
: authProvider.name
}}</span>
+ <span v-if="!has3rdPartyLoginFeature" class="tooltip">
+ {{ $t("subscription.features.bb-feature-3rd-party-login.login") }}
+ </span>
</n-button>
</template>
<template v-if="authProviderList.length == 0">
<n-button class="w-full h-10 mb-2" disabled>
- <img class="w-5 mr-1" :src="AuthProviderConfig['GITLAB_SELF_HOST'].iconPath" />
- <span class="text-center font-semibold align-middle">{{ $t("auth.sign-in.gitlab-oauth") }}</span>
+ <img
+ class="w-5 mr-1"
+ :src="AuthProviderConfig['GITLAB_SELF_HOST'].iconPath"
+ />
+ <span class="text-center font-semibold align-middle">{{
+ $t("auth.sign-in.gitlab-oauth")
+ }}</span>
</n-button>
</template>
</div>
@@ -269,6 +279,12 @@ export default {
);
};
+ const has3rdPartyLoginFeature = computed((): boolean => {
+ return store.getters["subscription/feature"](
+ "bb.feature.3rd-party-login"
+ );
+ });
+
return {
state,
allowSignin,
@@ -276,6 +292,7 @@ export default {
AuthProviderConfig,
trySignin,
trySigninWithOAuth,
+ has3rdPartyLoginFeature,
};
},
};