mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-08 10:27:46 +08:00
fix: restore security hardening compatibility and validation
Restore authorized rule reveal, explicit full HTTP capture and retention, video task business fields, and valid payment URLs. Add opt-in credential preservation for trusted recovery, fix frontend type contracts and async races, and eliminate PostgreSQL test fixture resource leaks. Document audit coverage and successful fmt and CI-scoped Clippy checks.
This commit is contained in:
@@ -1189,7 +1189,7 @@ function setEmbeddingEnabled(enabled: boolean) {
|
||||
setConfigField('embedding', undefined)
|
||||
if (form.value.config?.model_type === 'embedding') setConfigField('model_type', undefined)
|
||||
if (Array.isArray(form.value.config?.api_formats)
|
||||
&& form.value.config.api_formats.every((format) => embeddingApiFormats.includes(String(format)))) {
|
||||
&& form.value.config.api_formats.every((format) => embeddingApiFormats.some((supportedFormat) => supportedFormat === String(format)))) {
|
||||
setConfigField('api_formats', undefined)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -567,7 +567,7 @@ import { getGlobalModelRoutingPreview } from '@/api/global-models'
|
||||
|
||||
// 使用外部类型定义
|
||||
import type { GlobalModelResponse } from '@/api/global-models'
|
||||
import type { TieredPricingConfig, PricingTier, ModelRoutingPreviewResponse } from '@/api/endpoints/types'
|
||||
import type { ModelProviderReference, TieredPricingConfig, PricingTier, ModelRoutingPreviewResponse } from '@/api/endpoints/types'
|
||||
import type { RoutingProviderInfo } from '@/api/global-models'
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
@@ -578,9 +578,9 @@ const emit = defineEmits<{
|
||||
'editModel': [model: GlobalModelResponse]
|
||||
'toggleModelStatus': [model: GlobalModelResponse]
|
||||
'addProvider': []
|
||||
'editProvider': [provider: Record<string, unknown>]
|
||||
'deleteProvider': [provider: Record<string, unknown>]
|
||||
'toggleProviderStatus': [provider: Record<string, unknown>]
|
||||
'editProvider': [provider: ModelProviderReference]
|
||||
'deleteProvider': [provider: ModelProviderReference]
|
||||
'toggleProviderStatus': [provider: ModelProviderReference]
|
||||
'refreshModel': []
|
||||
'linkProvider': [providerId: string]
|
||||
'linkProviders': [providerIds: string[]]
|
||||
|
||||
@@ -246,8 +246,8 @@ const activeTierKey = ref('')
|
||||
const processingTierEntries = computed<ProcessingTierEntry[]>(() => {
|
||||
const processingTiers = props.pricing?.processing_tiers
|
||||
if (!isRecord(processingTiers)) return []
|
||||
const labels = new Map(KNOWN_PROCESSING_TIERS.map(entry => [entry.key, entry.label]))
|
||||
const order = new Map(KNOWN_PROCESSING_TIERS.map((entry, index) => [entry.key, index]))
|
||||
const labels = new Map<string, string>(KNOWN_PROCESSING_TIERS.map(entry => [entry.key, entry.label]))
|
||||
const order = new Map<string, number>(KNOWN_PROCESSING_TIERS.map((entry, index) => [entry.key, index]))
|
||||
return Object.entries(processingTiers)
|
||||
.filter((entry): entry is [string, ProcessingTierPricingConfig] => (
|
||||
isRecord(entry[1]) && processingPricingHasFacts(entry[1])
|
||||
|
||||
@@ -728,8 +728,8 @@ const activeProcessingTierUsesMultiplier = computed(() => (
|
||||
const compactProcessingTierOptions = computed<CompactProcessingTierOption[]>(() => (
|
||||
COMPACT_PROCESSING_TIERS.map(option => ({
|
||||
...option,
|
||||
accessibleLabel: [option.group, option.label, 'detail' in option ? option.detail : null]
|
||||
.filter((part): part is string => Boolean(part))
|
||||
accessibleLabel: ['group' in option ? option.group : null, option.label, 'detail' in option ? option.detail : null]
|
||||
.filter((part) => Boolean(part))
|
||||
.join(' · '),
|
||||
...(processingTierMultiplierDrafts[option.key] ?? {
|
||||
enabled: false,
|
||||
@@ -1335,7 +1335,7 @@ function processingTierDisplayLabel(key: string): string {
|
||||
'group' in compactTier ? compactTier.group : null,
|
||||
compactTier.label,
|
||||
'detail' in compactTier ? compactTier.detail : null,
|
||||
].filter((part): part is string => Boolean(part)).join(' · ')
|
||||
].filter((part) => Boolean(part)).join(' · ')
|
||||
}
|
||||
return KNOWN_PROCESSING_TIERS.find(tier => tier.key === key)?.label ?? key
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user