Skip to content

fix: rename signatureEncoding to signatureMethod for OAuth1 in opencollection types#7724

Open
lohit-bruno wants to merge 1 commit intousebruno:mainfrom
lohit-bruno:fix/oauth1-signature-method-rename
Open

fix: rename signatureEncoding to signatureMethod for OAuth1 in opencollection types#7724
lohit-bruno wants to merge 1 commit intousebruno:mainfrom
lohit-bruno:fix/oauth1-signature-method-rename

Conversation

@lohit-bruno
Copy link
Copy Markdown
Collaborator

@lohit-bruno lohit-bruno commented Apr 9, 2026

Description

Align with @opencollection/types 0.9.1 which renamed the OAuth1 field from signatureEncoding to signatureMethod. Update converters, filestore, and all YML test fixtures. Increase OAuth1 UI test timeouts from 30s to 60s.

Contribution Checklist:

  • I've used AI significantly to create this pull request
  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Publishing to New Package Managers

Please see here for more information.

Summary by CodeRabbit

  • Chores

    • Updated @opencollection/types dependency to version 0.9.1
  • Bug Fixes

    • Corrected OAuth1 authentication configuration field naming for improved consistency
  • Tests

    • Enhanced test stability with timeout adjustments for OAuth 1.0 authentication scenarios

…llection types

Align with @opencollection/types 0.9.1 which renamed the OAuth1 field from
signatureEncoding to signatureMethod. Update converters, filestore, and all
YML test fixtures. Increase OAuth1 UI test timeouts from 30s to 60s.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 9, 2026

Walkthrough

This PR renames the OAuth1 signature method field from signatureEncoding to signatureMethod across auth conversion logic and test fixtures, accompanied by a devDependency version bump for @opencollection/types.

Changes

Cohort / File(s) Summary
Dependency Updates
package.json, packages/bruno-converters/package.json
Updated @opencollection/types devDependency from 0.9.0 to 0.9.1.
OAuth1 Auth Converters
packages/bruno-converters/src/opencollection/common/auth.ts, packages/bruno-filestore/src/formats/yml/common/auth.ts
Changed OAuth1 field mapping from signatureEncoding to signatureMethod in both fromOpenCollectionAuth and toOpenCollectionAuth functions with default fallback value 'HMAC-SHA1'.
OAuth1 Test Fixtures
tests/auth/oauth1/fixtures/collections/yml/OAuth1 *.yml (26 files)
Updated all OAuth1 fixture configurations, replacing signatureEncoding with signatureMethod while preserving algorithm values (HMAC-SHA1, HMAC-SHA256, HMAC-SHA512, PLAINTEXT, RSA-SHA1, RSA-SHA256, RSA-SHA512).
Test Timeout Overrides
tests/auth/oauth1/oauth1.spec.ts
Added explicit 60-second Playwright timeout override for "Request auth UI" and "Collection settings auth" test cases.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Possibly related PRs

Suggested labels

size/L

Suggested reviewers

  • helloanoop
  • naman-bruno
  • bijin-bruno

Poem

🔐 From signatureEncoding to signatureMethod we go,
OAuth1 fields dancing in a systematic flow,
Twenty-six fixtures twirl, each one the same,
A naming refactor—cryptography stays its game! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: renaming signatureEncoding to signatureMethod for OAuth1 across the codebase in alignment with updated types.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/bruno-filestore/src/formats/yml/common/auth.ts (1)

266-285: ⚠️ Potential issue | 🟠 Major

Add fallback for legacy OAuth1 signatureEncoding field to prevent silent behavior change.

Line 275 only reads auth.signatureMethod with fallback to 'HMAC-SHA1'. Existing YAML files saved before the recent field rename may contain signatureEncoding—when deserialized, this legacy field will be absent from the Auth object, causing non-SHA1 signature methods to silently downgrade to HMAC-SHA1. While new writes only use signatureMethod, the read path must support both fields during the migration window.

