Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
9924b55
Add rate limiting + test
Nolab0 Nov 20, 2025
25a3932
Fix phpstan
Nolab0 Nov 20, 2025
5bd9368
Add abstraction
Nolab0 Nov 21, 2025
7eff330
Fix tests
Nolab0 Nov 21, 2025
c2fc110
move up the rate limit
Nolab0 Nov 21, 2025
fe95aa7
Move wehbook relay to machine API
Nolab0 Nov 21, 2025
d515bb1
Add machine api rate limit test
Nolab0 Nov 21, 2025
551cca5
Clean rate limiting class and add clear limiting logic
Nolab0 Nov 21, 2025
3f9e50d
fixes #314 (#349)
supun-io Nov 20, 2025
213fa1b
Adds brand url to sending profiles (#345)
Nadil-K Nov 20, 2025
de485e2
fixes #296 (#347)
Nadil-K Nov 20, 2025
8f47872
Improvements on issue sending (#351)
Nadil-K Nov 21, 2025
1920c2b
Optimizes list subscriber count fetch (#346)
Nadil-K Nov 21, 2025
9199f4d
Move wehbook relay to machine API
Nolab0 Nov 21, 2025
c1f5db1
fixes #296 (#347)
Nadil-K Nov 20, 2025
2123f81
Merge remote-tracking branch 'origin/main' into 201-rate-limit-the-su…
Nadil-K Nov 21, 2025
63cbc60
Fix ci
Nolab0 Nov 21, 2025
e39c994
Create product banner (#356)
IshiniAvindya Nov 21, 2025
63c8eef
img moved to static (#350)
IshiniAvindya Nov 24, 2025
0995dd4
Console API docs (#359)
Nadil-K Nov 24, 2025
9416006
Final fixes before release (#360)
Nadil-K Nov 24, 2025
92b548c
hds version updated (#367)
IshiniAvindya Nov 30, 2025
aeacd54
Fixes CORS for embed form (#368)
Nadil-K Dec 1, 2025
9cfa1e1
Health check endpoint (#369)
Nadil-K Dec 1, 2025
c0a7bfd
Approval type of content required (#371)
Nadil-K Dec 1, 2025
cd2a7e1
Homepage fixes (#370)
IshiniAvindya Dec 1, 2025
b48ed8c
fix-branding-for-newsletter-name (#377)
Nadil-K Dec 8, 2025
adececb
hide lists when one list is avaliable
Nadil-K Dec 9, 2025
7f36832
<=
Nadil-K Dec 9, 2025
4c425fc
Adds a TextInput for brand-url of sending profile (#384)
Nadil-K Dec 11, 2025
d733e1f
Refactor remaining occurrences of segment to list (#385)
Nadil-K Dec 11, 2025
de794f8
Fixes console newsletter redirect after invite acceptance (#386)
Nadil-K Dec 11, 2025
2a2f86b
properly unmount when element is disconnected from dom and move style…
sakithb Dec 16, 2025
fac394e
disable Symfony Entity Resolved (#395)
sakithb Dec 16, 2025
3db54fc
decrease list indentation (#394)
sakithb Dec 18, 2025
eb9a2fa
Move wehbook relay to machine API
Nolab0 Nov 21, 2025
6b8f8e9
Adds brand url to sending profiles (#345)
Nadil-K Nov 20, 2025
972fd39
Improvements on issue sending (#351)
Nadil-K Nov 21, 2025
8511e2b
Merge branch 'main' into 201-rate-limit-the-subscribe-endpoint
Nolab0 Dec 29, 2025
5ff57ce
Fix ci
Nolab0 Dec 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions backend/config/packages/rate_limiter.php

This file was deleted.

6 changes: 4 additions & 2 deletions backend/config/routes/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@
->prefix('/api/sudo')
->namePrefix('api_sudo_');

$routes->import('../../src/Api/Machine/Controller', 'attribute')
->prefix('/api/machine')
->namePrefix('api_machine_');

// root API
$routes->import('../../src/Api/Root', 'attribute')
->prefix('/api')
->namePrefix('api_root_');


// local API (dev and test only)
$routes->import('../../src/Api/Local', 'attribute')
->prefix('/api/local')
->condition('env("APP_ENV") in ["dev", "test"]')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Api\Public\Controller\Integration\Relay;
namespace App\Api\Machine\Controller\Integration\Relay;

use App\Entity\Type\RelayDomainStatus;
use App\Entity\Type\SendStatus;
Expand Down
80 changes: 0 additions & 80 deletions backend/src/Api/Public/Listener/RateLimiterListener.php

This file was deleted.

98 changes: 98 additions & 0 deletions backend/src/Api/RateLimit/RateLimit.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<?php

namespace App\Api\RateLimit;

use Symfony\Component\DependencyInjection\Attribute\Autowire;

/**
* @phpstan-type RateLimitConfig array{id: string, policy: string, limit: int, interval: string}
*/
class RateLimit
{

private bool $isDev;

public function __construct(
#[Autowire('%kernel.environment%')]
private readonly string $env = 'prod'
)
{
$this->isDev = $this->env === 'dev';
}

/**
* Rate limit for a user session.
* 60 per minute
* @return RateLimitConfig
*/
public function session(): array
{
return [
'id' => 'console_api_session',
'policy' => 'fixed_window',
'limit' => $this->isDev ? 1000 : 60,
'interval' => '1 minute',
];
}

/**
* Rate limit for an API key.
* 100 per minute
* @return RateLimitConfig
*/
public function apiKey(): array
{
return [
'id' => 'console_api_api_key',
'policy' => 'fixed_window',
'limit' => $this->isDev ? 1000 : 100,
'interval' => '1 minute',
];
}

/**
* Rate limit for public API per IP.
* 30 per minute per IP
* @return RateLimitConfig
*/
public function publicApi(): array
{
return [
'id' => 'public_api',
'policy' => 'fixed_window',
'limit' => $this->isDev ? 1000 : 30,
'interval' => '1 minute',
];
}

/**
* Rate limit for the POST /subscribers endpoint.
* 1 subscribe per email per minute
* @return RateLimitConfig
*/
public function subscriberPerEmailPerMinute(): array
{
return [
'id' => 'public_api_subscriber_per_minute',
'policy' => 'fixed_window',
'limit' => 2,
'interval' => '1 minute',
];
}

/**
* Rate limit for the POST /subscribers endpoint.
* 6 subscribes per email per hour
* @return RateLimitConfig
*/
public function subscriberPerEmailPerHour(): array
{
return [
'id' => 'public_api_subscriber_per_hour',
'policy' => 'fixed_window',
'limit' => 6,
'interval' => '1 hour',
];
}

}
Loading