Repository navigation
fix(oauth): honor allowed hosts when requesting tokens - #189
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2e6eea48-9037-4100-8df3-1fc558e359dc
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused fix preserves the caller’s Fiber contract, and the regression tests cover rejected targets and successful token acquisition.
No open issues 🎉
What changed in this PR
Fixes OAuth allowed-host enforcement by returning a Fiber yielding nil for missing or disallowed targets before scope initialization or token acquisition.
Changes:
- Adds an explicit early return while preserving the Fiber contract.
- Adds regression tests for rejected targets, allowed hosts, unrestricted host configuration, and authorization-header omission.
| File | Description |
|---|---|
| components/authentication/oauth/spec/oauth_access_token_provider_spec.rb | Tests host filtering, missing targets, token acquisition, and header behavior. |
| components/authentication/oauth/lib/microsoft_kiota_authentication_oauth/oauth_access_token_provider.rb | Stops processing missing or disallowed targets with a nil-returning Fiber. |
Review effort: Balanced
Vincent Biret (baywet)
marked this pull request as ready for review
October 23, 2026 12:11
Vincent Biret (baywet)
enabled auto-merge (squash)
October 23, 2026 12:12
This was referenced Oct 23, 2026
Peter Ombwa (peombwa)
approved these changes
Oct 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Return a Fiber yielding nil for missing or disallowed request targets before initializing scopes or requesting a token. Preserve token acquisition for allowed HTTPS hosts and when no host list is configured.
Validation