Proposed fix
-    case 'oauth1':
+    case 'oauth1': {
+      const oauth1Auth = auth as AuthOAuth1 & {
+        signatureEncoding?: BrunoAuthOauth1['signatureMethod'];
+      };
+
       brunoAuth.mode = 'oauth1';
       brunoAuth.oauth1 = {
         consumerKey: auth.consumerKey || null,
         consumerSecret: auth.consumerSecret || null,
         accessToken: auth.accessToken || null,
         accessTokenSecret: auth.accessTokenSecret || null,
         callbackUrl: auth.callbackUrl || null,
         verifier: auth.verifier || null,
-        signatureMethod: (auth.signatureMethod as BrunoAuthOauth1['signatureMethod']) || 'HMAC-SHA1',
+        signatureMethod: (oauth1Auth.signatureMethod || oauth1Auth.signatureEncoding || 'HMAC-SHA1') as BrunoAuthOauth1['signatureMethod'],
         privateKey: (typeof auth.privateKey === 'object' && auth.privateKey ? auth.privateKey.value : auth.privateKey) || null,
         privateKeyType: (typeof auth.privateKey === 'object' && auth.privateKey ? auth.privateKey.type : 'text') as BrunoAuthOauth1['privateKeyType'],
         timestamp: auth.timestamp || null,
         nonce: auth.nonce || null,
         version: auth.version || '1.0',
         realm: auth.realm || null,
         placement: (auth.placement as BrunoAuthOauth1['placement']) || 'header',
         includeBodyHash: auth.includeBodyHash || false
       };
       break;
+    }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/bruno-filestore/src/formats/yml/common/auth.ts` around lines 266 -
285, The oauth1 branch currently only reads auth.signatureMethod and falls back
to 'HMAC-SHA1', which ignores older YAML files that used signatureEncoding;
update the brunoAuth.oauth1.signatureMethod assignment to prefer
auth.signatureMethod, then fall back to auth.signatureEncoding, then 'HMAC-SHA1'
(and cast to BrunoAuthOauth1['signatureMethod'] as before) so legacy
signatureEncoding values are honored during reads; ensure the same fallback
pattern is used where BrunoAuthOauth1['signatureMethod'] is referenced.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@packages/bruno-filestore/src/formats/yml/common/auth.ts`:
- Around line 266-285: The oauth1 branch currently only reads
auth.signatureMethod and falls back to 'HMAC-SHA1', which ignores older YAML
files that used signatureEncoding; update the brunoAuth.oauth1.signatureMethod
assignment to prefer auth.signatureMethod, then fall back to
auth.signatureEncoding, then 'HMAC-SHA1' (and cast to
BrunoAuthOauth1['signatureMethod'] as before) so legacy signatureEncoding values
are honored during reads; ensure the same fallback pattern is used where
BrunoAuthOauth1['signatureMethod'] is referenced.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 657d6d9c-61fb-4a0d-806b-53cce70479ff

📥 Commits

Reviewing files that changed from the base of the PR and between 3b502fd and 3abd799.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (28)
  • package.json
  • packages/bruno-converters/package.json
  • packages/bruno-converters/src/opencollection/common/auth.ts
  • packages/bruno-filestore/src/formats/yml/common/auth.ts
  • tests/auth/oauth1/fixtures/collections/yml/OAuth1 HMAC-SHA1 200.yml
  • tests/auth/oauth1/fixtures/collections/yml/OAuth1 HMAC-SHA1 401.yml
  • tests/auth/oauth1/fixtures/collections/yml/OAuth1 HMAC-SHA1 Body 200.yml
  • tests/auth/oauth1/fixtures/collections/yml/OAuth1 HMAC-SHA1 Body JSON 200.yml
  • tests/auth/oauth1/fixtures/collections/yml/OAuth1 HMAC-SHA1 POST 200.yml
  • tests/auth/oauth1/fixtures/collections/yml/OAuth1 HMAC-SHA1 Query Params 200.yml
  • tests/auth/oauth1/fixtures/collections/yml/OAuth1 HMAC-SHA256 200.yml
  • tests/auth/oauth1/fixtures/collections/yml/OAuth1 HMAC-SHA256 401.yml
  • tests/auth/oauth1/fixtures/collections/yml/OAuth1 HMAC-SHA256 Body 200.yml
  • tests/auth/oauth1/fixtures/collections/yml/OAuth1 HMAC-SHA512 200.yml
  • tests/auth/oauth1/fixtures/collections/yml/OAuth1 HMAC-SHA512 401.yml
  • tests/auth/oauth1/fixtures/collections/yml/OAuth1 PLAINTEXT 200.yml
  • tests/auth/oauth1/fixtures/collections/yml/OAuth1 PLAINTEXT 401.yml
  • tests/auth/oauth1/fixtures/collections/yml/OAuth1 PLAINTEXT Body 200.yml
  • tests/auth/oauth1/fixtures/collections/yml/OAuth1 PLAINTEXT Query Params 200.yml
  • tests/auth/oauth1/fixtures/collections/yml/OAuth1 RSA-SHA1 200.yml
  • tests/auth/oauth1/fixtures/collections/yml/OAuth1 RSA-SHA1 Body 200.yml
  • tests/auth/oauth1/fixtures/collections/yml/OAuth1 RSA-SHA1 Body formurlencoded 200.yml
  • tests/auth/oauth1/fixtures/collections/yml/OAuth1 RSA-SHA1 File Key 200.yml
  • tests/auth/oauth1/fixtures/collections/yml/OAuth1 RSA-SHA1 Query Params 200.yml
  • tests/auth/oauth1/fixtures/collections/yml/OAuth1 RSA-SHA1 Variable Key 200.yml
  • tests/auth/oauth1/fixtures/collections/yml/OAuth1 RSA-SHA256 200.yml
  • tests/auth/oauth1/fixtures/collections/yml/OAuth1 RSA-SHA512 200.yml
  • tests/auth/oauth1/oauth1.spec.ts

Copy link
Copy Markdown
Collaborator

@sid-bruno sid-bruno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, except the version concern since it isn't released yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants