Skip to content

v0.2.0 - Simplified metadata API

Latest

Choose a tag to compare

@jacyimp jacyimp released this 06 Sep 17:30
· 4 commits to main since this release

v0.2.0

This release simplifies the public API and removes several unnecessary metadata abstractions.

Breaking changes

  • RateLimit metadata is now added directly to extraProperties
  • Multiple RateLimit entries can be declared naturally and are composed together
  • Resource-level and operation-level limits now combine instead of replacing each other
  • Removed DynamicLimit, DynamicCost, DynamicBucket, Identity, and Condition
  • Dynamic values now use typed resolver class names via class-string<T>
  • Dynamic buckets now use the explicit bucketResolver option
  • Removed the custom Interval value object; use strings or native DateInterval
  • Removed the RateLimitChecking lifecycle event

Improvements

  • Simplified identity and condition composition

  • Clarified bucket vs identity semantics for tenant-aware limits

  • Fixed misleading tenant quota documentation

  • Made symfony/security-core optional

    • authenticated Symfony users are rate limited by user identity when Security is installed
    • applications without Symfony Security fall back cleanly to client IP
  • Reduced metadata boilerplate and internal complexity

Example:

new Post(
    extraProperties: [
        new RateLimit(
            limit: 100,
            interval: '1 minute',
        ),
        new RateLimit(
            limit: 1_000,
            interval: '1 hour',
        ),
        new RateLimit(
            limit: 10_000,
            interval: '1 day',
        ),
    ],
)