Skip to content

fix/3112 - Postman import: OAuth2 Implicit Grant Type Silently Converted to Client Credentials on Import - #8113

Merged
bijin-bruno merged 6 commits into
usebruno:mainfrom
rajashreehj-bruno:fix/OAuth2_Implicit_Grant_Type_Silently_Converted_to_Client_Credentials_on_Import
Jun 5, 2026
Merged

bijin-bruno merged 6 commits into
usebruno:mainfrom
rajashreehj-bruno:fix/OAuth2_Implicit_Grant_Type_Silently_Converted_to_Client_Credentials_on_Import

Conversation

@rajashreehj-bruno

@rajashreehj-bruno rajashreehj-bruno commented May 27, 2026 •

Copy link
Copy Markdown
Contributor

Jira link: https://usebruno.atlassian.net/browse/BRU-3112

Description

Added Grant type implicit in postman-to-bruno.js and handled the case for same.

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

  • New Features

    • Support for OAuth2 "Implicit" grant when importing Postman collections, preserving authorization and callback URLs.
  • Tests

    • Added unit, fixture, and end-to-end tests to verify implicit grant import and that the Auth tab displays "Implicit".
  • Chores

    • Added a test identifier and locator to enable reliable UI verification.

@coderabbitai

coderabbitai Bot commented May 27, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Maps Postman OAuth2 implicit → Bruno implicit; adds an explicit implicit branch in processAuth to populate auth.oauth2 with authorization and callback URLs. Adds unit test, Postman fixture, Playwright/Electron import E2E, locator, and a testid on the grant type dropdown.

Changes

OAuth2 implicit grant support

Layer / File(s) Summary
Grant mapping and conversion handler
packages/bruno-converters/src/postman/postman-to-bruno.js
Grant type mapping adds implicit → implicit; processAuth adds an implicit branch that sets requestObject.auth.oauth2 using base OAuth2 fields plus authorizationUrl and callbackUrl.
Unit test for implicit grant
packages/bruno-converters/tests/postman/postman-to-bruno/process-auth.spec.js
New Jest test asserting auth.mode === 'oauth2' and the normalized auth.oauth2 fields (including grantType: 'implicit', URLs, client credentials, scope/state, and placement mappings).
E2E import fixture and integration test
tests/import/postman/fixtures/postman-import-oauth2-implicit-grant-type.json, tests/import/postman/import-oauth2-implicit-grant-type.spec.ts
Adds Postman collection fixture with implicit grant and a Playwright/Electron test that imports it, completes the import flow, and verifies the Auth tab shows grant type “Implicit”.
Test locator and UI testid
tests/utils/page/locators.ts, packages/bruno-app/src/components/RequestPane/Auth/OAuth2/GrantTypeSelector/index.js
Expose auth.oauth2.grantTypeDropdown locator (data-testid="grant-type-dropdown") and add the data-testid to the grant type dropdown component used by the integration test.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • usebruno/bruno#7646: Modifies processAuth/OAuth2 coercion logic and touches the same conversion area.

Suggested reviewers

  • helloanoop
  • lohit-bruno
  • naman-bruno
  • bijin-bruno

"A fixture lands, the dialog sings,
Implicit grant gets mapped its wings,
Tests import, the UI shows,
Grant-type dropdown now exposes,
Conversion's small applause it brings."

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main fix: adding support for OAuth2 Implicit Grant Type during Postman import to prevent silent conversion to Client Credentials.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

@pull-request-size pull-request-size Bot added size/L and removed size/S labels May 28, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@packages/bruno-converters/tests/postman/postman-to-bruno/process-auth.spec.js`:
- Line 452: The test incorrectly asserts that requestObject.auth.oauth2.pkce is
true for the "implicit" grant; update the test in process-auth.spec.js to remove
or change that assertion (remove the expectation of pkce:true or assert it is
undefined/false) because postman-to-bruno.js's case 'implicit' only spreads
baseOAuth2Config and sets authorizationUrl/callbackUrl and never sets a pkce
field.

In `@tests/import/postman/import-oauth2-implicit-grant-type.spec.ts`:
- Line 25: Remove the debug console.log call that prints the test variable;
specifically delete the console.log('locators:', locators); statement from the
test file (import-oauth2-implicit-grant-type.spec.ts) so the test no longer
emits debug output—if you need to assert on locators, replace the log with an
appropriate expect/assert in the test rather than printing.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6e655aed-a039-412e-b281-e2cdd7d570f7

📥 Commits

Reviewing files that changed from the base of the PR and between c0e2d24 and 898164a.

📒 Files selected for processing (4)
  • packages/bruno-converters/tests/postman/postman-to-bruno/process-auth.spec.js
  • tests/import/postman/fixtures/postman-import-oauth2-implicit-grant-type.json
  • tests/import/postman/import-oauth2-implicit-grant-type.spec.ts
  • tests/utils/page/locators.ts
✅ Files skipped from review due to trivial changes (1)
  • tests/import/postman/fixtures/postman-import-oauth2-implicit-grant-type.json

Comment thread tests/utils/page/locators.ts Resolved
@bijin-bruno
bijin-bruno merged commit f629c3d into usebruno:main Jun 5, 2026
18 of 20 checks passed
abhishekp-bruno pushed a commit to abhishekp-bruno/bruno that referenced this pull request Jun 17, 2026
…ted to Client Credentials on Import (usebruno#8113)

* fix/3112 - Postman import: OAuth2 Implicit Grant Type Silently Converted to Client Credentials on Import

* fix/3112: Postman import: OAuth2 Implicit Grant Type Silently Converted to Client Credentials on Import

* fix/3112 - Postman import: OAuth2 Implicit Grant Type Silently Converted to Client Credentials on Import

* fix/3112

* Implicit grant type

* Oauth2 implicit grant type test case
@rajashreehj-bruno
rajashreehj-bruno deleted the fix/OAuth2_Implicit_Grant_Type_Silently_Converted_to_Client_Credentials_on_Import branch August 12, 2026 09:56
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.

3 participants