Skip to content

[SaaS] Domain based rate limiting #1926

@chibenwa

Description

@chibenwa

Why?

The admin panel will push to Twake mail domain scopped limits

Spec

https://www.notion.so/linagora/ADR-021-B2B-RabbitMQ-communications-27062718bad1800fb8efe8e2e3098f10

{
  "domain": "linagora.com", 
  [...]
  "features":
    "mail": {
      [...]
      "mailsSentPerMinute": 100,
      "mailsSentPerHour": 1000,
      "mailsSentPerDay": 2000,
      "mailsReceivedPerMinute": -1, // -1 means ulimited, positive integer
      "mailsReceivedPerHour": -1,
      "mailsReceivedPerDay": -1,
    }
  }
}

-1 meaning unlimited

Published on the billing exchange with the domain.subscription.changed routing key

  • Create a DAO for definition rate limits on domain. We can likely mutualise code a lot with the same DAO backing the users table (only change table name?)
  • Plug it into the Saas rabbit consumer
  • If a user has no rate limits fallback to the limit defined by the domain with Rate limiting mailets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions