From 1b584ef3606ec4bed27b51980d6b2e0d69766b6b Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Wed, 25 Mar 2020 09:11:30 +0100 Subject: [PATCH] Add new information --- src/helpers/APILimitsHelper.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/helpers/APILimitsHelper.ts b/src/helpers/APILimitsHelper.ts index 5ea28bd..1226f5d 100644 --- a/src/helpers/APILimitsHelper.ts +++ b/src/helpers/APILimitsHelper.ts @@ -13,6 +13,24 @@ export enum Action { CREATE_ACCOUNT = "create_account" } +/** + * The duration entries will be kept in the table + */ +const MAX_TIME = 3600; // 1 hour + +/** + * Information about a specific IP & action + */ +interface CountInfo { + action: Action, + ip: string, + time: number, // Begin time + count: number, +} + +// The list of limits +const list : Array = []; + export class APILimitHelper { /**