1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2024-11-22 05:19:22 +00:00

Add new information

This commit is contained in:
Pierre HUBERT 2020-03-25 09:11:30 +01:00
parent 78a612048d
commit 1b584ef360

View File

@ -13,6 +13,24 @@ export enum Action {
CREATE_ACCOUNT = "create_account" 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<CountInfo> = [];
export class APILimitHelper { export class APILimitHelper {
/** /**