fix(types): preserve securitySchemes and oneof fields in fromJSON codecs - #664
Open
Varun-S10 wants to merge 1 commit into
Open
fix(types): preserve securitySchemes and oneof fields in fromJSON codecs#664Varun-S10 wants to merge 1 commit into
Varun-S10 wants to merge 1 commit into
Conversation
🧪 Code CoverageNo coverage changes. Generated by coverage-comment.yml |
Contributor
|
The file |
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.
Description
What does this PR do?
Fixes an issue where
canonicalizeAgentCard()droppedsecuritySchemeswhen passed anAgentCardinstance.Why is this needed?
Protobuf
oneoffields in TypeScript instances use the{ scheme: { $case, value } }format.SecurityScheme.fromJSONandOAuthFlows.fromJSONpreviously expected only raw ProtoJSON object keys (likeopenIdConnectSecurityScheme), so passing anAgentCardinstance causedsecuritySchemesto be silently dropped during canonicalization. This caused signature verification to fail when signing withAgentCard.fromJSON()and verifying with plain JSON, and broke cross-SDK verification with Python.What changes were made?
SecurityScheme.fromJSONto accept both external ProtoJSON format and internal{$case, value}representations.OAuthFlows.fromJSONwith the same{$case, value}support.test/types/security_schemes.spec.tsand regression tests intest/signature.spec.ts.Thank you for opening a Pull Request!
Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
CONTRIBUTINGGuide.fix:which represents bug fixes, and correlates to a SemVer patch.feat:represents a new feature, and correlates to a SemVer minor.feat!:, orfix!:,refactor!:, etc., which represent a breaking change (indicated by the!) and will result in a SemVer major.Fixes #663 🦕