1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

chore: service accounts GA (#3059)

## About the changes
This PR prepares the GA of service accounts: OpenAPI tags, documentation
and flag removal

Relates to [roadmap](https://github.com/orgs/Unleash/projects/10) item:
#2942

---------

Co-authored-by: Nuno Góis <github@nunogois.com>
This commit is contained in:
Gastón Fournier 2023-02-08 11:59:24 +01:00 committed by GitHub
parent 1ca918295a
commit 354b5b2976
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 17 additions and 16 deletions

View File

@ -12,7 +12,7 @@ const StyledPaper = styled(Paper)(({ theme }) => ({
})); }));
function AdminMenu() { function AdminMenu() {
const { uiConfig } = useUiConfig(); const { uiConfig, isEnterprise } = useUiConfig();
const { pathname } = useLocation(); const { pathname } = useLocation();
const { isBilling } = useInstanceStatus(); const { isBilling } = useInstanceStatus();
const { flags } = uiConfig; const { flags } = uiConfig;
@ -35,7 +35,7 @@ function AdminMenu() {
</CenteredNavLink> </CenteredNavLink>
} }
/> />
{flags.serviceAccounts && ( {isEnterprise() && (
<Tab <Tab
value="service-accounts" value="service-accounts"
label={ label={

View File

@ -468,8 +468,7 @@ export const adminMenuRoutes: INavigationMenuItem[] = [
{ {
path: '/admin/service-accounts', path: '/admin/service-accounts',
title: 'Service accounts', title: 'Service accounts',
menu: { adminSettings: true }, menu: { adminSettings: true, isEnterprise: true },
flag: 'serviceAccounts',
}, },
{ {
path: '/admin/network/*', path: '/admin/network/*',

View File

@ -12,10 +12,10 @@ export interface IUseServiceAccountTokensOutput {
} }
export const useServiceAccountTokens = (id: number) => { export const useServiceAccountTokens = (id: number) => {
const { uiConfig, isEnterprise } = useUiConfig(); const { isEnterprise } = useUiConfig();
const { data, error, mutate } = useConditionalSWR( const { data, error, mutate } = useConditionalSWR(
Boolean(uiConfig.flags.serviceAccounts) && isEnterprise(), isEnterprise(),
{ tokens: [] }, { tokens: [] },
formatApiPath(`api/admin/service-account/${id}/token`), formatApiPath(`api/admin/service-account/${id}/token`),
fetcher fetcher

View File

@ -10,7 +10,7 @@ export const useServiceAccounts = () => {
const { uiConfig, isEnterprise } = useUiConfig(); const { uiConfig, isEnterprise } = useUiConfig();
const { data, error, mutate } = useConditionalSWR( const { data, error, mutate } = useConditionalSWR(
Boolean(uiConfig.flags.serviceAccounts) && isEnterprise(), isEnterprise(),
{ serviceAccounts: [], rootRoles: [] }, { serviceAccounts: [], rootRoles: [] },
formatApiPath(`api/admin/service-account`), formatApiPath(`api/admin/service-account`),
fetcher fetcher

View File

@ -43,7 +43,6 @@ export interface IFlags {
maintenance?: boolean; maintenance?: boolean;
maintenanceMode?: boolean; maintenanceMode?: boolean;
messageBanner?: boolean; messageBanner?: boolean;
serviceAccounts?: boolean;
featuresExportImport?: boolean; featuresExportImport?: boolean;
newProjectOverview?: boolean; newProjectOverview?: boolean;
caseInsensitiveInOperators?: boolean; caseInsensitiveInOperators?: boolean;

View File

@ -82,7 +82,6 @@ exports[`should create default config 1`] = `
"projectStatusApi": false, "projectStatusApi": false,
"proxyReturnAllToggles": false, "proxyReturnAllToggles": false,
"responseTimeWithAppName": false, "responseTimeWithAppName": false,
"serviceAccounts": false,
"showProjectApiAccess": false, "showProjectApiAccess": false,
"variantsPerEnvironment": false, "variantsPerEnvironment": false,
}, },
@ -104,7 +103,6 @@ exports[`should create default config 1`] = `
"projectStatusApi": false, "projectStatusApi": false,
"proxyReturnAllToggles": false, "proxyReturnAllToggles": false,
"responseTimeWithAppName": false, "responseTimeWithAppName": false,
"serviceAccounts": false,
"showProjectApiAccess": false, "showProjectApiAccess": false,
"variantsPerEnvironment": false, "variantsPerEnvironment": false,
}, },

View File

@ -18,6 +18,11 @@ const OPENAPI_TAGS = [
description: description:
'Create, update, and delete [Personal access tokens](https://docs.getunleash.io/reference/api-tokens-and-client-keys#personal-access-tokens).', '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', name: 'Archive',
description: description:

View File

@ -50,10 +50,6 @@ const flags = {
process.env.UNLEASH_EXPERIMENTAL_MESSAGE_BANNER, process.env.UNLEASH_EXPERIMENTAL_MESSAGE_BANNER,
false, false,
), ),
serviceAccounts: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_SERVICE_ACCOUNTS,
false,
),
featuresExportImport: parseEnvVarBoolean( featuresExportImport: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_FEATURES_EXPORT_IMPORT, process.env.UNLEASH_EXPERIMENTAL_FEATURES_EXPORT_IMPORT,
false, false,

View File

@ -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).", "description": "Create, update, delete, and manage [segments](https://docs.getunleash.io/reference/segments).",
"name": "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).", "description": "Create, update, delete, manage [custom strategies](https://docs.getunleash.io/reference/custom-activation-strategies).",
"name": "Strategies", "name": "Strategies",

View File

@ -4,7 +4,7 @@ title: How to create service accounts
:::info availability :::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.
::: :::

View File

@ -4,7 +4,7 @@ title: Service accounts
:::info :::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.
::: :::