Bind each customer to a Verae userId for hop tracing
Some checks are pending
offline / test (push) Waiting to run

Signup registers/binds a Verae central user and stores veraeUserId. Public access stays the zappier API key. Chain JWTs stay server-side behind tokenRef. Authz, billing, and jobs.watch carry veraeUserId.
This commit is contained in:
George Lambert 2026-09-11 16:18:06 -04:00
parent 1b199ca4d4
commit 345aeeead9
79 changed files with 703 additions and 95 deletions

View file

@ -18,8 +18,14 @@ export const authenticate = asyncHandler(async (req, res, next) => {
extractBearerToken(req.headers.authorization) ?? req.headers['x-api-key'] ?? null;
req.auth = await resolveAuthContext(rawToken);
const headerId = req.headers['x-verae-user-id'];
if (typeof headerId === 'string' && headerId.startsWith('vu_') && !req.auth.veraeUserId) {
req.auth.veraeUserId = headerId;
if (req.auth.tenant) req.auth.tenant.veraeUserId = headerId;
}
log.debug('authenticated', {
tenantId: req.auth.tenantId,
veraeUserId: req.auth.veraeUserId,
method: req.auth.authMethod,
plan: req.auth.tenant?.plan,
});