fix(xaa): address review nits from #1593 & use discoveryState#1721
Draft
fix(xaa): address review nits from #1593 & use discoveryState#1721
Conversation
…s_in - Replace inline return type with OAuthTokens in exchangeJwtAuthGrant - Use parseErrorResponse for proper OAuthError in both token exchange functions - Use z.coerce.number() for expires_in in IdJagTokenExchangeResponseSchema - Update tests to use real Response objects and check OAuthError type
|
@modelcontextprotocol/client
@modelcontextprotocol/server
@modelcontextprotocol/express
@modelcontextprotocol/hono
@modelcontextprotocol/node
commit: |
Remove individual saveAuthorizationServerUrl/saveResourceUrl methods from OAuthClientProvider in favor of adding resourceUrl to OAuthDiscoveryState. CrossAppAccessProvider now reads both URLs from the discovery state, eliminating redundant save calls in auth(). The single saveDiscoveryState call is moved after selectResourceURL so it can include the resolved resource URL.
CrossAppAccessProvider reads resourceMetadata.resource from the discovery state instead of a separate resourceUrl field. selectResourceURL throws if validation fails, so by the time saveDiscoveryState is called the resource metadata is always valid. This reverts the needsDiscoveryStateSave flag and restores the original two inline saveDiscoveryState calls.
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.
Address review nits from PR #1593:
OAuthTokenstype instead of inline return type inexchangeJwtAuthGrantparseErrorResponsefor properOAuthErrorin both token exchange functionsz.coerce.number()forexpires_ininIdJagTokenExchangeResponseSchemato match existing patternI also missed in that diff that we didn't end up refactoring to use the merged discoveryState, so this switches over to that.