Skip to content

[Request]: throttle partition keyed by credential, with a shared or durable counter store #572

Closed

Description

@jimhoyd

Problem or use case

Evidence comes from a first-party hosted URLCode service (private repository) built on core 0.5.9. It had to hand-write the code named below. Per-token quotas needed about 290 lines (a quota module plus a DynamoDB-backed counter store) that reimplement policies.throttle, because throttle partitions only by route/client and counters are per-process.

Proposed behavior and alternatives

A partition: credential (or a key from the authenticated principal) and a pluggable counter store an operator binds (in-memory default, shared store optional), with cost-weighted budgets as a stretch. Provider settings for the store stay in operator policy, not route YAML. Related: #547 (IPv6 keying).

Activity

  1. added
    enhancement
    ai-first
    needs-decision
    on Sep 23, 2026
  2. jimhoyd commented on Sep 24, 2026

    @jimhoyd
    CollaboratorAuthor

    Triage decision: decline a core durable-counter feature and any route-level provider/store configuration. Counters and backing stores remain operator-owned. Retain this issue as evidence for a future bounded host-policy or extension integration that may partition by an authenticated principal supplied by #571, but do not implement it until repeated demand establishes a portable contract and failure model. Removing needs-decision.

  3. removed
    needs-decision
    on Sep 24, 2026
  4. jimhoyd commented on Sep 24, 2026

    @jimhoyd
    CollaboratorAuthor

    Decision (owner, 2026-09-24): per-credential limits live in the auth add-on — a declarative quota: { requests, window } alongside a bearer/API-key's scopes, counted in auth's existing SQLite attempt store (durable, shared by processes on one host, not across hosts). Core throttle is unchanged. Work starting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-firstenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions