firebase / firebase/extensions
fix(firestore-send-email): anchor the SMTP_CONNECTION_URI validation regex (kit and legacy)
- Dominant language
- TypeScript
- Stars
- 979
- Forks
- 433
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 125
Description
The `SMTP_CONNECTION_URI` validationRegex accepts trailing garbage after a valid prefix: its first alternative has no `$` anchor, so e.g. `smtp://host:25 trailing junk` passes. Probe-verified; `...)$|^$` rejects the garbage forms. The bug is inherited: the legacy `firestore-send-email/extension.yaml` ships the identical unanchored regex (only the legacy test file carried an anchored copy that never shipped). Fix both the kit (`kits/firestore-send-email/src/config.ts:171`) and the legacy extension.yaml.
PR #3057 added a characterization test that pins the current unanchored acceptance - it is written to flip when this fix lands, so update it deliberately. Found by review on #3057 (IzaakGough). Ledger: #2974.
Contributor guide
Research direction
Start at kits/firestore-send-email/src/config.ts:171 and compare its SMTP_CONNECTION_URI validationRegex with firestore-send-email/extension.yaml. Review the characterization test added by PR #3057, then update it deliberately so trailing garbage is rejected in both kit and legacy configurations. Done means the relevant tests pass and both shipped regexes reject the malformed forms.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100