Repository navigation
Fix Draft 4 wire, transport, stream and handshake conformance gaps - #4
Open
prateekbhujel wants to merge 1 commit into
Open
prateekbhujel wants to merge 1 commit into
prateekbhujel wants to merge 1 commit into
Conversation
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.
Closes a set of Asgard Protocol Draft 4 conformance gaps in the wire, transport, stream and handshake layer:
Early rejections 415 and 422 (§6.3, §7.3, §8)
AsgardClient::EARLY_REJECTIONSomitted415 unsupported_codingand422 unsupported_protocol(with aprotocolslist). During the QUERY transport probe, those unsigned rejections triggered a forbidden POST retry and were classified asinvalidinstead ofserver.Empty
stateencoded as{}on/render,/calland/upload(§5.1)RegionStreams::open()already casts emptystateto(object)so it encodes as{}, butAsgardClient::call()andAsgardClient::frame()encoded PHP[]as JSON"state":[]. Both now encode emptystateas{}.419verification failures and probe fallback session handling (§6.3, §8)AsgardClient::send()no longer re-handshakes and retries when a419response failed signature verification. During an unsettled QUERY probe, a non-Asgard419page no longer evicts the cached session before falling back to POST.Asgard-Cache: invalidatewithcached: true, listchrome, and protocol version checks (§6.2, §7.3, §8.3, §11)AsgardClientnow refuses{"cached": true}parts whenAsgard-Cache: invalidateis set, refuses list-shapedchrome, and checksprotocol === 1on render, call, upload and routes answers.Wire::openResponse()now checks that the signedAsgard-Protocolheader matches1.SSE event envelope key order and unknown members (§5.3, §8.1)
Wire::openEvent()requiredarray_keys($json) === ['body', 'enc', 'sig'], rejecting events with reordered keys or extra members. It now checks required member presence and types and ignores key order and unknown members.Handshake
elementslimits (§6.1)FragmentTypes::advertised()now enforces the 64-character name limit and the 256-entry cap.Push stream version tracking and event validation (§8.1, §9.4)
RegionStreams::receive()now advances the held subscription version only when$this->pusherreturns> 0(matchingpatch()), and validates eventprotocol,version, andfromtokens.Call and upload failure reasons and delta type mismatches (§5.3, §5.4, §10.2, §10.5, §10.6)
HttpServerTransport::answered()(shared withHttpUploadTransport) now forwardsHttpFragmentSource::reasonFor()soServerActionFailedsurfaces verification failures and malformed 200 answers asinvalidrather thanserver.ServerMethods::reconcile()catchesTypeErrorwhen a delta value does not fit a typed property, refusing and logging it instead of aborting delivery.Verification:
vendor/bin/pest: 955 passed, 1 skipped (4375 assertions)vendor/bin/pint --test: passed