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
|
|
@ -102,8 +102,14 @@ export function buildApp(deps: AppDeps = {}): {
|
|||
};
|
||||
const items: StoredItem[] = [];
|
||||
const credits = new CreditLedger();
|
||||
const onUsage = (e: { customerId: string; endpointId: string; cents: number }) =>
|
||||
natsPublish(BILLING_SUBJECTS.USAGE_RECORDED, { ...e, at: new Date().toISOString() }, 'api');
|
||||
const onUsage = (e: { customerId: string; endpointId: string; cents: number }) => {
|
||||
const c = customers.list().find((row) => row.id === e.customerId);
|
||||
natsPublish(
|
||||
BILLING_SUBJECTS.USAGE_RECORDED,
|
||||
{ ...e, veraeUserId: c?.veraeUserId, at: new Date().toISOString() },
|
||||
'api',
|
||||
);
|
||||
};
|
||||
const hashIndex = new Map<
|
||||
string,
|
||||
{ jobId: string; sha256: string; data?: string; timestamp: string }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue