fix: encode revocation requests and preserve discovery failures - #1129
Open
OskarEichler wants to merge 2 commits into
Open
fix: encode revocation requests and preserve discovery failures#1129OskarEichler wants to merge 2 commits into
OskarEichler wants to merge 2 commits into
Conversation
|
@OskarEichler is attempting to deploy a commit to the Nearform Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: 54b6c83 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Fixes
Form-encode raw token/client values and OAuth Basic credential components, preserving reserved characters and Unicode. Treat an omitted Basic secret as empty, normalize one trailing issuer slash, reject failed discovery HTTP responses, and retain the original revocation network error as cause.
Breaking / observable changes
Send raw values, not pre-encoded strings. Reserved characters in Basic credentials now follow OAuth form encoding; providers relying on the old unescaped behavior may need adjustment. Revocation still returns the fetch Response and does not reinterpret HTTP failures as rejected promises; callers must inspect ok/status. Only discovery HTTP failures reject early. Existing sendClientId/includeBasicAuth defaults remain unchanged.
Verification
Actual-source JS controls cover reserved/Unicode/punctuation token round trips, Basic credential encoding, default omission of client_id/Basic headers, discovery URL and HTTP failure, and error cause preservation. RFC 6749 section 2.3.1 and RFC 7009 section 2.1 define the encoding.
Each patch was applied independently to upstream commit
6f9090ce1b991c0acc2a6f5dc8bea838deaf4f7aand passed its targeted external actual-source diagnostics or standalone type/lockfile check. The combined fixes pass 75 focused diagnostics. These use synthetic values, controlled native/bridge doubles and disposable filesystem projects, not real credentials.Combined branch checks:
No checked-in test/spec files were added, changed or disabled. The source changes are supported by external reproducible diagnostics because this audit's repository policy prohibits checked-in test edits. Live OAuth providers, physical-device/browser authentication and a full Expo native build were not exercised. React Doctor reports two warnings: the discovery response is explicitly guarded by response.ok === false, and the demo pending reset is inside finally; both paths are exercised by focused checks. No rules were suppressed.
Scope
docs/docs/usage/revoke.mdpackages/react-native-app-auth/index.js.changeset/appauth-revocation-encoding.mdUnrelated audit fixes are submitted separately. The separate iOS process-global OIDURLSessionProvider request-isolation issue is not claimed fixed by these changes.