Skip to content

test(bearer): expect the no-credentials 401 at ATTACH, not on a later query#2

Closed
rustyconover wants to merge 1 commit into
mainfrom
fix/bearer-token-attach-raises
Closed

test(bearer): expect the no-credentials 401 at ATTACH, not on a later query#2
rustyconover wants to merge 1 commit into
mainfrom
fix/bearer-token-attach-raises

Conversation

@rustyconover

Copy link
Copy Markdown
Contributor

bearer_auth/bearer_token.test expected ATTACH without credentials to succeed and the auth error to surface on a following SELECT. But the extension calls catalog_attach eagerly during ATTACH, so a bearer-protected server's 401 (no OAuth challenge) is raised right there — src/vgi_http_client.cpp:455 produces the actionable "advertised no OAuth challenge" diagnostic while the URL is still in scope. The old statement ok ATTACH therefore fails against the worker (it raises), against both the vgi-python and Java workers.

This makes the no-credentials case a statement error on the ATTACH, expecting the same message. Raising at attach is the intended behavior; the test was just structured for a deferred-auth model that doesn't match.

Verified against the vgi-python reference worker (full pass, unmasked).

🤖 Generated with Claude Code

… query

The extension calls catalog_attach eagerly during ATTACH, so when a
bearer-protected server returns 401 without an OAuth challenge, vgi_http_client
raises the actionable "advertised no OAuth challenge" diagnostic at ATTACH time
(it can only produce the clean message while the URL is in scope). The test
previously expected ATTACH to succeed and the error to surface on a following
SELECT, which fails against the worker — the ATTACH itself raises.

Make the no-credentials case a `statement error` on the ATTACH expecting the
same message. Verified against the vgi-python reference worker (full pass).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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