/*
Copyright (C) 2023-2026 QuantumNous
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
For commercial licensing, please contact support@quantumnous.com
*/
import { RateLimitSection } from '../request-limits/rate-limit-section'
import { SensitiveWordsSection } from '../request-limits/sensitive-words-section'
import { SSRFSection } from '../request-limits/ssrf-section'
import { TokenLimitSection } from '../request-limits/token-limit-section'
import type { SecuritySettings } from '../types'
import { createSectionRegistry } from '../utils/section-registry'
const SECURITY_SECTIONS = [
{
id: 'rate-limit',
titleKey: 'Rate Limiting',
build: (settings: SecuritySettings) => (
),
},
{
id: 'sensitive-words',
titleKey: 'Sensitive Words',
build: (settings: SecuritySettings) => (
),
},
{
id: 'ssrf',
titleKey: 'SSRF Protection',
build: (settings: SecuritySettings) => (
),
},
{
id: 'token-limits',
titleKey: 'Token Limits',
build: (settings: SecuritySettings) => (
),
},
] as const
export type SecuritySectionId = (typeof SECURITY_SECTIONS)[number]['id']
const securityRegistry = createSectionRegistry<
SecuritySectionId,
SecuritySettings
>({
sections: SECURITY_SECTIONS,
defaultSection: 'rate-limit',
basePath: '/system-settings/security',
urlStyle: 'path',
})
export const SECURITY_SECTION_IDS = securityRegistry.sectionIds
export const SECURITY_DEFAULT_SECTION = securityRegistry.defaultSection
export const getSecuritySectionNavItems = securityRegistry.getSectionNavItems
export const getSecuritySectionContent = securityRegistry.getSectionContent
export const getSecuritySectionMeta = securityRegistry.getSectionMeta