Files
zeekay 98f0da7fa5 ci: amd64-only build (matches hanzo runner pool topology)
hanzo-build-linux-amd64 is the only ARC runner pool installed on
hanzo-k8s today (arm64 pool is paused until DigitalOcean ships
arm64 droplets, per ~/work/hanzo/.github/RUNNERS.md). The arm64
job was waiting on spark-hanzoai-arm64 — not provisioned in this
cluster — so every build sat in queue forever and the amd64 leg
got cancelled.

Set platforms: linux/amd64 on the reusable build call to skip
arm64 entirely. Re-add arm64 if/when DO ships arm64 droplets and
the spark runner pool comes back online.
2026-06-07 11:38:49 -07:00

67 lines
1.8 KiB
TypeScript

import { jackson, jacksonProduct } from "@/lib/jackson";
import prisma from "@/lib/prisma";
import { NextResponse } from "next/server";
export const dynamic = "force-dynamic";
/**
* POST /api/auth/saml/verify
* Verifies that a team has SSO configured.
* Accepts either `slug` (preferred, user-friendly) or `teamId` (fallback).
* Returns only the teamId — no team names, provider info, or other metadata.
*/
export async function POST(req: Request) {
try {
const body = await req.json();
const { slug, teamId } = body;
if (!slug && !teamId) {
return NextResponse.json(
{ error: "Team slug or ID is required" },
{ status: 400 },
);
}
// Look up team by slug first, then by ID
const team = slug
? await prisma.team.findUnique({
where: { slug },
select: { id: true, ssoEnabled: true },
})
: await prisma.team.findUnique({
where: { id: teamId },
select: { id: true, ssoEnabled: true },
});
const ssoUnavailable = NextResponse.json(
{ error: "SSO is not available for this team." },
{ status: 404 },
);
if (!team || !team.ssoEnabled) {
return ssoUnavailable;
}
// Check Jackson for actual SAML connections
const { apiController } = await jackson();
const connections = await apiController.getConnections({
tenant: team.id,
product: jacksonProduct,
});
if (!connections || connections.length === 0) {
return ssoUnavailable;
}
// Only return the team ID — no names, providers, or other metadata
return NextResponse.json({ data: { teamId: team.id } });
} catch (error: any) {
console.error("[SAML] Verify error:", error);
return NextResponse.json(
{ error: "Something went wrong" },
{ status: 500 },
);
}
}