qbo_auth: realmId шифруется, /callback отвечает 302, no-cache; требования Intuit: раздел E по оригиналу, ручные тесты через /tests
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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 запущен");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user