feat: secure organization provider credentials

This commit is contained in:
2026-07-10 22:04:43 +08:00
parent e049cb6880
commit 848f913597
51 changed files with 3280 additions and 230 deletions
+6
View File
@@ -23,6 +23,12 @@ export async function handleRouteError(reply: FastifyReply, err: unknown): Promi
function mapDomainError(message: string): { statusCode: number; code: string; message: string } | null {
const lower = message.toLowerCase();
if (lower.includes("provider credential readiness check could not reach provider")) {
return { statusCode: 502, code: "provider_unavailable", message };
}
if (lower.includes("provider credential readiness check failed")) {
return { statusCode: 400, code: "provider_credential_rejected", message };
}
if (lower.includes("not found")) {
return { statusCode: 404, code: "not_found", message };
}