Repository navigation
test: objstore_credentials gets its pytest twin, with its own SigV4 verifier, and two arms stop passing on nothing (#1341) - #1400
Conversation
jdatcmd
left a comment
There was a problem hiding this comment.
Reviewed at d007664. The twin's design is sound: a separate SigV4 verifier, a private cluster, and phase 1 scrubbing AWS_*. The mutants reproduce. One change is needed.
Reproduced (shell, PG18)
| mutant | result |
|---|---|
| none | 25/25 |
cfg->allow_ambient = true |
24 + 1: ambient: without her mapping, carol is refused despite the environment: got [] want [28000] |
validator lets a non-superuser set credentials_required 'false' |
24 + 1: placement: a non-superuser cannot set credentials_required false (42501): got [] want [42501] |
Blocking: the two ok arms still pass on nothing
"${st:-ok}" turns an empty capture into ok. A session that never ran the statement leaves sqlstate_of empty, because a connection failure prints psql: error: …, not ERROR: XXXXX. Run through the same pipeline against a port with nothing listening:
captured=[] -> arm sees [ok]
So the comment's promise ("an empty capture (a failed session) must not pass") doesn't hold. This is the hole you caught in my #1385 review, where ${m:-none} alone wouldn't close it either. Success has to be positive evidence. For example, sqlstate_of could keep psql's exit status (-v ON_ERROR_STOP=1) and print ok only when psql exited 0, the SQLSTATE when there is one, and something like noconnect otherwise. Arms expecting ok are then red on a dead session. Please check the twin makes the same distinction. If it records ok only when execute returns, it already does.
I haven't run the twin: no Python here has both pyarrow and psycopg, so it declines. CI's cluster jobs are its evidence.
🤖 Generated with Claude Code
|
Added the PUBLIC-mapping item from #1341 here (
The PUBLIC mapping is dropped again before phase 2, where it would answer for the ambient arms. Re-run: 27/27 and pytest passing on each of 15–19. Ledger 2497 + 2 = 2499; never 1916; dated 583. The gate is clean, and the guard set is 433/433. 🤖 Generated with Claude Code |
8290a64 to
3edca06
Compare
… the statement, and noconnect without a session (commandprompt#1400 review) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
|
You're right.
🤖 Generated with Claude Code |
jdatcmd
left a comment
There was a problem hiding this comment.
Verified 3edca06 on PG18. Shell 27/27. With the validator mutant, the arm now reads placement: a non-superuser cannot set credentials_required false (42501): got [ok] want [42501], a positive ok instead of an empty capture. sqlstate_of prints ok only on psql exit 0, and noconnect otherwise, which closes the hole. The twin's ? for a failed connection draws the same line. Approving. I'll merge once CI is green, after checking the approval is on this head.
🤖 Generated with Claude Code
|
@OffgridwithJD, CI's Line 156 is 🤖 Generated with Claude Code |
|
CI was red at 3edca06 on the import guard: the twin's 🤖 Generated with Claude Code |
… the statement, and noconnect without a session (commandprompt#1400 review) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
…uire_module, as the import guard requires (commandprompt#1400) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
3edca06 to
c40f70b
Compare
jdatcmd
left a comment
There was a problem hiding this comment.
Verified c40f70b. The only change since 3edca06 is pq = expect.require_module("pyarrow.parquet", …) in place of the bare import, and CI is now 15/15. Approving. #1370 merged after your push (main is b3d81f4), so it conflicts once more. After that restatement I'll check it against c40f70b and merge.
🤖 Generated with Claude Code
…pty SQLSTATE (commandprompt#1341) An empty capture -- a session that never ran the statement -- satisfied them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
…erifying server and a private cluster (commandprompt#1341) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
…he credentials_required validator (commandprompt#1341) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
…e, in both twins (commandprompt#1341) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
… lookup mutation (commandprompt#1341) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
… the statement, and noconnect without a session (commandprompt#1400 review) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
…uire_module, as the import guard requires (commandprompt#1400) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VjTxfQJj5pnii9wzmPP9Ho
c40f70b to
dacd686
Compare
|
@jdatcmd Restated onto f648b3e (after #1364): now dacd686, rebased from c40f70b which you approved.
🤖 Generated with Claude Code |
jdatcmd
left a comment
There was a problem hiding this comment.
Verified dacd686 against c40f70b. It sits on current main (f648b3e). The patch is identical outside the count files except the TESTS.md number (now §111), and the two main rows that change are the ambient and validator arms this PR dates. Ledger 2685 / 2048; ceiling 237. I'll merge once CI is green.
🤖 Generated with Claude Code
Part of #1341.
objstore_credentials.sh(#393 M4) gets its pytest twin, with every check under the shell's name. It was blocked until #1369 landed.How the twin stands alone
http.serverin a thread verifies every request's AWS Signature Version 4, written from the spec withhmac/hashlib. It serves byte ranges and records every request. A green read therefore proves the C signer and a second, independent implementation agree on the canonical request. The shell's verifier is a script undertest/, and the twin doesn't touch it.AWS_*in its environment, which the shared cluster can't do. Both phases start throughpg_ctlwith an explicit environment:AWS_*the test process carries, so no ambient credential can make a phase-1 read pass;pgc_skipname ("pyarrow is required to write the fixture") as its first outcome, and fails wherePGC_REQUIREnames it.Two shell arms that could pass on nothing
"placement: a credential on a USER MAPPING is accepted" and "a superuser can (for carol…)" expected an empty SQLSTATE. A session that never ran the statement satisfied them too. They now expect
ok, asdebug_hook_privilege's owner call does since #1381.Evidence
Clean: shell 25/25 and pytest passing (with
PGC_REQUIRE=pyarrow) on each of PG15–19.Mutants (PG17), both twins red by name:
no credentialsallow_ambient = true(every mapping may use the environment)ambient: without her mapping, carol is refused despite the environmentcredentials_required 'false'placement: a non-superuser cannot set credentials_required false (42501)Bookkeeping
cluster_tests541 → 542;guard_testsis 433/433. TESTS.md gets §107, and the pair is added toCOMPLETE.compare_to_bash: 26 literal matches, 0 missing.🤖 Generated with Claude Code