Skip to content

fix(auth): reject unsupported scan authentication modes - #172

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

fix(auth): reject unsupported scan authentication modes#172
dipeshbabu wants to merge 2 commits 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
@mldangelo-oai mldangelo-oai added the bug Something isn't working label Aug 3, 2026
@mldangelo-oai mldangelo-oai changed the title Reject unsupported scan authentication modes fix(auth): reject unsupported scan authentication modes Aug 3, 2026
@mldangelo-oai

Copy link
Copy Markdown
Collaborator

@codex review Please review exact head afdfbb1, focusing on runtime rejection of unsupported authentication modes, preserving supported credentials, initialization ordering, and compatibility with the current-main merge.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: afdfbb168a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: afdfbb168a

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants