fix(auth-oauth1): sign with the token secret when no access token is set - #611
Merged
Conversation
The signing key dropped the token secret unless an access token was also present, signing as 'cs&' instead of 'cs&ts'. Found while reviewing #605. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Greptile SummaryThe PR preserves an OAuth 1.0 token secret in the signing key when no access-token key is configured.
Confidence Score: 5/5The PR appears safe to merge, with no actionable correctness or security issues identified. The secret-only token is consumed by the OAuth library鈥檚 signing-key path while the absent token key prevents
|
| Filename | Overview |
|---|---|
| plugins/auth-oauth1/src/index.ts | Adds the secret-only token path needed to sign requests without incorrectly emitting an access-token parameter. |
| plugins/auth-oauth1/tests/plaintext.test.ts | Adds focused regression coverage for the corrected signing key and omitted oauth_token field. |
Reviews (1): Last reviewed commit: "fix(auth-oauth1): sign with the token se..." | Re-trigger Greptile
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.
Summary
A token secret without an access token was silently dropped from the OAuth 1.0 signing key: the token object was only built when
tokenKeywas set, so the signature usedcs&where RFC 5849 搂3.4.4 calls forcs&ts. This affects every signature method that uses the signing key (PLAINTEXT and the HMAC family). Found while reviewing #605.The fix passes a token carrying only the secret; leaving
keyoff the object keepsoauth_tokenout of the Authorization header (oauth-1.0a gates that param ontoken.key !== undefined).Tests
New test asserts the signature is
cs&tswith only a token secret configured and that nooauth_tokenparameter is emitted. Fails on main (expected 'cs&' to be 'cs&ts'), passes with the fix; 4/4 suite green.馃 Generated with Claude Code