mirror of
https://github.com/Unleash/unleash.git
synced 2025-06-04 01:18:20 +02:00
chore: remove references to admin token kill switch (#9324)
This feature has been removed
This commit is contained in:
parent
ca562c548d
commit
1bb2756161
@ -4,20 +4,17 @@ import { useEnvironments } from 'hooks/api/getters/useEnvironments/useEnvironmen
|
|||||||
import type { IApiTokenCreate } from 'hooks/api/actions/useApiTokensApi/useApiTokensApi';
|
import type { IApiTokenCreate } from 'hooks/api/actions/useApiTokensApi/useApiTokensApi';
|
||||||
import { TokenType } from 'interfaces/token';
|
import { TokenType } from 'interfaces/token';
|
||||||
import {
|
import {
|
||||||
ADMIN,
|
|
||||||
CREATE_FRONTEND_API_TOKEN,
|
CREATE_FRONTEND_API_TOKEN,
|
||||||
CREATE_CLIENT_API_TOKEN,
|
CREATE_CLIENT_API_TOKEN,
|
||||||
CREATE_PROJECT_API_TOKEN,
|
CREATE_PROJECT_API_TOKEN,
|
||||||
} from '@server/types/permissions';
|
} from '@server/types/permissions';
|
||||||
import { useHasRootAccess } from 'hooks/useHasAccess';
|
import { useHasRootAccess } from 'hooks/useHasAccess';
|
||||||
import type { SelectOption } from './TokenTypeSelector/TokenTypeSelector';
|
import type { SelectOption } from './TokenTypeSelector/TokenTypeSelector';
|
||||||
import { useUiFlag } from '../../../../hooks/useUiFlag';
|
|
||||||
|
|
||||||
export type ApiTokenFormErrorType = 'username' | 'projects';
|
export type ApiTokenFormErrorType = 'username' | 'projects';
|
||||||
export const useApiTokenForm = (project?: string) => {
|
export const useApiTokenForm = (project?: string) => {
|
||||||
const { environments } = useEnvironments();
|
const { environments } = useEnvironments();
|
||||||
const { uiConfig } = useUiConfig();
|
const { uiConfig } = useUiConfig();
|
||||||
const adminTokenKillSwitch = useUiFlag('adminTokenKillSwitch');
|
|
||||||
const initialEnvironment = environments?.find((e) => e.enabled)?.name;
|
const initialEnvironment = environments?.find((e) => e.enabled)?.name;
|
||||||
|
|
||||||
const hasCreateTokenPermission = useHasRootAccess(CREATE_CLIENT_API_TOKEN);
|
const hasCreateTokenPermission = useHasRootAccess(CREATE_CLIENT_API_TOKEN);
|
||||||
@ -36,20 +33,11 @@ export const useApiTokenForm = (project?: string) => {
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const hasAdminAccess = useHasRootAccess(ADMIN);
|
|
||||||
const hasCreateFrontendAccess = useHasRootAccess(CREATE_FRONTEND_API_TOKEN);
|
const hasCreateFrontendAccess = useHasRootAccess(CREATE_FRONTEND_API_TOKEN);
|
||||||
const hasCreateFrontendTokenAccess = useHasRootAccess(
|
const hasCreateFrontendTokenAccess = useHasRootAccess(
|
||||||
CREATE_PROJECT_API_TOKEN,
|
CREATE_PROJECT_API_TOKEN,
|
||||||
project,
|
project,
|
||||||
);
|
);
|
||||||
if (!project && !adminTokenKillSwitch) {
|
|
||||||
apiTokenTypes.push({
|
|
||||||
key: TokenType.ADMIN,
|
|
||||||
label: TokenType.ADMIN,
|
|
||||||
title: 'Full access for managing Unleash',
|
|
||||||
enabled: hasAdminAccess,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (uiConfig.flags.embedProxyFrontend) {
|
if (uiConfig.flags.embedProxyFrontend) {
|
||||||
apiTokenTypes.splice(1, 0, {
|
apiTokenTypes.splice(1, 0, {
|
||||||
|
@ -71,7 +71,6 @@ export type UiFlags = {
|
|||||||
automatedActions?: boolean;
|
automatedActions?: boolean;
|
||||||
celebrateUnleash?: boolean;
|
celebrateUnleash?: boolean;
|
||||||
enableLicense?: boolean;
|
enableLicense?: boolean;
|
||||||
adminTokenKillSwitch?: boolean;
|
|
||||||
feedbackComments?: Variant;
|
feedbackComments?: Variant;
|
||||||
showInactiveUsers?: boolean;
|
showInactiveUsers?: boolean;
|
||||||
feedbackPosting?: boolean;
|
feedbackPosting?: boolean;
|
||||||
|
Loading…
Reference in New Issue
Block a user