Conversation
Contributor
Benchmark Results (Linux x86-64)
CLI Tool Benchmarks
|
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.
Before
Client.connect()rejectedAuthenticationSASL(code 10) withSCRAM-SHA-256 not yet supported — use password_encryption=md5 or trust on the server,blocking any pg 14+ setup whose default (
password_encryption=scram-sha-256) was not overridden.After
Client.connect()completes the full SCRAM-SHA-256 handshake(SASLInitialResponse → AuthenticationSASLContinue → SASLResponse →
AuthenticationSASLFinal → AuthenticationOK), including server-signature
verification.
md5/ cleartext / trust paths are unchanged.Description
c_bridges/scram-bridge.cexposes four FFI entry points built onOpenSSL (
HMAC,SHA256,PKCS5_PBKDF2_HMACwithEVP_sha256,RAND_bytes):cs_scram_random_nonce_b64,cs_scram_client_first_bare,cs_scram_client_final,cs_scram_verify_server_final.cs_scram_client_finalpacks<client-final-message>\x01<server-signature-b64>so the ChadScript side gets both values through a single
declare functionreturn slot (no Uint8Array marshalling needed).
lib/pg.tsgets a_doScram()method that consumes the SASL frame,validates the mechanism list, and drives the three-step exchange using
direct byte-buffer framing (same style as the existing md5 path).
build-vendor.sh,build-target-sdk.sh,compiler.ts,native-compiler-lib.ts, andci.yml(linux + macos release copies andverify loops) per CLAUDE.md's 6-step C-bridge checklist.
tests/fixtures/stdlib/pg-scram.tsgated onPG_SCRAM_TESTS_ENABLED. CI provisions a second userscramuser(scram-sha-256-hashed) alongside the md5-hashed
postgresuser, so bothauth paths are exercised in the same pg service.
POSTGRES_HOST_AUTH_METHOD=scram-sha-256postgres:16 container: fixture prints
TEST_PASSED.verify:quickgreen.LOC: ~270 in
scram-bridge.c, ~190 added inlib/pg.ts, ~36 in fixture,~45 in build/CI wiring.