Skip to content

Commit 706f3b8

Browse files
erayakartunachriskacerguis
authored andcommitted
Limit request by ip address - without rest key (chriskacerguis#711)
1 parent 4b45c72 commit 706f3b8

File tree

15 files changed

+33
-5
lines changed

15 files changed

+33
-5
lines changed

application/config/rest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@
334334
| Specify the method used to limit the API calls
335335
|
336336
| Available methods are :
337+
| $config['rest_limits_method'] = 'IP_ADDRESS'; // Put a limit per ip address
337338
| $config['rest_limits_method'] = 'API_KEY'; // Put a limit per api key
338339
| $config['rest_limits_method'] = 'METHOD_NAME'; // Put a limit on method calls
339340
| $config['rest_limits_method'] = 'ROUTED_URL'; // Put a limit on the routed URL

application/language/bulgarian/rest_controller_lang.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
$lang['text_rest_api_key_unauthorized'] = 'API ключът не е оторизиран зо достъп до заявения контролер';
1414
$lang['text_rest_api_key_permissions'] = 'API ключът няма достатъчно права';
1515
$lang['text_rest_api_key_time_limit'] = 'API ключът е изполван с превишаване на времевия лимит за този метод';
16+
$lang['text_rest_ip_address_time_limit'] = 'This IP Address has reached the time limit for this method';//todo translate
1617
$lang['text_rest_unknown_method'] = 'Неизвестен метод';
1718
$lang['text_rest_unsupported'] = 'Неподдържан протокол';

application/language/english/rest_controller_lang.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
$lang['text_rest_api_key_unauthorized'] = 'This API key does not have access to the requested controller';
1414
$lang['text_rest_api_key_permissions'] = 'This API key does not have enough permissions';
1515
$lang['text_rest_api_key_time_limit'] = 'This API key has reached the time limit for this method';
16+
$lang['text_rest_ip_address_time_limit'] = 'This IP Address has reached the time limit for this method';
1617
$lang['text_rest_unknown_method'] = 'Unknown method';
1718
$lang['text_rest_unsupported'] = 'Unsupported protocol';

application/language/french/rest_controller_lang.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
$lang['text_rest_api_key_unauthorized'] = 'Cette clef d\'API n\'a pas accès au contrôleur demandé';
1414
$lang['text_rest_api_key_permissions'] = 'Cette clef d\'API n\'a pas les permissions requises';
1515
$lang['text_rest_api_key_time_limit'] = 'Cette clef d\'API a atteint sa limite de temps pour cette méthode';
16+
$lang['text_rest_ip_address_time_limit'] = 'This IP Address has reached the time limit for this method';//todo translate
1617
$lang['text_rest_unknown_method'] = 'Méthode inconnue';
1718
$lang['text_rest_unsupported'] = 'Protocole non-supporté';

application/language/german/rest_controller_lang.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
$lang['text_rest_api_key_unauthorized'] = 'Dieser API Schlüssel hat keinen Zugriff auf den angeforderten Controller';
1414
$lang['text_rest_api_key_permissions'] = 'Dieser API Schlüssel besitzt die erforderlichen Rechte nicht';
1515
$lang['text_rest_api_key_time_limit'] = 'Dieser API Schlüssel ist abgelaufen';
16+
$lang['text_rest_ip_address_time_limit'] = 'This IP Address has reached the time limit for this method';//todo translate
1617
$lang['text_rest_unknown_method'] = 'Unbekannte Methode';
1718
$lang['text_rest_unsupported'] = 'Protokoll nicht unterstützt';

application/language/greek/rest_controller_lang.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
$lang['text_rest_api_key_unauthorized'] = 'Αυτό το API key δεν έχει πρόσβαση στον συγκεκριμένο controller';
1414
$lang['text_rest_api_key_permissions'] = 'Αυτό το API key δεν έχει αρκετά δικαιώματα';
1515
$lang['text_rest_api_key_time_limit'] = 'Αυτό το API key έχει φτάσει στο μέγιστο όριο requests για την συγκεκριμένη μέθοδο';
16+
$lang['text_rest_ip_address_time_limit'] = 'This IP Address has reached the time limit for this method';//todo translate
1617
$lang['text_rest_unknown_method'] = 'Άγνωστη μέθοδος';
1718
$lang['text_rest_unsupported'] = 'Το συγκεκριμένο πρωτόκολλο δεν υποστηρίζεται';

application/language/portuguese-brazilian/rest_controller_lang.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
$lang['text_rest_api_key_unauthorized'] = 'Esta chave da API não tem acesso ao controller solicitado';
1414
$lang['text_rest_api_key_permissions'] = 'Esta chave da API não tem permissões suficientes';
1515
$lang['text_rest_api_key_time_limit'] = 'Esta chave da API já atingiu o tempo limite para este método';
16+
$lang['text_rest_ip_address_time_limit'] = 'This IP Address has reached the time limit for this method';//todo translate
1617
$lang['text_rest_unknown_method'] = 'Método desconhecido';
1718
$lang['text_rest_unsupported'] = 'Sem suporte para este protocolo';

application/language/romanian/rest_controller_lang.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
$lang['text_rest_api_key_unauthorized'] = 'Această cheie API nu are acees la controller-ul solicitat';
1414
$lang['text_rest_api_key_permissions'] = 'Această cheie API nu are suficiente permisiuni';
1515
$lang['text_rest_api_key_time_limit'] = 'Această cheie API a atins limita de timp pentru această metodă';
16+
$lang['text_rest_ip_address_time_limit'] = 'This IP Address has reached the time limit for this method';//todo translate
1617
$lang['text_rest_unknown_method'] = 'Metodă necunoscută';
1718
$lang['text_rest_unsupported'] = 'Protocol neacceptat';

application/language/serbian_cyr/rest_controller_lang.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
$lang['text_rest_api_key_unauthorized'] = 'Овај *API* кључ нема овлашћења за захтевани контролер';
1414
$lang['text_rest_api_key_permissions'] = 'Овај *API* кључ нема дозвољен степен овлашћења';
1515
$lang['text_rest_api_key_time_limit'] = 'Овај *API* кључ је прекорачио временски лимит за дати метод';
16+
$lang['text_rest_ip_address_time_limit'] = 'This IP Address has reached the time limit for this method';//todo translate
1617
$lang['text_rest_unknown_method'] = 'Непознат метод';
1718
$lang['text_rest_unsupported'] = 'Неподржан протокол';

application/language/serbian_lat/rest_controller_lang.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
$lang['text_rest_api_key_unauthorized'] = 'Ovaj API ključ nema ovlašćenje za zahtevani kontroler';
1414
$lang['text_rest_api_key_permissions'] = 'Ovaj API ključ nema dozvoljen stepen ovlašćenja';
1515
$lang['text_rest_api_key_time_limit'] = 'Ovaj API ključ je prekoračio vremenski limit za dati metod';
16+
$lang['text_rest_ip_address_time_limit'] = 'This IP Address has reached the time limit for this method';//todo translate
1617
$lang['text_rest_unknown_method'] = 'Nepoznat metod';
1718
$lang['text_rest_unsupported'] = 'Nepodržan protokol';

0 commit comments

Comments
 (0)