Registers the multi-tenant metering preHandler hook on Fastify.
The hook runs at preHandler, after every onRequest hook, so it sees
the principal the authentication hook stored on request.auth. The
tenant is auth.sub; a client-supplied header never selects it.
Tenant quotas are reported in X-Tenant-RateLimit-* headers so they do
not overwrite the global limiter's X-RateLimit-* headers.
Registers the multi-tenant metering preHandler hook on Fastify.
The hook runs at
preHandler, after everyonRequesthook, so it sees the principal the authentication hook stored onrequest.auth. The tenant isauth.sub; a client-supplied header never selects it.Tenant quotas are reported in
X-Tenant-RateLimit-*headers so they do not overwrite the global limiter'sX-RateLimit-*headers.