Skip to content

Add Basic auth for OpenAI-compatible providers - #126

Open
oleksa-source wants to merge 1 commit into
tinyhumansai:mainfrom
oleksa-source:codex/inworld-basic-auth
Open

Add Basic auth for OpenAI-compatible providers#126
oleksa-source wants to merge 1 commit into
tinyhumansai:mainfrom
oleksa-source:codex/inworld-basic-auth

Conversation

@oleksa-source

@oleksa-source oleksa-source commented Aug 27, 2026

Copy link
Copy Markdown

Summary

Add an explicit HTTP Basic authentication style for OpenAI-compatible providers, enabling hosts to integrate providers such as Inworld without disguising credentials as Bearer tokens. Empty Basic credentials emit no Authorization header.

API Or Behavior Changes

Adds the public AuthStyle::Basic variant. Requests using it send Authorization: Basic . Existing auth styles are unchanged.

Tests

  • cargo fmt --check
  • cargo clippy --all-targets -- -D warnings
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo build --all-targets
  • cargo build --all-targets --all-features
  • cargo test
  • cargo test --all-features

Added focused auth-header tests for populated and empty Basic credentials. The full default-feature suite passed: 1,784 unit tests, integration tests, and 49 doc tests.

Documentation

Updated AuthStyle rustdoc and the transport-level authentication overview.

Summary by CodeRabbit

  • New Features

    • Added support for HTTP Basic authentication for compatible API connections.
    • Empty credentials no longer produce an authorization header.
  • Bug Fixes

    • Corrected authentication header formatting to use the Basic scheme when configured.
  • Tests

    • Added coverage for valid and empty Basic authentication credentials.

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1790b405-6147-4a67-a9f1-152bc4dcd082

📥 Commits

Reviewing files that changed from the base of the PR and between e0f3210 and 971a80b.

📒 Files selected for processing (2)
  • src/harness/providers/openai/test.rs
  • src/harness/providers/openai/transport.rs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The OpenAI transport adds AuthStyle::Basic. It emits a Basic authorization header for non-empty credentials and omits the header for empty credentials. Tests cover both cases.

Changes

Basic authentication

Layer / File(s) Summary
Basic authentication contract and header generation
src/harness/providers/openai/transport.rs, src/harness/providers/openai/test.rs
AuthStyle::Basic documents HTTP Basic credentials. auth_headers emits Authorization: Basic <credential> for non-empty credentials and emits no header for empty credentials. Tests cover both behaviors.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 971a8

The PR adds explicit Basic authentication for OpenAI-compatible providers while preserving existing auth styles; no actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: senamakel, m3ga-mind, yellowsnnowmann

Poem

A rabbit checks the header line
Basic credentials now align
Empty keys leave no trace
Tests hop neatly into place
The transport thumps its paws: “All fine!”

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding Basic authentication support for OpenAI-compatible providers.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Warning

Your free Security trial is over. An organization admin can activate Security or dismiss this notice.


Comment @coderabbitai help to get the list of available commands.

@tinysweeper tinysweeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tinysweeper found nothing blocking. Approving.

$0.0000 · 0 in / 0 out

@tinysweeper

tinysweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown

How this change flows

1 changed behaviour across 10 relationships. 6 surrounding behaviours are shown (60 graph nodes walked). 43 further behaviours left out to keep the diagram readable.

flowchart LR
  n0["auth_headers_bearer_is_the_default<br/>changed"]:::changed
  n1["auth_headers"]:::impacted
  n2["...ne_knobs_default_to_supported_wire_shapes"]:::impacted
  n3["translate_request"]:::impacted
  n4["Tool"]:::impacted
  n5["with_tool_choice"]:::impacted
  n6["to_value"]:::impacted
  n0 -->|calls| n1
  n0 -->|tests| n1
  n2 -->|calls| n3
  n2 -->|tests| n3
  n2 -->|calls| n4
  n2 -->|tests| n4
  n2 -->|calls| n5
  n2 -->|tests| n5
  n2 -->|calls| n6
  n2 -->|tests| n6
  classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
  classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
  classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
  classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Loading

Green: changed behaviour. Grey: surrounding behaviour. Arrows name the call, use, implementation, or test relationship. Orange: has findings. Red: has a finding that blocks the merge.

tinysweeper 0.1.0

@tinysweeper tinysweeper Bot added the priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. label Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant