* fix: allow wildcard prefix in normalizeDomain function
The normalizeDomain function now accepts domains with *. prefix
(e.g., *.cal.com) for wildcard domain matching in the watchlist.
The domain part after *. is validated using the existing regex.
Co-Authored-By: alex@cal.com <me@alexvanandel.com>
* fix: allow wildcard domains in validation checks
Update WatchlistOperationsService and CreateBlocklistEntryModal to
accept wildcard domain prefixes (*.) in domain validation. This ensures
wildcard domains like *.cal.com can be added through both the API and UI.
Co-Authored-By: alex@cal.com <me@alexvanandel.com>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-01-29 21:56:55 -03:00
Alex van AndelGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* feat: add wildcard domain matching to watchlist
When a domain is blocked in the watchlist (e.g., cal.com), all subdomains
are now also blocked (e.g., app.cal.com, sub.app.cal.com).
Changes:
- Add getParentDomains() utility to extract all parent domains
- Update GlobalBlockingService.isBlocked() and areBlocked() for wildcard matching
- Update OrganizationBlockingService.isBlocked() and areBlocked() for wildcard matching
- Add comprehensive tests for wildcard domain matching
- More specific subdomain matches take precedence over parent domain matches
- Email matches still take precedence over domain matches
Co-Authored-By: alex@cal.com <me@alexvanandel.com>
* feat: make wildcard domain matching configurable
- *.cal.com blocks all subdomains (app.cal.com, sub.app.cal.com, etc.)
- cal.com only blocks exact matches (not subdomains)
- Updated getWildcardPatternsForDomain to generate wildcard patterns
- Added domainMatchesWatchlistEntry for configurable matching logic
- Updated GlobalBlockingService and OrganizationBlockingService
- Updated tests to verify new behavior
Co-Authored-By: alex@cal.com <me@alexvanandel.com>
* refactor: simplify wildcard pattern generation to strip only first part
- Only strips the first part before the first dot
- Handles multi-part TLDs correctly (e.g., .co.uk)
- Returns empty array for two-part domains (e.g., cal.com -> no pattern)
- app.cal.com -> *.cal.com
- bloody-hell.cal.co.uk -> *.cal.co.uk
Co-Authored-By: alex@cal.com <me@alexvanandel.com>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* --init
* --
* replace old structure with new DI
* fix type
* --
* moving stuff around
* moving stuff around again
* minor clean up
* --
* resolve conflict
* clea up
* old schema clean up
* further clean up
* removing unwanted merged responsibilities
* --
* improve DI and SOLID
* some type fixes
* --1
* clean up --cont
* fix DI in facade for test
* more fix
* fix
* checking
* o.o
* fix import
* fix failing test --2
* fix failing test --3
* fix failing test --4
* normalization use
* introduce facade container injection
* uniform async telemetry spans
* further improvements
* replace prismock with repo mocks
* ensure we don't pass prisma outside of repo
* fix import
* remove try catch from repo calls
* async await fixes
* using deps pattern
* more clean up and fixes
* more clean up
* address feedback --1
* separation of concern
* clean up
* test clean up
* feedback --2
* remove extra fetch
* remove await
* migrate _post test from prismock
* fix type
* --
* fix tokens path
* rename AuditRepo
* test --1
* update _post to integration test
* fix test
* fix test
* test fix maybe?
* --
* feedback
* feedback
* fixes
* more feedback
* NIT
* use sentry and logger imports as planned
* assertion in test
* add missing test case
* add tests for controllers and services
* NITs
* fix domain normalisation