WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Identity Edit Ratelimits #4459

@linear

Description

@linear

Add the ability to manage identity-level ratelimits through the context menu, applying full replacement model and affecting all keys for that identity.

Acceptance Criteria

Context Menu Update

  •  New menu item added to existing context menu:
    • Edit ratelimits... (with gauge icon)
    • Positioned after "Edit metadata..."
  •  Menu item opens ratelimits dialog

Edit Ratelimits Feature

  •  Dialog opens showing current ratelimits as form fields
  •  Each ratelimit displays:
    • Name (text input, required)
    • Limit (number input, min 1, required)
    • Duration (number input in milliseconds, min 1000, required)
    • Auto-apply (checkbox)
    • Delete button (trash icon)
  •  "Add Ratelimit" button to add new ratelimit entry
  •  Delete button removes ratelimit from form (hidden if only 1 exists)
  •  Warning banner: "⚠️ These limits apply to ALL keys for this identity"
  •  Inline validation for each field:
    • Name cannot be empty
    • Limit must be positive integer
    • Duration must be >= 1000ms
    • Name must be unique (no duplicates)
  •  Validation error messages appear under invalid fields
  •  Submit button labeled "Update Ratelimits"
  •  Submit button disabled until all fields valid
  •  Success toast: "Ratelimits updated successfully"
  •  Error toast with user-friendly messages
  •  Optimistic UI update (ratelimit count in table)
  •  Cancel button closes without saving
  •  Ability to remove all ratelimits by deleting all entries
  •  Loading state during save

Technical Notes

  • Adapt RatelimitSetup component from apps/dashboard/app/(app)/[workspaceSlug]/apis/[apiId]/_components/create-key/components/ratelimit-setup.tsx
  • Create wrapper component for identity context
  • Create trpc.identity.updateRatelimits mutation
  • Full replacement model - send complete ratelimits array

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions