1
0
mirror of https://github.com/delight-im/PHP-Auth.git synced 2025-07-30 21:00:13 +02:00

Make 'throttle' method for throttling or rate limiting a public method

This commit is contained in:
Marco
2017-08-19 00:42:53 +02:00
parent c5ed53898e
commit 52ba03248d

View File

@@ -1584,7 +1584,7 @@ final class Auth extends UserManager {
* @throws TooManyRequestsException if the actual demand has exceeded the designated supply
* @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)
$key = Base64::encodeUrlSafeWithoutPadding(
\hash(