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

Offen
#11 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
48/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
typescript
Bereich
backend

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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).

Vorherrschende Sprache
TypeScript
Sterne
36
Forks
14
Ø Merge
15 Min.
Gemergte PRs (30 T.)
1

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus reddit/devvit-kit

Alle Issues in reddit/devvit-kit

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.