Skip to content

Restore shared HTTP grants after extension lifecycle tests - #388

Open
RKS (rksharma-owg) wants to merge 1 commit into
microsoft:mainfrom
rksharma-owg:codex/restore-lifecycle-http-grants
Open

Restore shared HTTP grants after extension lifecycle tests#388
RKS (rksharma-owg) wants to merge 1 commit into
microsoft:mainfrom
rksharma-owg:codex/restore-lifecycle-http-grants

Conversation

@rksharma-owg

Copy link
Copy Markdown

12_extension_lifecycle.sql can pass while leaving df_e2e_user unable to use HTTP. The shared setup grants HTTP access, but the lifecycle test drops/recreates the extension and restores privileges with the default include_http => false. A later HTTP test then depends on whether setup has run again.

Restore the same HTTP access as 00_setup_playground.sql in the final re-grant. Add end-of-test assertions for both df.http() and df.http_multipart() privileges. The existing checks that administrative helpers remain inaccessible still run.

Related to #381. This addresses one reproduced instance of shared state leakage; it does not provide general per-test database isolation.

Validation

Tested in disposable Docker containers on Linux arm64, using source-built pg_durable v0.2.8 with http-allow-test-domains:

Check PostgreSQL 17.11 PostgreSQL 18.6
New regression before the grant fix Fails at the HTTP privilege assertion Fails at the HTTP privilege assertion
00_setup_playground.sql and 01_core_primitives.sql Pass Pass
Updated 12_extension_lifecycle.sql, twice in the same database Pass both times Pass both times
Non-superuser df.http() constructor after each lifecycle run, without repairing grants Pass both times Pass both times

SQL files were run with docker exec "$container" psql -X -U postgres -v ON_ERROR_STOP=1 -f /repo/tests/e2e/sql/<file>. The constructor probe used SET SESSION AUTHORIZATION df_e2e_user; SELECT df.http('https://httpbingo.org/get', 'GET'); in a separate connection; it makes no network request.

cargo fmt -p pg_durable -- --check and git diff --check passed. This changes only the E2E SQL file; the full suite was not run. The local Docker builds used two Cargo jobs, thin LTO, and eight release codegen units.

AI assistance: implemented and validated with Codex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant