Skip to content

feat(toolkit): add email blocklist helpers#9119

Open
charIeszhao wants to merge 1 commit into
charles-fix-email-or-domain-regexfrom
charles-log-13761-email-blocklist-helpers
Open

feat(toolkit): add email blocklist helpers#9119
charIeszhao wants to merge 1 commit into
charles-fix-email-or-domain-regexfrom
charles-log-13761-email-blocklist-helpers

Conversation

@charIeszhao

Copy link
Copy Markdown
Member

Summary

Add reusable core-kit helpers for validating and matching email blocklist items. The helpers support exact address/domain entries and optional wildcard patterns with case-insensitive matching.

Testing

Unit tests

Checklist

  • .changeset
  • unit tests
  • integration tests
  • necessary TSDoc comments

@charIeszhao charIeszhao requested a review from gao-sun as a code owner July 1, 2026 10:21
Copilot AI review requested due to automatic review settings July 1, 2026 10:21
@github-actions github-actions Bot added the feature Cool stuff label Jul 1, 2026
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

COMPARE TO master

Total Size Diff 📈 +7.53 KB

Diff by File
Name Diff
.changeset/email-blocklist-helpers.md 📈 +95 Bytes
.changeset/email-domain-regex.md 📈 +123 Bytes
packages/toolkit/core-kit/src/email-blocklist.test.ts 📈 +2.56 KB
packages/toolkit/core-kit/src/email-blocklist.ts 📈 +3.08 KB
packages/toolkit/core-kit/src/index.ts 📈 +38 Bytes
packages/toolkit/core-kit/src/regex.test.ts 📈 +1.46 KB
packages/toolkit/core-kit/src/regex.ts 📈 +178 Bytes

Comment thread packages/toolkit/core-kit/src/email-blocklist.ts Fixed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds reusable @logto/core-kit helpers for validating email blocklist entries and checking whether an email matches an entry (including optional * wildcard support), intended to centralize blocklist parsing/matching logic for other packages to reuse.

Changes:

  • Added isEmailBlocklistItem() for validating exact and wildcard-enabled email/domain blocklist items
  • Added matchesEmailBlocklistItem() for case-insensitive matching against exact or wildcard items
  • Exported the helpers from core-kit, added Vitest unit tests, and included a changeset for release

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/toolkit/core-kit/src/index.ts Exports the new email blocklist helpers from core-kit’s public entrypoint
packages/toolkit/core-kit/src/email-blocklist.ts Implements validation + matching helpers (exact and wildcard patterns)
packages/toolkit/core-kit/src/email-blocklist.test.ts Adds unit tests covering validation and matching behavior (including metachar escaping)
.changeset/email-blocklist-helpers.md Declares a minor release for @logto/core-kit to ship the new helpers

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/toolkit/core-kit/src/email-blocklist.ts
@charIeszhao charIeszhao force-pushed the charles-log-13761-email-blocklist-helpers branch from 9904efe to c2fe590 Compare July 1, 2026 13:27
@github-actions github-actions Bot added size/m and removed size/m labels Jul 1, 2026
@charIeszhao charIeszhao changed the base branch from master to charles-fix-email-or-domain-regex July 1, 2026 13:28
@github-actions github-actions Bot added size/m and removed size/m labels Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants