Skip to content

Reject unsupported scan authentication modes - #172

Open
dipeshbabu wants to merge 1 commit into
openai:mainfrom
dipeshbabu:agent/validate-scan-auth-mode
Open

Reject unsupported scan authentication modes#172
dipeshbabu wants to merge 1 commit into
openai:mainfrom
dipeshbabu:agent/validate-scan-auth-mode

Conversation

@dipeshbabu

Copy link
Copy Markdown
Contributor

Summary

  • reject unsupported runtime values for the SDK scan authentication mode
  • preserve the existing behavior for auto, chatgpt, and api-key
  • add regression coverage for both preflight and run

Why

JavaScript callers can bypass the TypeScript union type. Previously, any unknown authentication string silently behaved like auto, which could select ambient credentials instead of reporting invalid input.

The shared authentication-selection boundary now raises a TypeError before runtime initialization when the value is unsupported.

Impact

Invalid SDK input fails early and predictably. Valid authentication modes are unchanged.

Validation

  • pnpm dlx bun test --timeout 30000 ./tests-ts/api.test.ts — 71 passed
  • pnpm exec tsc --noEmit
  • pnpm exec prettier --check src/api.ts tests-ts/api.test.ts
  • git diff --check

@dipeshbabu
dipeshbabu marked this pull request as ready for review July 31, 2026 08:11
@dipeshbabu
dipeshbabu force-pushed the agent/validate-scan-auth-mode branch from f7de399 to 4e46cdd Compare July 31, 2026 08:12
@dipeshbabu
dipeshbabu force-pushed the agent/validate-scan-auth-mode branch from 4e46cdd to 5bb0ce9 Compare July 31, 2026 17:54
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