`getAllowedUsers` function incorrectly rejects usernames containing the digit '0'

未关闭
#11 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
typescript
领域
backend

调研方向

Start by locating getAllowedUsers in the @devvit/kit code and tracing how it parses or validates the allowedUsers setting. Reproduce the reported case with zom-bizzle0 alongside the accepted examples. Done when usernames containing 0 are accepted without allowing unintended partial matches.

由索引模型根据 Issue 内容生成。

描述

Issue Summary:
The getAllowedUsers function from @devvit/kit appears to have a parsing or validation issue that incorrectly rejects usernames containing the digit 0, while accepting partial usernames that don't contain 0.

(User string can only contain spaces, letters, numbers, "-", and "_")

Steps to Reproduce:

  1. Set the allowedUsers setting with usernames containing 0:
  2. Test access with different usernames:
    • ✅ zombizzle - Works
    • ✅ zombizzle2 - Works
    • ✅ zom-bizzle3 - Works
    • ❌ zom-bizzle0 - Fails (contains 0)

Expected Behavior:
All usernames should be accepted regardless of whether they contain the digit 0.

Actual Behavior:
Usernames containing the digit 0 are rejected, while partial usernames without 0 are accepted.

Impact:

  • Users with usernames containing 0 cannot access admin features
  • Partial username matching works, suggesting a parsing issue
  • Affects dev toolbar access control functionality

Workaround:
Users can work around this by using partial usernames or contacting support, but this is not ideal for production use.

Additional Notes:
This appears to be a specific issue with the getAllowedUsers function's parsing logic, as the same usernames work fine when used in other contexts (like Redis storage or direct settings access).

主要语言
TypeScript
星标
36
派生
14
平均合并
15 分钟
30 天内合并 PR
1

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

reddit/devvit-kit 的其他 Issue

查看 reddit/devvit-kit 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。