Some checks failed
Build + Deploy / build-admin-compliance (push) Successful in 1m57s
Build + Deploy / build-backend-compliance (push) Successful in 3m3s
Build + Deploy / build-ai-sdk (push) Successful in 51s
Build + Deploy / build-developer-portal (push) Successful in 1m9s
Build + Deploy / build-tts (push) Successful in 1m24s
Build + Deploy / build-document-crawler (push) Successful in 43s
Build + Deploy / build-dsms-gateway (push) Successful in 29s
CI / branch-name (push) Has been skipped
CI / guardrail-integrity (push) Has been skipped
CI / loc-budget (push) Failing after 20s
CI / secret-scan (push) Has been skipped
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / nodejs-build (push) Successful in 2m45s
CI / dep-audit (push) Has been skipped
CI / sbom-scan (push) Has been skipped
CI / test-go (push) Failing after 38s
CI / test-python-backend (push) Successful in 48s
CI / test-python-document-crawler (push) Successful in 25s
CI / test-python-dsms-gateway (push) Successful in 24s
CI / validate-canonical-controls (push) Successful in 12s
Build + Deploy / trigger-orca (push) Successful in 14m2s
Die UCCA Assessment Proxies leiteten X-Tenant-ID nur weiter wenn der Browser ihn explizit sendete. Da das Frontend den Header nicht setzt, kam immer 400/leer zurueck. Alle anderen Proxies (compliance, training, academy etc.) hatten bereits den Fallback auf DEFAULT_TENANT_ID. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
48 lines
1.4 KiB
TypeScript
48 lines
1.4 KiB
TypeScript
import { NextRequest, NextResponse } from 'next/server'
|
|
|
|
const SDK_URL = process.env.SDK_URL || 'http://ai-compliance-sdk:8090'
|
|
const DEFAULT_TENANT_ID = process.env.DEFAULT_TENANT_ID || '9282a473-5c95-4b3a-bf78-0ecc0ec71d3e'
|
|
|
|
/**
|
|
* Proxy: GET /api/sdk/v1/ucca/assessments → Go Backend GET /sdk/v1/ucca/assessments
|
|
*/
|
|
export async function GET(request: NextRequest) {
|
|
try {
|
|
const { searchParams } = new URL(request.url)
|
|
const params = new URLSearchParams()
|
|
|
|
// Forward filter params
|
|
for (const [key, value] of searchParams.entries()) {
|
|
params.set(key, value)
|
|
}
|
|
|
|
const queryString = params.toString()
|
|
const url = `${SDK_URL}/sdk/v1/ucca/assessments${queryString ? `?${queryString}` : ''}`
|
|
|
|
const response = await fetch(url, {
|
|
method: 'GET',
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
'X-Tenant-ID': request.headers.get('X-Tenant-ID') || DEFAULT_TENANT_ID,
|
|
},
|
|
})
|
|
|
|
if (!response.ok) {
|
|
const errorText = await response.text()
|
|
return NextResponse.json(
|
|
{ error: 'UCCA backend error', details: errorText },
|
|
{ status: response.status }
|
|
)
|
|
}
|
|
|
|
const data = await response.json()
|
|
return NextResponse.json(data)
|
|
} catch (error) {
|
|
console.error('Failed to fetch UCCA assessments:', error)
|
|
return NextResponse.json(
|
|
{ error: 'Failed to connect to UCCA backend' },
|
|
{ status: 503 }
|
|
)
|
|
}
|
|
}
|