add req.queryString, crypto.hmacSha256, btoa/atob, encodeURIComponent…#93
Open
add req.queryString, crypto.hmacSha256, btoa/atob, encodeURIComponent…#93
Conversation
…/decodeURIComponent - lws-bridge: parse query string from path, expose as query_string field - http-server codegen: add queryString to request struct and handler metadata - crypto: add hmacSha256 (openssl HMAC) and pbkdf2 (PKCS5_PBKDF2_HMAC) - base64-bridge.c: cs_btoa/cs_atob for base64 encode/decode - uri-bridge.c: cs_encode_uri_component/cs_decode_uri_component - calls.ts: dispatch btoa, atob, encodeURIComponent, decodeURIComponent - type-inference: return string type for all new global functions - llvm-declarations: gate new externs behind usesBase64/usesUri flags - compiler/native-compiler-lib: link base64 and uri bridge objects - tests: add fixtures for base64, uri encoding, hmac
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
req.queryString— expose query string from HTTP requests.lws-bridgenow splits the path at?and populates a newquery_stringfield on the request struct; codegen and type definitions updated accordingly.crypto.hmacSha256/crypto.pbkdf2— HMAC-SHA256 and PBKDF2 key derivation via OpenSSL (HMAC(),PKCS5_PBKDF2_HMAC).btoa/atob— base64 encode/decode via newc_bridges/base64-bridge.c.encodeURIComponent/decodeURIComponent— percent-encoding per RFC 3986 via newc_bridges/uri-bridge.c.Test plan
tests/fixtures/encoding/base64.ts— round-trip encode/decode, known value checktests/fixtures/encoding/uri.ts— round-trip encode/decode, known value checktests/fixtures/crypto/hmac.ts— known HMAC-SHA256 vector (f7bc83f4...)npm test— 412 passing, 5 failing (all pre-existing:os-basic,static-fields,static-methods,string-lastindexof,promise-race-test)