fix: calendar_id validation rejects valid IDs with @ and . chars - #194
Merged
Conversation
The validateToken regex was too strict (only [A-Za-z0-9_-]), rejecting valid Feishu calendar IDs that contain @ and . characters (e.g., Google Calendar IDs like user@gmail.com, shared/subscribed calendars). This caused repeated "无效的 calendar_id" errors when the Claude agent tried to query specific calendars, while queries to the primary calendar (no calendar_id) worked fine. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cover new calendar_id-specific regex (allows @.=+:), ensure path traversal still blocked, and verify strict mode still applies to non-calendar tokens. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
|
Claude finished @lishuceo's task in 1m 2s —— View job PR Review: #194 — calendar_id validation✅ Approved — Clean, well-scoped fix with good test coverage. What changed:
Security check:
Minor note (not blocking): The doc comment on line 6 says "仍禁止 Tests: 3 new test cases covering valid calendar IDs, path traversal rejection, and strict validation for non-calendar tokens — good coverage. |
lishuceo
added a commit
that referenced
this pull request
Apr 8, 2026
fix: calendar_id validation rejects valid IDs with @ and . chars
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
validateToken()regex^[A-Za-z0-9_-]+$was too strict, rejecting valid calendar IDs containing@,.,=,+,:charactersCALENDAR_ID_REregex specifically for calendar_id that allows these chars while still blocking path traversal (/,\,.., spaces)feishu_calendar tool error("无效的 calendar_id") when querying shared/subscribed/Google calendarsEvidence from logs
Multiple occurrences across March 23-26.
Test plan
@,.,=,+,:chars../,/) still rejected for calendar_id🤖 Generated with Claude Code