fix(feishu): correct invalid scope name in permission grant URL#31943
Closed
Sid-Qin wants to merge 1 commit intoopenclaw:mainfrom
Closed
fix(feishu): correct invalid scope name in permission grant URL#31943Sid-Qin wants to merge 1 commit intoopenclaw:mainfrom
Sid-Qin wants to merge 1 commit intoopenclaw:mainfrom
Conversation
The Feishu API returns error code 99991672 with an authorization URL containing the non-existent scope `contact:contact.base:readonly` when the `contact.user.get` endpoint is called without the correct permission. The valid scope is `contact:user.base:readonly`. Add a scope correction map that replaces known incorrect scope names in the extracted grant URL before presenting it to the user/agent, so the authorization link actually works. Closes openclaw#31761
Contributor
Greptile SummaryFixes Feishu API bug where permission error responses contain invalid scope name
The fix is pragmatic and localized - if Feishu resolves the API bug, the correction becomes a harmless no-op. All 220 Feishu tests pass. Confidence Score: 4/5
Last reviewed commit: 47e5727 |
This comment was marked as spam.
This comment was marked as spam.
Contributor
|
Superseded by #32509. Reason: this environment does not have permission to update the fork head branch for #31943 ( #32509 contains the same functional fix plus the changelog entry, was verified locally with full gate ( |
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
contact:contact.base:readonly. The correct scope iscontact:user.base:readonly.extractPermissionErrorthat replaces known incorrect scope names (both raw and URL-encoded) in the grant URL before presenting it to the user.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
contact:user.base:readonlySecurity Impact (required)
NoNoNoNoNoRepro + Verification
Steps
contact:user.base:readonlygrantedExpected
Grant URL contains
contact:user.base:readonly, admin can authorize.Actual (before fix)
Grant URL contains
contact:contact.base:readonly, which doesn't exist on Feishu Open Platform.Evidence
Human Verification (required)
Compatibility / Migration
Yes— only affects grant URL correctionNoNoFailure Recovery (if this breaks)
FEISHU_SCOPE_CORRECTIONSandcorrectFeishuScopeInUrlfrombot.ts