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

Add rate limiter for signing up #4128

Merged
merged 3 commits into from Jun 28, 2023

Conversation

JohnNiang
Copy link
Member

What type of PR is this?

/kind feature
/area core
/milestone 2.7.x

What this PR does / why we need it:

Add rate limiter for signing up. We only allow 3 registrations within 1 hour by default, despite registration failure.

Special notes for your reviewer:

  1. Start Halo and console.
  2. Try to enable registration for public users.
  3. Browse http://localhost:8090/console/login?type=signup
  4. Input duplicate username for 4 times and see the result.
  5. Or input valid username for 4 times and see the result.

Does this PR introduce a user-facing change?

限制注册接口的请求速率

@f2c-ci-robot f2c-ci-robot bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Jun 27, 2023
@f2c-ci-robot f2c-ci-robot bot added this to the 2.7.x milestone Jun 27, 2023
@f2c-ci-robot f2c-ci-robot bot added kind/feature Categorizes issue or PR as related to a new feature. area/core Issues or PRs related to the Halo Core labels Jun 27, 2023
@f2c-ci-robot f2c-ci-robot bot requested review from LIlGG and wan92hen June 27, 2023 08:05
@codecov
Copy link

codecov bot commented Jun 27, 2023

Codecov Report

Merging #4128 (6710503) into main (cabcd98) will decrease coverage by 0.04%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##               main    #4128      +/-   ##
============================================
- Coverage     60.20%   60.17%   -0.04%     
  Complexity     2414     2414              
============================================
  Files           366      366              
  Lines         12575    12580       +5     
  Branches        906      906              
============================================
- Hits           7571     7570       -1     
- Misses         4564     4571       +7     
+ Partials        440      439       -1     
Impacted Files Coverage Δ
...un/halo/app/theme/endpoint/PublicUserEndpoint.java 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

Copy link
Member

@guqing guqing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Jun 28, 2023
@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Jun 28, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: guqing

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 28, 2023
@f2c-ci-robot f2c-ci-robot bot merged commit 00dd95c into halo-dev:main Jun 28, 2023
4 checks passed
@ruibaby ruibaby modified the milestones: 2.7.x, 2.7.0 Jun 28, 2023
@JohnNiang JohnNiang deleted the feat/rate-limiting-signup branch June 29, 2023 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/core Issues or PRs related to the Halo Core kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants