fix(calendar): support bot identity in +search-event - #2011
Conversation
|
|
b45cbfe to
9b22d87
Compare
📝 WalkthroughWalkthroughThe ChangesCalendar Search Event
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
calendar +search-eventrejects bot identity during local shortcut validation, even though the underlying Search Event API and the generatedcalendar events search_eventcommand support bot access. This prevents agents from locating events in calendars accessible to the application, including events created and managed by the application itself.Official API: https://open.larkoffice.com/document/server-docs/calendar-v4/calendar-event/search
Evidence
The generated command schema advertises both identities:
{ "access_tokens": ["bot", "user"] }Before this change, the shortcut fails before making an API request:
The generated command succeeds with the same bot identity and returns an event created in the application's primary calendar:
After changing the shortcut identity declaration, a locally built CLI successfully finds the same event through
calendar +search-event --as bot.This isolates the failure to the shortcut's local
AuthTypesdeclaration rather than the Open Platform API or application permissions.Scope and permission boundary
This change does not expand calendar visibility. User identity continues to search calendars accessible to the user; bot identity searches only calendars accessible to the application. Bot identity does not automatically gain access to users' personal calendars.
Changes
calendar +search-eventto run withuserorbotidentity.+search-event, then clean it up.Test Plan
make unit-testgo vet ./...gofmt -l .produces no outputgo mod tidyproduces nogo.mod/go.sumchangesgolangci-lint --new-from-rev=origin/mainreports0 issuesRelated Issues
Summary by CodeRabbit
New Features
Tests
Documentation