Add bearer token request authentication#238
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #238 +/- ##
============================================
- Coverage 88.12% 87.56% -0.57%
- Complexity 1213 1224 +11
============================================
Files 60 62 +2
Lines 3934 3972 +38
============================================
+ Hits 3467 3478 +11
- Misses 467 494 +27
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Downstream status update for reviewer context: the generic Codebox/Homeboy path this enables is now ready on our side. Merged downstream pieces:
That leaves this PR as the remaining client-side primitive needed for WordPress/ai-provider-for-openai#28 to supply Codex request auth through the provider contract rather than an API-key bridge. |
|
Downstream dependency update:
|
|
Downstream live proof update: After fixing WP Codebox's status propagation in Automattic/wp-codebox#401, the Homeboy/Codebox path now correctly reports failed agent runtime outcomes instead of false success. When rerun with WordPress/ai-provider-for-openai#28's Codex provider branch mounted, the sandbox reaches provider activation but fails because the current bundled PHP AI Client does not contain this PR's provider-auth interface: That confirms this PR is the remaining client-side primitive needed before the live Codebox/Codex minion proof can proceed. The Homeboy scheduler, extension provider dispatch, Codebox runner, provider plugin mounting, and failure evidence propagation are now all exercising the intended path. |
|
Homeboy/Codebox Codex subscription proof passed using this request-auth PR head ( Proof run: Observed result:
This confirms the provider-supplied request-auth substrate works in the Homeboy -> WP Codebox -> Agents API/Data Machine Code Codex stack. |
felixarntz
left a comment
There was a problem hiding this comment.
@chubes4 See my comment on #237 (comment), this feels a bit too much like a workaround. I think there's a cleaner solution by actually implementing a request authentication layer for bearer tokens.
Providers already have the ability to control what request authentication method they use, including the ability to wrap the passed instance at runtime (e.g. to slightly alter how the header is passed).
|
Update after addressing the review feedback: this branch now uses a first-class bearer-token request-auth primitive rather than provider-supplied arbitrary auth. End-to-end proof passed with the downstream Codex provider branch:
Latest successful run: Requesting re-review on the bearer-token auth shape. |
Summary
BearerTokenRequestAuthenticationsupport for providers that use bearer-token auth.RequestAuthenticationMethod::bearerToken()/BEARER_TOKENand registry validation for the new auth type.Fixes #237.
Testing
composer phpunit -- --filter ProviderRegistryTest- passed, 34 tests / 66 assertions.composer lint- passed.Downstream proof
WordPress/ai-provider-for-openai#28through Homeboy Lab offload to a Linux runner.agent-task-b8f6e825-7f37-4d35-84f0-47927f851899.AI assistance