Skip to content

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

feat: add sso to enterprise plan (#4548)

boojackf93ee2c2679d
diff --git a/backend/legacyapi/plan.go b/backend/legacyapi/plan.go
index a2510b17a8..13bf51f8c7 100644
--- a/backend/legacyapi/plan.go
+++ b/backend/legacyapi/plan.go
@@ -50,10 +50,12 @@ type FeatureType string
const (
// Admin & Security.
- // Feature3rdPartyAuth allows user to authenticate (login) and authorize (sync project member)
+ // Feature3rdPartyAuth allows user to authenticate (login).
//
// Currently, we only support GitLab EE/CE auth.
Feature3rdPartyAuth FeatureType = "bb.feature.3rd-party-auth"
+ // FeatureSSO allows user to manage SSO provider and authenticate (login) with SSO.
+ FeatureSSO FeatureType = "bb.feature.sso"
// FeatureRBAC enables RBAC.
//
// - Workspace level RBAC
@@ -160,6 +162,8 @@ func (e FeatureType) Name() string {
// Admin & Security
case Feature3rdPartyAuth:
return "3rd party auth"
+ case FeatureSSO:
+ return "SSO"
case FeatureRBAC:
return "RBAC"
// Branding
@@ -237,6 +241,7 @@ func (e FeatureType) minimumSupportedPlan() PlanType {
var FeatureMatrix = map[FeatureType][3]bool{
// Admin & Security
Feature3rdPartyAuth: {false, true, true},
+ FeatureSSO: {false, false, true},
FeatureRBAC: {false, true, true},
FeatureWatermark: {false, false, true},
// Branding
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 798e393abe..2058628cb1 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -403,7 +403,7 @@
},
"sso": {
"create": "Create SSO",
- "description": "Single sign-on (SSO) is an authentication method that enables users to sign in to multiple applications and websites with a single set of credentials.",
+ "description": "Single sign-on (SSO) is an authentication method that enables users to authenticate with multiple applications and websites via a single set of credentials.",
"deletion": "Delete this SSO",
"form": {
"redirect-url": "Authorization redirect url",
@@ -1688,6 +1688,10 @@
"bb-feature-read-replica-connection": {
"title": "Read replica connection",
"desc": "Connect to a read replica for the read-only data source."
+ },
+ "bb-feature-sso": {
+ "title": "Single sign-on (SSO)",
+ "desc": "Enables users to securely authenticate with multiple applications and websites via a single set of credentials."
}
}
},
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index ec34131edf..4aa44773f7 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -1689,6 +1689,10 @@
"bb-feature-read-replica-connection": {
"title": "Read replica connection",
"desc": "使用只读副本连接到只读数据源。"
+ },
+ "bb-feature-sso": {
+ "title": "Single sign-on (SSO)",
+ "desc": "使得用户能够通过 SSO 安全地进行登录 Bytebase。"
}
}
},
diff --git a/frontend/src/types/plan.ts b/frontend/src/types/plan.ts
index 4ac6de25c7..9b9e2f6d99 100644
--- a/frontend/src/types/plan.ts
+++ b/frontend/src/types/plan.ts
@@ -5,6 +5,7 @@ import planData from "./plan.yaml";
export type FeatureType =
// Admin & Security
| "bb.feature.3rd-party-auth"
+ | "bb.feature.sso"
| "bb.feature.rbac"
| "bb.feature.watermark"
// Branding
diff --git a/frontend/src/views/SettingWorkspaceSSO.vue b/frontend/src/views/SettingWorkspaceSSO.vue
index 01eb4273a4..7d1b1fa14f 100644
--- a/frontend/src/views/SettingWorkspaceSSO.vue
+++ b/frontend/src/views/SettingWorkspaceSSO.vue
@@ -5,8 +5,9 @@
{{ $t("settings.sso.description") }}
</div>
<div>
- <button class="btn-primary" @click="state.showCreatingSSOModal = true">
+ <button class="btn-primary" @click="handleCreateSSO">
{{ $t("common.create") }}
+ <FeatureBadge :feature="'bb.feature.sso'" class="ml-2" />
</button>
</div>
</div>
@@ -60,6 +61,12 @@
@confirm="handleCreateIdentityProvider"
/>
</BBModal>
+
+ <FeatureModal
+ v-if="state.showFeatureModal"
+ feature="bb.feature.sso"
+ @cancel="state.showFeatureModal = false"
+ />
</template>
<script lang="ts" setup>
@@ -70,8 +77,10 @@ import { useIdentityProviderStore } from "@/store/modules/idp";
import IdentityProviderCreateForm from "@/components/IdentityProviderCreateForm.vue";
import { IdentityProvider } from "@/types/proto/v1/idp_service";
import { identityProviderTypeToString } from "@/utils";
+import { featureToRef } from "@/store";
interface LocalState {
+ showFeatureModal: boolean;
showCreatingSSOModal: boolean;
selectedIdentityProviderName: string;
}
@@ -79,10 +88,12 @@ interface LocalState {
const route = useRoute();
const router = useRouter();
const state = reactive<LocalState>({
+ showFeatureModal: false,
showCreatingSSOModal: false,
selectedIdentityProviderName: "",
});
const identityProviderStore = useIdentityProviderStore();
+const hasSSOFeature = featureToRef("bb.feature.sso");
const identityProviderList = computed(() => {
return identityProviderStore.identityProviderList;
@@ -122,6 +133,14 @@ watch(
}
);
+const handleCreateSSO = () => {
+ if (!hasSSOFeature.value) {
+ state.showFeatureModal = true;
+ return;
+ }
+ state.showCreatingSSOModal = true;
+};
+
const hideCreateSSOModal = () => {
state.showCreatingSSOModal = false;
};
diff --git a/frontend/src/views/auth/Signin.vue b/frontend/src/views/auth/Signin.vue
index e0e84069b4..7a78907a07 100644
--- a/frontend/src/views/auth/Signin.vue
+++ b/frontend/src/views/auth/Signin.vue
@@ -169,7 +169,7 @@
<button
type="button"
class="btn-normal flex justify-center w-full h-10 mb-2 tooltip-wrapper"
- :disabled="!has3rdPartyLoginFeature"
+ :disabled="!hasSSOFeature"
@click.prevent="
() => {
trySigninWithIdentityProvider(identityProvider);
@@ -183,14 +183,15 @@
})
}}
</span>
- <span v-if="isDemo" class="tooltip">{{
- $t("auth.sign-in.3rd-party-auth-demo")
- }}</span>
- <span v-else-if="!has3rdPartyLoginFeature" class="tooltip">{{
- $t("subscription.features.bb-feature-3rd-party-auth.login")
- }}</span>
</button>
</template>
+
+ <span v-if="isDemo" class="tooltip">{{
+ $t("auth.sign-in.3rd-party-auth-demo")
+ }}</span>
+ <span v-else-if="!has3rdPartyLoginFeature" class="tooltip">{{
+ $t("subscription.features.bb-feature-3rd-party-auth.login")
+ }}</span>
</div>
</div>
@@ -406,5 +407,6 @@ const trySigninWithIdentityProvider = (identityProvider: IdentityProvider) => {
openWindowForSSO(identityProvider);
};
+const hasSSOFeature = featureToRef("bb.feature.sso");
const has3rdPartyLoginFeature = featureToRef("bb.feature.3rd-party-auth");
</script>