refactor: remove backend-only system feature fields (#39543)

This commit is contained in:
yyh
2026-07-25 02:01:12 +00:00
committed by GitHub
parent 58f83fa7e7
commit aff5c47541
34 changed files with 267 additions and 366 deletions
@@ -28,26 +28,21 @@ export const license = {
}
/**
* Get system-wide feature configuration
* Get the non-sensitive bootstrap snapshot exposed before authentication
*
* Get system-wide feature configuration
* NOTE: This endpoint is unauthenticated by design, as it provides system features
* data required for dashboard initialization.
*
* Authentication would create circular dependency (can't login without dashboard loading).
*
* Only non-sensitive configuration data should be returned by this endpoint. Authenticated
* license detail is served separately by SystemFeatureLicenseApi.
* Get the non-sensitive bootstrap snapshot exposed before Console or Web authentication. This is not a general feature registry.
* Authentication configuration must be available before the authentication flow can be selected.
* Authenticated license detail is served separately by SystemFeatureLicenseApi.
*/
export const get2 = oc
.route({
description:
"Get system-wide feature configuration\nNOTE: This endpoint is unauthenticated by design, as it provides system features\ndata required for dashboard initialization.\n\nAuthentication would create circular dependency (can't login without dashboard loading).\n\nOnly non-sensitive configuration data should be returned by this endpoint. Authenticated\nlicense detail is served separately by SystemFeatureLicenseApi.",
'Get the non-sensitive bootstrap snapshot exposed before Console or Web authentication. This is not a general feature registry.\nAuthentication configuration must be available before the authentication flow can be selected.\nAuthenticated license detail is served separately by SystemFeatureLicenseApi.',
inputStructure: 'detailed',
method: 'GET',
operationId: 'getSystemFeatures',
path: '/system-features',
summary: 'Get system-wide feature configuration',
summary: 'Get the non-sensitive bootstrap snapshot exposed before authentication',
tags: ['console'],
})
.output(zGetSystemFeaturesResponse)
@@ -19,14 +19,11 @@ export type SystemFeatureModel = {
enable_social_oauth_login: boolean
enable_step_by_step_tour: boolean
enable_trial_app: boolean
is_allow_create_workspace: boolean
is_allow_register: boolean
is_email_setup: boolean
knowledge_fs_enabled: boolean
license: LicenseStatusModel
max_plugin_package_size: number
plugin_installation_permission: PluginInstallationPermissionModel
plugin_manager: PluginManagerModel
rbac_enabled: boolean
sso_enforced_for_signin: boolean
sso_enforced_for_signin_protocol: string
@@ -59,10 +56,6 @@ export type PluginInstallationPermissionModel = {
restrict_to_marketplace_only: boolean
}
export type PluginManagerModel = {
enabled: boolean
}
export type WebAppAuthModel = {
allow_email_code_login: boolean
allow_email_password_login: boolean
@@ -20,13 +20,6 @@ export const zBrandingModel = z.object({
*/
export const zDeploymentEdition = z.enum(['CLOUD', 'COMMUNITY', 'ENTERPRISE'])
/**
* PluginManagerModel
*/
export const zPluginManagerModel = z.object({
enabled: z.boolean().default(false),
})
/**
* LicenseLimitationModel
*
@@ -109,6 +102,8 @@ export const zWebAppAuthModel = z.object({
/**
* SystemFeatureModel
*
* Non-sensitive bootstrap snapshot exposed before Console or Web authentication.
*/
export const zSystemFeatureModel = z.object({
branding: zBrandingModel.default({
@@ -131,17 +126,14 @@ export const zSystemFeatureModel = z.object({
enable_social_oauth_login: z.boolean().default(false),
enable_step_by_step_tour: z.boolean().default(false),
enable_trial_app: z.boolean().default(false),
is_allow_create_workspace: z.boolean().default(false),
is_allow_register: z.boolean().default(false),
is_email_setup: z.boolean().default(false),
knowledge_fs_enabled: z.boolean().default(false),
license: zLicenseStatusModel.default({ status: 'none' }),
max_plugin_package_size: z.int().default(15728640),
plugin_installation_permission: zPluginInstallationPermissionModel.default({
plugin_installation_scope: 'all',
restrict_to_marketplace_only: false,
}),
plugin_manager: zPluginManagerModel.default({ enabled: false }),
rbac_enabled: z.boolean().default(false),
sso_enforced_for_signin: z.boolean().default(false),
sso_enforced_for_signin_protocol: z.string().default(''),
@@ -939,34 +939,23 @@ export const site = {
}
/**
* Get system feature flags and configuration
*
* Get system feature flags and configuration
* Returns the current system feature flags and configuration
* that control various functionalities across the platform.
*
* Returns:
* dict: System feature configuration object
* Get the non-sensitive bootstrap snapshot exposed before authentication
*
* Get the non-sensitive bootstrap snapshot exposed before Console or Web authentication. This is not a general feature registry.
* This endpoint is akin to the `SystemFeatureApi` endpoint in api/controllers/console/feature.py,
* except it is intended for use by the web app, instead of the console dashboard.
*
* NOTE: This endpoint is unauthenticated by design, as it provides system features
* data required for webapp initialization.
*
* Authentication would create circular dependency (can't authenticate without webapp loading).
*
* Only non-sensitive configuration data should be returned by this endpoint.
* Authentication configuration must be available before the authentication flow can be selected.
*/
export const get13 = oc
.route({
description:
"Get system feature flags and configuration\nReturns the current system feature flags and configuration\nthat control various functionalities across the platform.\n\nReturns:\n dict: System feature configuration object\n\nThis endpoint is akin to the `SystemFeatureApi` endpoint in api/controllers/console/feature.py,\nexcept it is intended for use by the web app, instead of the console dashboard.\n\nNOTE: This endpoint is unauthenticated by design, as it provides system features\ndata required for webapp initialization.\n\nAuthentication would create circular dependency (can't authenticate without webapp loading).\n\nOnly non-sensitive configuration data should be returned by this endpoint.",
'Get the non-sensitive bootstrap snapshot exposed before Console or Web authentication. This is not a general feature registry.\nThis endpoint is akin to the `SystemFeatureApi` endpoint in api/controllers/console/feature.py,\nexcept it is intended for use by the web app, instead of the console dashboard.\n\nAuthentication configuration must be available before the authentication flow can be selected.',
inputStructure: 'detailed',
method: 'GET',
operationId: 'getSystemFeatures',
path: '/system-features',
summary: 'Get system feature flags and configuration',
summary: 'Get the non-sensitive bootstrap snapshot exposed before authentication',
tags: ['web'],
})
.output(zGetSystemFeaturesResponse)
@@ -390,10 +390,6 @@ export type PluginInstallationScope =
| 'official_and_specific_partners'
| 'official_only'
export type PluginManagerModel = {
enabled: boolean
}
export type RemoteFileInfo = {
file_length: number
file_type: string
@@ -516,14 +512,11 @@ export type SystemFeatureModel = {
enable_social_oauth_login: boolean
enable_step_by_step_tour: boolean
enable_trial_app: boolean
is_allow_create_workspace: boolean
is_allow_register: boolean
is_email_setup: boolean
knowledge_fs_enabled: boolean
license: LicenseStatusModel
max_plugin_package_size: number
plugin_installation_permission: PluginInstallationPermissionModel
plugin_manager: PluginManagerModel
rbac_enabled: boolean
sso_enforced_for_signin: boolean
sso_enforced_for_signin_protocol: string
@@ -454,13 +454,6 @@ export const zPluginInstallationPermissionModel = z.object({
restrict_to_marketplace_only: z.boolean().default(false),
})
/**
* PluginManagerModel
*/
export const zPluginManagerModel = z.object({
enabled: z.boolean().default(false),
})
/**
* RemoteFileInfo
*/
@@ -756,6 +749,8 @@ export const zWebAppAuthModel = z.object({
/**
* SystemFeatureModel
*
* Non-sensitive bootstrap snapshot exposed before Console or Web authentication.
*/
export const zSystemFeatureModel = z.object({
branding: zBrandingModel.default({
@@ -778,17 +773,14 @@ export const zSystemFeatureModel = z.object({
enable_social_oauth_login: z.boolean().default(false),
enable_step_by_step_tour: z.boolean().default(false),
enable_trial_app: z.boolean().default(false),
is_allow_create_workspace: z.boolean().default(false),
is_allow_register: z.boolean().default(false),
is_email_setup: z.boolean().default(false),
knowledge_fs_enabled: z.boolean().default(false),
license: zLicenseStatusModel.default({ status: 'none' }),
max_plugin_package_size: z.int().default(15728640),
plugin_installation_permission: zPluginInstallationPermissionModel.default({
plugin_installation_scope: 'all',
restrict_to_marketplace_only: false,
}),
plugin_manager: zPluginManagerModel.default({ enabled: false }),
rbac_enabled: z.boolean().default(false),
sso_enforced_for_signin: z.boolean().default(false),
sso_enforced_for_signin_protocol: z.string().default(''),