Skip to content

Console API: per-address rate limit for failed tokens and passwords #1758

Closed

Description

@JacobStephens2

This was generated by AI during triage.

Parent

#1753 (Spec: the Console API). Governing decision: ADR 0026.

What to build

Failed tokens and failed passwords are rate-limited per client address, so neither can be guessed. Today only an emailed sign-in code is capped (5 tries per code), and failed passwords have no limit.

  • An in-memory limiter, written in thirdshift without a new dependency, counts failures per client address. It slows responses after a few failures, then refuses with a 429 carrying a retry time for a cool-down. A restart clears it.
  • The client address is the proxy's forwarded address, trusted only when the request comes from 127.0.0.1. Otherwise it's the peer address.
  • It covers bearer tokens on /api/v1 and the password sign-in form. The sign-in code's own limit stays as it is.
  • A successful authentication doesn't reset another address's count.

Acceptance criteria

  • An HTTP test: repeated bad tokens from one forwarded address reach a 429 with a retry time, while another address still authenticates.
  • Repeated bad passwords for the sign-in form reach the same refusal.
  • A forwarded-address header from a non-loopback peer is ignored.
  • The sign-in code's 5-tries limit is unchanged (existing tests pass).
  • docs/guide.md mentions the limit.

Activity

  1. added
    enhancement
    ready-for-agent
    on Nov 5, 2026
  2. JacobStephens2 commented on Nov 5, 2026

    @JacobStephens2
    OwnerAuthor

    Closed by #1790, merged into issue-1753 by a thirdshift Ticket run with Self-merge.

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

    enhancementready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions