createPartitionedRateLimitKeyFactory
createPartitionedRateLimitKeyFactory<
TRequest>(partitionFactory,options?):RateLimitKeyFactory
Defined in: packages/pipeline-rate-limit/src/helpers/partitioned-key.ts:86
Creates a RateLimitKeyFactory for per-caller limits.
Segments are escaped and joined through the core key helper so tenant, caller/account identity, and request name remain distinct even when values contain separator characters.
Type Parameters
Section titled “Type Parameters”TRequest
Section titled “TRequest”TRequest = unknown
Parameters
Section titled “Parameters”partitionFactory
Section titled “partitionFactory”RateLimitPartitionFactory<TRequest>
Resolves the stable caller/account identity.
options?
Section titled “options?”PartitionedRateLimitKeyOptions = {}
Tenant and missing-partition policy.
Returns
Section titled “Returns”A RateLimitKeyFactory suitable for RateLimitBehaviorOptions.keyFactory.
Throws
Section titled “Throws”When a required tenant or caller partition is absent.
The produced key is <tenantId>:<partition>:<requestName> when tenant
inclusion is enabled, <partition>:<requestName> otherwise.
RateLimitBehaviorOptions.keyPrefix is still applied afterwards by
buildRateLimitKey(), so environment/service prefixes remain orthogonal.
Examples
Section titled “Examples”Per authenticated user, tenant-aware and fail-closed by default
Per value of the request, typed by the request class
Single-tenant deployment — say so explicitly
Account-wide bucket shared by every user in the account