Skip to content

clasign.osinfra.cn存在邮件重置未限流滥发问题 - #405

Closed
JavaPythonAIForBAT wants to merge 1 commit into
reviewfrom
fix_limit_rate
Closed

JavaPythonAIForBAT wants to merge 1 commit into
reviewfrom
fix_limit_rate

Conversation

@JavaPythonAIForBAT

Copy link
Copy Markdown
Contributor

增加访问频率限制,一天只能访问5次;
邮箱统一改为小写

@JavaPythonAIForBAT
JavaPythonAIForBAT changed the base branch from master to review_test_debug September 9, 2025 08:04
@JavaPythonAIForBAT
JavaPythonAIForBAT changed the base branch from review_test_debug to review September 9, 2025 08:04

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Summary of Changes

Hello @JavaPythonAIForBAT, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

此拉取请求旨在通过引入访问频率限制和标准化邮箱处理来增强系统的安全性和健壮性。同时,它对现有架构进行了大规模重构,将核心业务逻辑拆分为更清晰、可维护的模块,并更新了底层基础设施。这些变更将提高系统的可靠性、可扩展性,并为未来的功能开发奠定坚实基础。

Highlights

  • 安全增强: 引入了邮件重置功能的访问频率限制,并统一将邮箱地址转换为小写,以防止滥发和提高数据一致性。
  • 架构重构: 对代码库进行了大规模重构,引入了新的通用模块(如配置、仓库错误、MongoDB和Redis操作),并对认证、CLA管理、企业邮件域、密码找回和SMTP配置等核心功能进行了模块化。
  • 基础设施更新: Dockerfile更新至OpenEuler基础镜像和Go 1.24.1,提升了构建环境的现代化和安全性。
  • 配置管理优化: 移除了旧的.conf和.yaml配置文件,转向更结构化的配置管理方式。
  • 隐私与合规: 新增了隐私政策和Cookie政策文档,并更新了相关邮件模板,以增强用户隐私保护和合规性。
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@JavaPythonAIForBAT

Copy link
Copy Markdown
Contributor Author

各位大佬审核下

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

本次代码变更旨在为密码重置功能增加频率限制,以防止滥用,并将邮箱地址统一转为小写。为此,您引入了一个基于 Redis 的通用频率限制器。整体方向是正确的,但在频率限制器的具体实现上存在一些问题。CheckAndRecordRateLimitRecordRequest 方法中都存在竞态条件,可能导致无法严格执行频率限制。此外,在控制器代码中有一个未使用的函数参数。我将提供具体的修改建议来修复这些问题。

Comment thread common/infrastructure/redisdb/ratelimit.go Outdated
Comment thread common/infrastructure/redisdb/ratelimit.go Outdated
Comment thread controllers/password_retrieval.go Outdated
@JavaPythonAIForBAT

Copy link
Copy Markdown
Contributor Author

各位大佬审核下

@JavaPythonAIForBAT
JavaPythonAIForBAT force-pushed the fix_limit_rate branch 2 times, most recently from 8a9a862 to c75ad50 Compare September 9, 2025 08:38
Comment thread controllers/password_retrieval.go Outdated
Comment thread controllers/password_retrieval.go Outdated
@tfhddd

tfhddd commented Sep 9, 2025

Copy link
Copy Markdown
Contributor

commit要合一,当前有3个commit

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