mirror of
https://github.com/delight-im/PHP-Auth.git
synced 2025-08-04 15:17:28 +02:00
Make 'throttle' method for throttling or rate limiting a public method
This commit is contained in:
@@ -1584,7 +1584,7 @@ final class Auth extends UserManager {
|
|||||||
* @throws TooManyRequestsException if the actual demand has exceeded the designated supply
|
* @throws TooManyRequestsException if the actual demand has exceeded the designated supply
|
||||||
* @throws AuthError if an internal problem occurred (do *not* catch)
|
* @throws AuthError if an internal problem occurred (do *not* catch)
|
||||||
*/
|
*/
|
||||||
protected function throttle(array $criteria, $supply, $interval, $burstiness = null, $simulated = null, $cost = null) {
|
public function throttle(array $criteria, $supply, $interval, $burstiness = null, $simulated = null, $cost = null) {
|
||||||
// generate a unique key for the bucket (consisting of 44 or fewer ASCII characters)
|
// generate a unique key for the bucket (consisting of 44 or fewer ASCII characters)
|
||||||
$key = Base64::encodeUrlSafeWithoutPadding(
|
$key = Base64::encodeUrlSafeWithoutPadding(
|
||||||
\hash(
|
\hash(
|
||||||
|
Reference in New Issue
Block a user