feat(backend-app-api): start implementing in memory rate limit

Signed-off-by: Camila Belo <camilaibs@gmail.com>
This commit is contained in:
Camila Belo
2024-03-14 13:58:23 +01:00
parent 9717111e53
commit 502d1c61fd
4 changed files with 47 additions and 2 deletions
+12
View File
@@ -14,6 +14,8 @@
* limitations under the License.
*/
import { HumanDuration } from '@backstage/types';
export interface Config {
backend?: {
auth?: {
@@ -32,6 +34,16 @@ export interface Config {
* unless you configure credentials for service calls.
*/
dangerouslyDisableDefaultAuthPolicy?: boolean;
rateLimit?: {
/**
* Limit each IP to max requests per window
*/
max?: number;
/**
* The duration for which the rate limit is enforced
*/
window?: HumanDuration;
};
};
};