fix(core): Stop enforcing max numbers of API keys limit (no-changelog) (#13631)

This commit is contained in:
Ricardo Espinoza
2025-03-03 14:32:50 +01:00
committed by GitHub
parent e633e91f69
commit 1909b74350
12 changed files with 2 additions and 55 deletions

View File

@@ -63,7 +63,6 @@ export const defaultSettings: FrontendSettings = {
enabled: false,
},
publicApi: {
apiKeysPerUserLimit: 0,
enabled: false,
latestVersion: 0,
path: '',

View File

@@ -4,14 +4,12 @@ import { useRootStore } from '@/stores/root.store';
import * as publicApiApi from '@/api/api-keys';
import { computed, ref } from 'vue';
import { useSettingsStore } from './settings.store';
import type { ApiKey, CreateApiKeyRequestDto, UpdateApiKeyRequestDto } from '@n8n/api-types';
export const useApiKeysStore = defineStore(STORES.API_KEYS, () => {
const apiKeys = ref<ApiKey[]>([]);
const rootStore = useRootStore();
const settingsStore = useSettingsStore();
const apiKeysSortByCreationDate = computed(() =>
apiKeys.value.sort((a, b) => b.createdAt.localeCompare(a.createdAt)),
@@ -27,10 +25,6 @@ export const useApiKeysStore = defineStore(STORES.API_KEYS, () => {
);
});
const canAddMoreApiKeys = computed(
() => apiKeys.value.length < settingsStore.api.apiKeysPerUserLimit,
);
const getAndCacheApiKeys = async () => {
if (apiKeys.value.length) return apiKeys.value;
apiKeys.value = await publicApiApi.getApiKeys(rootStore.restApiContext);
@@ -62,6 +56,5 @@ export const useApiKeysStore = defineStore(STORES.API_KEYS, () => {
apiKeysSortByCreationDate,
apiKeysById,
apiKeys,
canAddMoreApiKeys,
};
});

View File

@@ -32,7 +32,6 @@ export const useSettingsStore = defineStore(STORES.SETTINGS, () => {
});
const templatesEndpointHealthy = ref(false);
const api = ref({
apiKeysPerUserLimit: 0,
enabled: false,
latestVersion: 0,
path: '/',

View File

@@ -179,11 +179,7 @@ function onEdit(id: string) {
</n8n-link>
</div>
<div class="mt-m text-right">
<n8n-button
size="large"
:disabled="!apiKeysStore.canAddMoreApiKeys"
@click="onCreateApiKey"
>
<n8n-button size="large" @click="onCreateApiKey">
{{ i18n.baseText('settings.api.create.button') }}
</n8n-button>
</div>