Closed dreamhunter2333 closed 1 month ago
⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪ |
🔒 No security concerns identified |
⚡ Key issues to review Possible Bug The `checkNameRegex` function does not return any value if the regex string is not found. This could lead to unexpected behavior. Consider returning a boolean or throwing an error to handle this case explicitly. Code Smell The `checkNameRegex` function logs an error but does not propagate it. This could make debugging difficult. Consider rethrowing the error or handling it in a way that the caller is aware of the failure. |
User description
414
PR Type
Enhancement, Documentation
Description
newAddress
function calls across multiple files to use an object for parameters.checkNameRegex
function to validate address names againstADDRESS_CHECK_REGEX
.Bindings
type to includeADDRESS_CHECK_REGEX
./user_api/oauth2
to the list of paths that bypass middleware.ADDRESS_CHECK_REGEX
feature.Changes walkthrough 📝
6 files
index.ts
Refactor `newAddress` function call to use object parameters
worker/src/admin_api/index.ts
newAddress
function call to use an object for parameters.enableCheckNameRegex
parameter with a default value offalse
.common.ts
Add name validation using `ADDRESS_CHECK_REGEX`
worker/src/common.ts
checkNameRegex
function to validate name againstADDRESS_CHECK_REGEX
.newAddress
function to includeenableCheckNameRegex
parameter.index.ts
Refactor `newAddress` function call to use object parameters
worker/src/mails_api/index.ts
newAddress
function call to use an object for parameters.common.ts
Refactor `newAddress` function call to use object parameters
worker/src/telegram_api/common.ts
newAddress
function call to use an object for parameters.types.d.ts
Add `ADDRESS_CHECK_REGEX` to `Bindings` type
worker/src/types.d.ts - Added `ADDRESS_CHECK_REGEX` to `Bindings` type.
worker.ts
Add `/user_api/oauth2` to middleware bypass paths
worker/src/worker.ts
/user_api/oauth2
to the list of paths that bypass middleware.4 files
CHANGELOG.md
Update CHANGELOG for `ADDRESS_CHECK_REGEX` feature
CHANGELOG.md
ADDRESS_CHECK_REGEX
for address namevalidation.
cli.md
Document `ADDRESS_CHECK_REGEX` in CLI guide
vitepress-docs/docs/en/cli.md - Added documentation for `ADDRESS_CHECK_REGEX`.
worker.md
Document `ADDRESS_CHECK_REGEX` in CLI guide (Chinese)
vitepress-docs/docs/zh/guide/cli/worker.md - Added documentation for `ADDRESS_CHECK_REGEX`.
wrangler.toml.template
Add `ADDRESS_CHECK_REGEX` configuration example
worker/wrangler.toml.template - Added `ADDRESS_CHECK_REGEX` configuration example.