feat(ui): connect AWS accounts in a single wizard step (#12852)

Co-authored-by: alejandrobailo <alejandrobailo94@gmail.com>
This commit is contained in:
Pedro Martín
2026-09-22 18:21:55 +02:00
committed by GitHub
co-authored by alejandrobailo
parent 50a9138bea
commit ea36f12a01
70 changed files with 4076 additions and 931 deletions
@@ -302,6 +302,7 @@ export const handlersForOrganizations = (
organizations.map((o) => o.secretId).filter((id): id is string => !!id),
);
let orgSeq = 0;
let providerSeq = 0;
let secretSeq = 0;
/** Reads per connection task, so `executingPolls` can hold one task running. */
const connectionTaskReads = new Map<string, number>();
@@ -565,6 +566,37 @@ export const handlersForOrganizations = (
HttpResponse.json({ data: [], meta: collectionMeta(0) }),
),
// --- single-account connect (AWS one-step form) -----------------------
http.post(`${API}/providers`, async ({ request }) => {
const body = (await request.json()) as {
data: { attributes: { provider: string; uid: string; alias?: string } };
};
providerSeq += 1;
return HttpResponse.json(
{
data: {
id: `provider-created-${providerSeq}`,
type: "providers",
attributes: {
...body.data.attributes,
connection: { connected: false, last_checked_at: null },
},
},
},
{ status: 201 },
);
}),
http.post(`${API}/providers/secrets`, () => {
secretSeq += 1;
return HttpResponse.json(
{
data: { id: `secret-created-${secretSeq}`, type: "provider-secrets" },
},
{ status: 201 },
);
}),
// --- providers (uid resolution) + connection testing -----------------
http.get<{ id: string }>(`${API}/providers/:id`, ({ params }) => {
const provider = fx.providers.find((p) => p.id === params.id);