diff --git a/frontend/src/component/admin/menu/AdminMenu.tsx b/frontend/src/component/admin/menu/AdminMenu.tsx index b7de0a76ed..84fcfb1523 100644 --- a/frontend/src/component/admin/menu/AdminMenu.tsx +++ b/frontend/src/component/admin/menu/AdminMenu.tsx @@ -12,7 +12,7 @@ const StyledPaper = styled(Paper)(({ theme }) => ({ })); function AdminMenu() { - const { uiConfig } = useUiConfig(); + const { uiConfig, isEnterprise } = useUiConfig(); const { pathname } = useLocation(); const { isBilling } = useInstanceStatus(); const { flags } = uiConfig; @@ -35,7 +35,7 @@ function AdminMenu() { } /> - {flags.serviceAccounts && ( + {isEnterprise() && ( { - const { uiConfig, isEnterprise } = useUiConfig(); + const { isEnterprise } = useUiConfig(); const { data, error, mutate } = useConditionalSWR( - Boolean(uiConfig.flags.serviceAccounts) && isEnterprise(), + isEnterprise(), { tokens: [] }, formatApiPath(`api/admin/service-account/${id}/token`), fetcher diff --git a/frontend/src/hooks/api/getters/useServiceAccounts/useServiceAccounts.ts b/frontend/src/hooks/api/getters/useServiceAccounts/useServiceAccounts.ts index b5eeaaf619..9e709b51ef 100644 --- a/frontend/src/hooks/api/getters/useServiceAccounts/useServiceAccounts.ts +++ b/frontend/src/hooks/api/getters/useServiceAccounts/useServiceAccounts.ts @@ -10,7 +10,7 @@ export const useServiceAccounts = () => { const { uiConfig, isEnterprise } = useUiConfig(); const { data, error, mutate } = useConditionalSWR( - Boolean(uiConfig.flags.serviceAccounts) && isEnterprise(), + isEnterprise(), { serviceAccounts: [], rootRoles: [] }, formatApiPath(`api/admin/service-account`), fetcher diff --git a/frontend/src/interfaces/uiConfig.ts b/frontend/src/interfaces/uiConfig.ts index d13b90af45..e5536f3363 100644 --- a/frontend/src/interfaces/uiConfig.ts +++ b/frontend/src/interfaces/uiConfig.ts @@ -43,7 +43,6 @@ export interface IFlags { maintenance?: boolean; maintenanceMode?: boolean; messageBanner?: boolean; - serviceAccounts?: boolean; featuresExportImport?: boolean; newProjectOverview?: boolean; caseInsensitiveInOperators?: boolean; diff --git a/src/lib/__snapshots__/create-config.test.ts.snap b/src/lib/__snapshots__/create-config.test.ts.snap index f459f90b44..bb08afe436 100644 --- a/src/lib/__snapshots__/create-config.test.ts.snap +++ b/src/lib/__snapshots__/create-config.test.ts.snap @@ -82,7 +82,6 @@ exports[`should create default config 1`] = ` "projectStatusApi": false, "proxyReturnAllToggles": false, "responseTimeWithAppName": false, - "serviceAccounts": false, "showProjectApiAccess": false, "variantsPerEnvironment": false, }, @@ -104,7 +103,6 @@ exports[`should create default config 1`] = ` "projectStatusApi": false, "proxyReturnAllToggles": false, "responseTimeWithAppName": false, - "serviceAccounts": false, "showProjectApiAccess": false, "variantsPerEnvironment": false, }, diff --git a/src/lib/openapi/util/openapi-tags.ts b/src/lib/openapi/util/openapi-tags.ts index 50b30991c2..f83ff1ebdc 100644 --- a/src/lib/openapi/util/openapi-tags.ts +++ b/src/lib/openapi/util/openapi-tags.ts @@ -18,6 +18,11 @@ const OPENAPI_TAGS = [ description: 'Create, update, and delete [Personal access tokens](https://docs.getunleash.io/reference/api-tokens-and-client-keys#personal-access-tokens).', }, + { + name: 'Service Accounts', + description: + 'Endpoints for managing [Service Accounts](https://docs.getunleash.io/reference/service-accounts), which enable programmatic access to the Unleash API.', + }, { name: 'Archive', description: diff --git a/src/lib/types/experimental.ts b/src/lib/types/experimental.ts index 4a0dd55c13..12d59ec021 100644 --- a/src/lib/types/experimental.ts +++ b/src/lib/types/experimental.ts @@ -50,10 +50,6 @@ const flags = { process.env.UNLEASH_EXPERIMENTAL_MESSAGE_BANNER, false, ), - serviceAccounts: parseEnvVarBoolean( - process.env.UNLEASH_EXPERIMENTAL_SERVICE_ACCOUNTS, - false, - ), featuresExportImport: parseEnvVarBoolean( process.env.UNLEASH_EXPERIMENTAL_FEATURES_EXPORT_IMPORT, false, diff --git a/src/test/e2e/api/openapi/__snapshots__/openapi.e2e.test.ts.snap b/src/test/e2e/api/openapi/__snapshots__/openapi.e2e.test.ts.snap index 59ca8611fa..5844f82e87 100644 --- a/src/test/e2e/api/openapi/__snapshots__/openapi.e2e.test.ts.snap +++ b/src/test/e2e/api/openapi/__snapshots__/openapi.e2e.test.ts.snap @@ -8423,6 +8423,10 @@ If the provided project does not exist, the list of events will be empty.", "description": "Create, update, delete, and manage [segments](https://docs.getunleash.io/reference/segments).", "name": "Segments", }, + { + "description": "Endpoints for managing [Service Accounts](https://docs.getunleash.io/reference/service-accounts), which enable programmatic access to the Unleash API.", + "name": "Service Accounts", + }, { "description": "Create, update, delete, manage [custom strategies](https://docs.getunleash.io/reference/custom-activation-strategies).", "name": "Strategies", diff --git a/website/docs/how-to/how-to-create-service-accounts.mdx b/website/docs/how-to/how-to-create-service-accounts.mdx index 86d6c5532d..d0fd5dcded 100644 --- a/website/docs/how-to/how-to-create-service-accounts.mdx +++ b/website/docs/how-to/how-to-create-service-accounts.mdx @@ -4,7 +4,7 @@ title: How to create service accounts :::info availability -Service accounts is an upcoming enterprise feature, and is scheduled to become available in one of the next few releases. +Service accounts is an enterprise feature available from Unleash 4.21 onwards. ::: diff --git a/website/docs/reference/service-accounts.md b/website/docs/reference/service-accounts.md index 5b317b8b87..ba7e4ee6d1 100644 --- a/website/docs/reference/service-accounts.md +++ b/website/docs/reference/service-accounts.md @@ -4,7 +4,7 @@ title: Service accounts :::info -Service accounts is an upcoming enterprise feature, and is scheduled to become available in one of the next few releases. +Service accounts is an enterprise feature available from Unleash 4.21 onwards. :::