feat(toolkit): add email blocklist helpers#9119
Open
charIeszhao wants to merge 1 commit into
Open
Conversation
COMPARE TO
|
| 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 |
Contributor
There was a problem hiding this comment.
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.
9904efe to
c2fe590
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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