Skip to content

fix(auth-oauth1): sign with the token secret when no access token is set - #611

Merged
gschier merged 1 commit into
mainfrom
fix/oauth1-token-secret-without-key
Aug 27, 2026
Merged

fix(auth-oauth1): sign with the token secret when no access token is set#611
gschier merged 1 commit into
mainfrom
fix/oauth1-token-secret-without-key

Conversation

@gschier

@gschier gschier commented Aug 27, 2026

Copy link
Copy Markdown
Member

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 tokenKey was set, so the signature used cs& where RFC 5849 搂3.4.4 calls for cs&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 key off the object keeps oauth_token out of the Authorization header (oauth-1.0a gates that param on token.key !== undefined).

Tests

New test asserts the signature is cs&ts with only a token secret configured and that no oauth_token parameter is emitted. Fails on main (expected 'cs&' to be 'cs&ts'), passes with the fix; 4/4 suite green.

馃 Generated with Claude Code

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-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown

Greptile Summary

The PR preserves an OAuth 1.0 token secret in the signing key when no access-token key is configured.

  • Adds a secret-only token representation while continuing to omit oauth_token from the Authorization header.
  • Adds a PLAINTEXT regression test covering the resulting signature and header.

Confidence Score: 5/5

The 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 oauth_token from being emitted, matching the intended behavior.

Important Files Changed

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

@gschier
gschier merged commit 50cccf1 into main Aug 27, 2026
6 checks passed
@gschier
gschier deleted the fix/oauth1-token-secret-without-key branch August 27, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant