qbo_auth: realmId шифруется, /callback отвечает 302, no-cache; требования Intuit: раздел E по оригиналу, ручные тесты через /tests
All checks were successful
ci / test (push) Successful in 38s
ci / deploy (push) Successful in 2m38s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-23 09:21:39 +03:00
parent b0a68930b1
commit e90b9f352d
7 changed files with 65 additions and 34 deletions

View File

@@ -11,8 +11,9 @@ import { QboSync } from "./sync.js";
const { common, service: s } = loadServiceSettings("qbo_auth", qboAuthSchema);
const log = createLogger("qbo_auth", common.logLevel);
const pool = createPool(common.database.url, 3);
const store = new PgStore(pool, parseKey(s.encryptionKey));
const auth = new QboAuth({
store: new PgStore(pool, parseKey(s.encryptionKey)),
store,
fetchFn: (url, init) => fetch(url, init),
env: s.environment,
clientId: s.clientId,
@@ -48,6 +49,10 @@ const app = buildApi(auth, s.http.token, sync, {
trigger.poke();
},
});
{
const n = await store.encryptExistingRealms().catch((e) => (log.error({ err: String(e) }, "шифрование realm_id"), 0));
if (n) log.info({ rows: n }, "realm_id зашифрован в существующих записях");
}
await app.listen({ host: s.http.host, port: s.http.port });
log.info({ port: s.http.port, environment: s.environment }, "qbo_auth запущен");