Bind each customer to a Verae userId for hop tracing
Some checks are pending
offline / test (push) Waiting to run
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:
parent
1b199ca4d4
commit
345aeeead9
79 changed files with 703 additions and 95 deletions
16
packages/verae-zapier-middleware/src/lib/identity.js
Normal file
16
packages/verae-zapier-middleware/src/lib/identity.js
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/**
|
||||
* Stable Verae user id derived from username/email.
|
||||
* Live /auth/login.user.id wins when present; this is the mock/offline id.
|
||||
*/
|
||||
import { createHash } from 'node:crypto';
|
||||
|
||||
export function normalizeVeraeUsername(username) {
|
||||
return String(username || '')
|
||||
.trim()
|
||||
.toLowerCase();
|
||||
}
|
||||
|
||||
export function stableVeraeUserId(username) {
|
||||
const n = normalizeVeraeUsername(username);
|
||||
return `vu_${createHash('sha256').update(n).digest('hex').slice(0, 16)}`;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue