fix(door): never return raw controller reason to the client (D10)

Every door action bubbled the executor's reason/e.message to the
client; redaction was password-literal + a fixed param-name regex, so a
generic-adapter connection with a custom auth param + verbose upstream
error could surface the secret client-side. Client returns are now a
generic 'controller call failed' message; the redacted detail still
goes to door_access_log for operators. redactDoorSecrets + callDoor
gained an optional authParam (scrub the connection's actual auth param
value regardless of name); threading conn.auth_param through the
door-call selects is a deferred defense-in-depth follow-up (client
leak is fully closed; native HeatSync e= is already regex-covered).
This commit is contained in:
Moheeb Zara
2026-05-18 18:44:54 -07:00
parent 785e8e0ef9
commit 66cb84bc57
3 changed files with 23 additions and 8 deletions
+5 -5
View File
@@ -282,7 +282,7 @@ export async function testDoorConnection(input: unknown) {
revalidatePath('/door/manage')
return result.ok
? { data: { ok: true, status: result.status } }
: { error: result.reason }
: { error: 'The door controller call failed. Check the door audit log for the redacted detail.' }
}
export async function listDoorAccessLog() {
@@ -511,7 +511,7 @@ export async function grantCard(input: unknown) {
targetMemberId, action: 'grant', success: false,
detail: `failed: ${result.reason}`, password,
})
return { error: result.reason }
return { error: 'The door controller call failed. Check the door audit log for the redacted detail.' }
}
await auditDoor(admin, {
@@ -590,7 +590,7 @@ export async function revokeCard(input: unknown) {
targetMemberId, action: 'revoke', success: false,
detail: `failed (slot ${slot} kept): ${result.reason}`, password,
})
return { error: result.reason }
return { error: 'The door controller call failed. Check the door audit log for the redacted detail.' }
}
await admin.from('door_card_slots').delete().eq('connection_id', connectionId).eq('card_id', cardId)
@@ -688,7 +688,7 @@ export async function doorControl(input: unknown) {
})
revalidatePath('/door/manage')
return result.ok ? { data: { ok: true, status: result.status } } : { error: result.reason }
return result.ok ? { data: { ok: true, status: result.status } } : { error: 'The door controller call failed. Check the door audit log for the redacted detail.' }
}
// ─── Member self-entry ("buzz me in") ────────────────────────────────────────
@@ -799,7 +799,7 @@ export async function selfEntry(input: unknown) {
})
revalidatePath('/dashboard')
return result.ok ? { data: { ok: true } } : { error: result.reason }
return result.ok ? { data: { ok: true } } : { error: 'The door controller call failed. Check the door audit log for the redacted detail.' }
}
// The signed-in member's OWN door activity (rows where they were the actor or