feat:RuoYi-Cloud-Plus test#11
Conversation
|
Important Review skippedToo many files! This PR contains 300 files, which is 150 over the limit of 150. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (300)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 4 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| captcha.setGenerator(codeGenerator); | ||
| captcha.createCode(); | ||
| // 如果是数学验证码,使用SpEL表达式处理验证码结果 | ||
| String code = captcha.getCode(); |
There was a problem hiding this comment.
Singleton captcha beans cause race condition under concurrency
High Severity
The captcha beans (CircleCaptcha, LineCaptcha, ShearCaptcha) are registered as singletons (default @Bean scope), but getCodeImpl mutates them on every request via setGenerator and createCode. Under concurrent requests, one thread's setGenerator call can be overwritten by another thread before createCode runs, causing the generated captcha code to mismatch the image returned to the user. The code stored in Redis will differ from what the user sees.
Additional Locations (1)
| String referer = request.getHeader("referer"); | ||
| if (StringUtils.isNotBlank(referer)) { | ||
| // 这里从referer中取值是为了本地使用hosts添加虚拟域名,方便本地环境调试 | ||
| host = referer.split("//")[1].split("/")[0]; |
There was a problem hiding this comment.
Referer header parsing may throw ArrayIndexOutOfBoundsException
Medium Severity
The referer header is split by "//" and index [1] is accessed without bounds checking. A non-blank referer that doesn't contain // (e.g., a malformed or adversarially crafted header) will cause an ArrayIndexOutOfBoundsException, crashing the /tenant/list endpoint. Since referer comes from the client, it cannot be trusted to follow the expected format.
| // 判断授权响应是否成功 | ||
| if (!response.ok()) { | ||
| return R.fail(response.getMsg()); | ||
| } |
There was a problem hiding this comment.
AuthUser data accessed before checking response success
Medium Severity
In socialCallback, response.getData() is called on line 146 before response.ok() is checked on line 148. When the auth response indicates failure, getData() may return null, and the authUserData variable will be null. While this particular null value isn't used in the error path, it's a logic ordering issue — the success check belongs before any data extraction to avoid confusion and potential future bugs.
|
|
||
| // 校验 appid + appsrcret + xcxCode 调用登录凭证校验接口 获取 session_key 与 openid | ||
| AuthRequest authRequest = new AuthWechatMiniProgramRequest(AuthConfig.builder() | ||
| .clientId(appid).clientSecret("自行填写密钥 可根据不同appid填入不同密钥") |
There was a problem hiding this comment.
Hardcoded placeholder secret in production authentication code
High Severity
The WeChat mini-program clientSecret is hardcoded as the literal string "自行填写密钥 可根据不同appid填入不同密钥" (meaning "fill in the secret yourself"). This placeholder in production authentication code means the mini-program login flow will always fail. This value needs to be externalized to configuration.


Note
High Risk
High risk because this introduces new authentication endpoints/strategies and cross-service Dubbo RPC interfaces that impact login, registration, captcha validation, and tenant selection flows.
Overview
Adds project-level scaffolding and build configuration:
.editorconfig,.gitignore, Gitee issue/PR templates, IntelliJ Docker run configs, an MITLICENSE, an expandedREADME, and a new rootpom.xmldefining module layout and dependency/BOM management.Introduces a new
ruoyi-apimodule set (system/resource/workflow) defining Dubbo-facingRemote*Serviceinterfaces plus DTO/BO/VO models and fallback/stub implementations (e.g., file, messaging, workflow mocks).Adds a new
ruoyi-authservice with Docker packaging and Spring Boot setup, including/codecaptcha generation (rate-limited + Redis-backed),/logintoken issuance with pluggableIAuthStrategyimplementations (password/sms/email/social/xcx), tenant list/registration endpoints, and a Sa-Token listener that records online sessions and login events.Written by Cursor Bugbot for commit a5fe13b. This will update automatically on new commits. Configure here.