-
Notifications
You must be signed in to change notification settings - Fork 89
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
chore: disbale public registration by default #764
Conversation
WalkthroughThis pull request modifies the public registration configuration. It introduces a new option Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant R as Registration Module
participant C as Config
U->>R: Submit Registration
R->>C: Check allowPublicRegistration flag
C-->>R: Return false
R->>U: Deny registration request
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
test/.setup.tsOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-eggache". (The package "eslint-plugin-eggache" was not found when loaded as a Node module from the directory "".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
The plugin "eslint-plugin-eggache" was referenced from the config file in ".eslintrc » eslint-config-egg/typescript » ./index.js". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. test/TestUtil.tsOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-eggache". (The package "eslint-plugin-eggache" was not found when loaded as a Node module from the directory "".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
The plugin "eslint-plugin-eggache" was referenced from the config file in ".eslintrc » eslint-config-egg/typescript » ./index.js". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. ✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
涉及注册的单测估计都需要全局 mock 一下 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #764 +/- ##
=======================================
Coverage 96.43% 96.43%
=======================================
Files 192 192
Lines 19306 19306
Branches 2526 2526
=======================================
Hits 18618 18618
Misses 688 688 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
test/TestUtil.ts (1)
136-138
: Static method implementation looks good, but consider a small refactor.The new
allowPublicRegistration()
method correctly sets the configuration flag to enable public registration for testing purposes. This is essential for test compatibility with the changed default setting.Consider using the class name instead of
this
in the static method to improve clarity:static allowPublicRegistration() { - this.app.config.cnpmcore.allowPublicRegistration = true; + TestUtil.app.config.cnpmcore.allowPublicRegistration = true; }🧰 Tools
🪛 Biome (1.9.4)
[error] 136-136: Using this in a static context can be confusing.
this refers to the class.
Unsafe fix: Use the class name instead.(lint/complexity/noThisInStatic)
[error] 137-137: Using this in a static context can be confusing.
this refers to the class.
Unsafe fix: Use the class name instead.(lint/complexity/noThisInStatic)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
DEVELOPER.md
(1 hunks)INTEGRATE.md
(1 hunks)test/.setup.ts
(1 hunks)test/TestUtil.ts
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- INTEGRATE.md
🧰 Additional context used
🪛 Biome (1.9.4)
test/TestUtil.ts
[error] 136-136: Using this in a static context can be confusing.
this refers to the class.
Unsafe fix: Use the class name instead.
(lint/complexity/noThisInStatic)
[error] 137-137: Using this in a static context can be confusing.
this refers to the class.
Unsafe fix: Use the class name instead.
(lint/complexity/noThisInStatic)
🔇 Additional comments (2)
test/.setup.ts (1)
8-8
: Integration of the test environment with new registration policy looks good.The addition of
TestUtil.allowPublicRegistration()
in the test setup ensures that all existing tests continue to work despite the default configuration change. This is a necessary adjustment given that public registration is now disabled by default.DEVELOPER.md (1)
76-78
: Documentation update provides clear guidance on the new default setting.This addition effectively informs users about the new security policy where public registration is disabled by default, and provides instructions on how to enable it if needed. This aligns well with the PR's objective to enhance security by preventing arbitrary user registrations.
allowPublicRegistration
为false
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests