1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-04-10 15:47:32 +00:00

Drop the AB SSO feature flag.

This commit is contained in:
Peter Evans 2025-03-11 13:59:31 +00:00
parent 8f9a30d84f
commit 028ea9178e
7 changed files with 49 additions and 16 deletions
changelog/entries/unreleased/feature
enterprise/web-frontend/modules/baserow_enterprise
web-frontend/modules

View file

@ -0,0 +1,8 @@
{
"type": "feature",
"message": "Introduced Saml and OpenID Connect authentication in the application builder.",
"domain": "builder",
"issue_number": 3167,
"bullet_points": [],
"created_at": "2025-03-07"
}

View file

@ -12,6 +12,7 @@ import SamlAuthLink from '@baserow_enterprise/integrations/common/components/Sam
import OIDCAuthLink from '@baserow_enterprise/integrations/common/components/OIDCAuthLink' import OIDCAuthLink from '@baserow_enterprise/integrations/common/components/OIDCAuthLink'
import OpenIdIcon from '@baserow_enterprise/assets/images/providers/OpenID.svg' import OpenIdIcon from '@baserow_enterprise/assets/images/providers/OpenID.svg'
import { PasswordFieldType } from '@baserow/modules/database/fieldTypes' import { PasswordFieldType } from '@baserow/modules/database/fieldTypes'
import EnterpriseFeatures from '@baserow_enterprise/features'
export class LocalBaserowPasswordAppAuthProviderType extends AppAuthProviderType { export class LocalBaserowPasswordAppAuthProviderType extends AppAuthProviderType {
static getType() { static getType() {
@ -146,6 +147,15 @@ export class SamlAppAuthProviderType extends SamlAuthProviderTypeMixin(
getOrder() { getOrder() {
return 20 return 20
} }
/**
* `SamlAppAuthProviderType` requires the `BUILDER_SSO` feature to be enabled.
* @param {Number} workspaceId The workspace id.
* @returns {Boolean} True if the provider is disabled, false otherwise.
*/
isDeactivated(workspaceId) {
return !this.app.$hasFeature(EnterpriseFeatures.BUILDER_SSO, workspaceId)
}
} }
export class OpenIdConnectAppAuthProviderType extends OAuth2AuthProviderTypeMixin( export class OpenIdConnectAppAuthProviderType extends OAuth2AuthProviderTypeMixin(
@ -229,4 +239,13 @@ export class OpenIdConnectAppAuthProviderType extends OAuth2AuthProviderTypeMixi
getOrder() { getOrder() {
return 50 return 50
} }
/**
* `OpenIdConnectAppAuthProviderType` requires the `BUILDER_SSO` feature to be enabled.
* @param {Number} workspaceId The workspace id.
* @returns {Boolean} True if the provider is disabled, false otherwise.
*/
isDeactivated(workspaceId) {
return !this.app.$hasFeature(EnterpriseFeatures.BUILDER_SSO, workspaceId)
}
} }

View file

@ -45,6 +45,7 @@ export class EnterpriseWithoutSupportLicenseType extends LicenseType {
EnterpriseFeaturesObject.ENTERPRISE_SETTINGS, EnterpriseFeaturesObject.ENTERPRISE_SETTINGS,
EnterpriseFeaturesObject.DATA_SYNC, EnterpriseFeaturesObject.DATA_SYNC,
EnterpriseFeaturesObject.CHART_WIDGET, EnterpriseFeaturesObject.CHART_WIDGET,
EnterpriseFeaturesObject.BUILDER_SSO,
] ]
} }

View file

@ -85,10 +85,7 @@ import {
PhoneNumberFieldType, PhoneNumberFieldType,
AutonumberFieldType, AutonumberFieldType,
} from '@baserow/modules/database/fieldTypes' } from '@baserow/modules/database/fieldTypes'
import { import { FF_DASHBOARDS } from '@baserow/modules/core/plugins/featureFlags'
FF_AB_SSO,
FF_DASHBOARDS,
} from '@baserow/modules/core/plugins/featureFlags'
export default (context) => { export default (context) => {
const { app, isDev, store } = context const { app, isDev, store } = context
@ -159,16 +156,14 @@ export default (context) => {
new LocalBaserowPasswordAppAuthProviderType(context) new LocalBaserowPasswordAppAuthProviderType(context)
) )
if (app.$featureFlagIsEnabled(FF_AB_SSO)) { app.$registry.register(
app.$registry.register( 'appAuthProvider',
'appAuthProvider', new SamlAppAuthProviderType(context)
new SamlAppAuthProviderType(context) )
) app.$registry.register(
app.$registry.register( 'appAuthProvider',
'appAuthProvider', new OpenIdConnectAppAuthProviderType(context)
new OpenIdConnectAppAuthProviderType(context) )
)
}
app.$registry.register('roles', new EnterpriseAdminRoleType(context)) app.$registry.register('roles', new EnterpriseAdminRoleType(context))
app.$registry.register('roles', new EnterpriseMemberRoleType(context)) app.$registry.register('roles', new EnterpriseMemberRoleType(context))

View file

@ -147,7 +147,9 @@ export default {
) )
}, },
appAuthProviderTypes() { appAuthProviderTypes() {
return this.$registry.getOrderedList('appAuthProvider') return this.$registry
.getOrderedList('appAuthProvider')
.filter((type) => !type.isDeactivated(this.builder.workspace.id))
}, },
appAuthProviderPerTypes() { appAuthProviderPerTypes() {
return Object.fromEntries( return Object.fromEntries(

View file

@ -41,4 +41,13 @@ export class AppAuthProviderType extends BaseAuthProviderType {
handleError(userSource, authProvider, route) { handleError(userSource, authProvider, route) {
return null return null
} }
/**
* Returns whether the provider is enabled or not.
* @param {Number} workspaceId The workspace id.
* @returns {Boolean} True if the provider is disabled, false otherwise.
*/
isDeactivated(workspaceId) {
return false
}
} }

View file

@ -1,6 +1,5 @@
const FF_ENABLE_ALL = '*' const FF_ENABLE_ALL = '*'
export const FF_DASHBOARDS = 'dashboards' export const FF_DASHBOARDS = 'dashboards'
export const FF_AB_SSO = 'ab_sso'
/** /**
* A comma separated list of feature flags used to enable in-progress or not ready * A comma separated list of feature flags used to enable in-progress or not ready