Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support request methods selection #12

Merged
merged 3 commits into from
Jul 16, 2019
Merged

Support request methods selection #12

merged 3 commits into from
Jul 16, 2019

Conversation

baudev
Copy link
Contributor

@baudev baudev commented Jul 9, 2019

Thanks to this PR, it's possible selecting to which specific methods the rate limit is applied:

/**
 * @ApiResource
 * @ORM\Entity
 * @ApiRateLimit(
 *     enabled=true, 
 *     throttle={
 *         "default"={
 *             "limit"=2,
 *             "period"=10
 *         }
 *     }
 *     },
 *     methods={"GET", "DELETE"}
 * )
 */
class Foo {

}

If the method is not corresponding to the annotation ones (e.g POST), then it's the global configuration rate limit that is applied.

Notes: this PR is based on the following fix: #11

@IndraGunawan
Copy link
Owner

Hi @baudev could you please fix the conflict

@baudev
Copy link
Contributor Author

baudev commented Jul 15, 2019

Please, don't forget pushing a new tag 😉 The last one (v0.2.1) dates back to 2017!

@IndraGunawan IndraGunawan merged commit 55ade1a into IndraGunawan:master Jul 16, 2019
@IndraGunawan
Copy link
Owner

thanks @baudev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants