Add comprehensive logging, documentation, and edge-case tests for error scenario handling #18
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.
Issue #[number] reported that error scenarios stopped working in v0.0.5. Investigation revealed the functionality is working correctly—the issue appears to be environmental or in external test suites.
To prevent future confusion and improve debuggability, this PR adds:
Enhanced Logging
nil,true, andfalsefor theenabledfield pointerDocumentation
Enabled *boolpointer behavior:nil(field omitted) → defaults totruetrue→ enabledfalse→ disabledTest Coverage
Added 6 edge-case integration tests:
enabled: trueAll tests include proper error handling (HTTP errors, URL parsing, location header validation).
Example Usage
The error scenario functionality works correctly across all OAuth2 endpoints (authorize, token, userinfo) and error codes.
Original prompt
This section details on the original issue you should resolve
<issue_title>[BUG] regression on error scenarios</issue_title>
<issue_description># Mock OAuth Server v0.0.5 Test Results
Date: October 26, 2025
Mock OAuth Server Version: 0.0.5 (commit: 335c556, build: 2025-10-26T21:53:23Z)
Image Digest:
sha256:4ff5a7b52afd673d771a4cf90d75bc28633ce7c449857c5dea4f65a0301eae4bSummary
Retested all previously skipped OAuth error scenario tests with the updated mock OAuth server v0.0.5. Unfortunately, all error scenario tests still fail with the same issue: the mock server continues to auto-approve authentication requests even when error scenarios are configured.
Test Results
✅ Tests Passing (7 tests)
Basic OAuth Flow:
⏭️ Tests Still Skipped (10 tests - ALL STILL FAILING)
OAuth Error Scenarios (10 tests):
Comparison with Previous Version
v0.0.4 (October 25, 2025)
access_denied,server_error, token endpoint errorsv0.0.5 (October 26, 2025) - REGRESSION
Result: v0.0.5 is a regression - it lost support for the 3 error scenarios that were working in v0.0.4!
Server Behavior Analysis
What the Server Receives
Looking at the logs, the server IS receiving the error scenario configuration:
What the Server Does
Despite receiving the error configuration, the server continues to:
?code=fd95a170-e39b-40e2-b2d0-4afa3e29d919Expected Behavior
When
error_scenario.enabled=truewitherror='access_denied', the server should:?error=access_denied&error_description=...Root Cause
The mock OAuth server v0.0.5 is:
/configendpoint requestserror_scenarioconfigurationRecommendations
For Mock OAuth Server Development
The v0.0.5 update appears to have broken the partial error scenario support that was working in v0.0.4. Recommendations:
/authorizeendpoint:Version History
access_denied,server_error, token errors ✅💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.