Interface Yiisoft\Yii\RateLimiter\Policy\LimitPolicyInterface
| Implemented by | Yiisoft\ |
|---|
Defines policy for limiting requests i.e. which requests should be hit-counted together and which should be counted separately.
For example, a user ID-based fingerprint will make rate limiting apply to current user requests only. An API token-based fingerprint will make rate limiting to apply to all requests with the same token.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| fingerprint() | Returns request fingerprint. Two requests with the same fingerprint increase request counter. Requests with different fingerprints are counted and limited separately. | Yiisoft\ |
Method Details
Returns request fingerprint. Two requests with the same fingerprint increase request counter. Requests with different fingerprints are counted and limited separately.
| public abstract string fingerprint ( \ | ||
| $request | \ |
Request to get fingerprint for. |
| return | string |
A fingerprint based on the request information. |
|---|---|---|
public function fingerprint(ServerRequestInterface $request): string;
User Contributed Notes
Leave a comment
Join the conversation to share a note.