You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Hackathon] fix(project): project auto-auth --disable cannot be used alone — required --method/--inject force fabricated config into the disable request #379
ocean_ranger — preferred contact: PR comments or GitHub (Discord available but not actively monitored)
What does this improvement do?
testsprite project auto-auth <id> --disable is documented as the off-switch (--disable — "turn auto-auth off (keeps stored config)"), but it can never be used that way:
--method and --inject are declared unconditionally.requiredOption() (src/commands/project.ts:1669-1670), so the only way to reach the disable path is to invent values:
The invented values are not just accepted — they are sent in the disable request body. runAutoAuth builds the body unconditionally as { enabled, method, inject } with no disable branch, so the "off" switch overwrites the stored policy's method/inject with whatever the user was forced to make up.
Three defects in one flow:
The documented off-switch is unusable (exit 5 following the help text).
The user must fabricate configuration unrelated to disabling.
Those fabricated values reach the wire (PUT /projects/p1/auto-auth body carries enabled:false plus the made-up method/inject), so disabling can silently rewrite the stored policy's shape.
(Verified against a local endpoint with --debug; any HTTP-dumping proxy shows the same body.)
Suggested approach
Make --method / --inject plain options; in runAutoAuth, require them only when enabling (opts.disable !== true), with the error naming the --disable alternative.
Enum-validate them only when present.
Build the body as { enabled } plus method/inject only when provided, so a disable never persists fabricated config. (--disable with explicitly provided values still forwards them, for callers that want to pin the stored shape.)
Happy to implement with tests once confirmed; will claim with /assign. One concern per PR: the disable path only — no other flag semantics change. The staged fix keeps the enable path byte-identical (same body, same validation errors except the new actionable message when --method/--inject are missing).
Side note: the --disable sends enabled:false unit test in project.test.ts currently has to pass fabricated method/inject to reach the disable path — the test itself mirrors this bug.
Confirmations
I have searched existing issues and this is not a duplicate.
I have provided my Discord identity above for reward coordination.
Thanks for the interest, @OceanRanger! This issue hasn't been accepted for implementation yet — see the triage comment (a maintainer will label it accepted once it is). Feel free to check back, or ping us on Discord if it's been quiet.
Thanks @OceanRanger, confirmed: --disable can't be used alone. The fix also needs a backend change (the API requires method/inject even when disabling), so we'll fix it on our side. Closing this one.
Activity
OceanRanger commentedon Oct 22, 2026
/assign
testsprite-hob commentedon Oct 22, 2026
Thanks for the interest, @OceanRanger! This issue hasn't been accepted for implementation yet — see the triage comment (a maintainer will label it
acceptedonce it is). Feel free to check back, or ping us on Discord if it's been quiet.fyZhang66 commentedon Oct 22, 2026
Thanks @OceanRanger, confirmed:
--disablecan't be used alone. The fix also needs a backend change (the API requiresmethod/injecteven when disabling), so we'll fix it on our side. Closing this one.