qbo_auth: заголовки no-store/Referrer-Policy; требования Intuit: раздел E (безопасность), M7 по решению Юрия
All checks were successful
ci / test (push) Successful in 42s
ci / deploy (push) Successful in 2m39s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-23 09:01:39 +03:00
parent 0d3fb7eedb
commit b0a68930b1
3 changed files with 29 additions and 3 deletions

View File

@@ -28,6 +28,13 @@ export function buildApi(auth: QboAuth, token: string, sync?: QboSync, webhook?:
done(e as Error, undefined);
}
});
// требования Intuit: ответы с токенами и страницы действий не кэшируются, адрес с code/state не уходит в Referer
app.addHook("onSend", async (_req, reply) => {
reply.header("Cache-Control", "no-store");
reply.header("Pragma", "no-cache");
reply.header("Referrer-Policy", "no-referrer");
reply.header("X-Content-Type-Options", "nosniff");
});
app.addHook("onRequest", async (req, reply) => {
const path = req.url.split("?")[0];
if (path === "/healthz" || path === "/callback" || path === "/webhook" || path === "/tests") return;