Crypto Server
    Preparing search index...

    Function registerMetering

    • 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.

      Parameters

      Returns void