Refuse an empty credential value instead of dialing with it - #1587
Open
GeiserX wants to merge 1 commit into
Open
Refuse an empty credential value instead of dialing with it#1587GeiserX wants to merge 1 commit into
GeiserX wants to merge 1 commit into
Conversation
…h it Omitting a required credential input and supplying it as "" are the same state — there is no usable credential — but only the omission was caught. The empty one was rendered onto the request, the upstream answered 401, and the operator was told authentication failed rather than that their credential was empty. The OpenAPI backing already treats "" as missing, at both of its checks. This brings GraphQL's check in line with it. Whitespace is deliberately left alone: judging a value someone supplied is a different decision from judging one that is absent, and OpenAPI does not do it either. The new test fails without the change. The four existing cases in that file, which dial with real values, are the control.
This was referenced Aug 13, 2026
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.
A GraphQL connection whose required credential input is present but empty is dialed anyway:
== nullcatchesnullandundefined, so""counts as supplied. Omitting the input and supplyingit as
""are the same state — there is no usable credential — but they behave differently:bconnection_value_missing, namingb""team_id="team_1"In the empty case the request goes out, the upstream answers 401, and the operator is told
authentication failed — not that their credential is empty, and not which input to fix.
Why this reads as an inconsistency rather than a decision
The OpenAPI backing already refuses an empty value, at both of its checks:
So the rule already exists in this codebase — including in this very file, where
missingCredentialVariablesalready applies it on the health-check path. What it does not cover isthe invocation path, which is the line this change touches. The inconsistency is internal to the
plugin rather than between plugins.
It matters most where a provider resolves the value rather than a person typing it. A store that
returns
""for a key it holds but cannot resolve is exactly the case worth catching, and forwardingthe empty value hides the cause behind an upstream auth error.
Scope
Whitespace is deliberately left alone. Judging a value someone supplied is a different decision from
judging one that is absent, and OpenAPI does not trim either — so this stays with the rule already
established rather than inventing a new one.
Tests
The new case in
multi-placement-auth.test.tsfails without the change and passes with it; the threeexisting cases that dial with real values are the control.
98 passedfor the package.Not included here: the same one-line gap exists on the MCP plugin's invocation path (the
credential.values[variable] == nullfilter inpackages/plugins/mcp/src/sdk/plugin.ts). #1582 addsthe equivalent gate to that plugin's health check, so this half sits more naturally alongside it than
here — happy to fold it in wherever you would rather have it.
Part of the review in #1585; see #1564 for the first of this series.