Repository navigation
fix: 3014 - Postman import ignores API Key "in" placement setting and defaults to header - #7968
Conversation
… defaults to header
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughPostman API key auth "in" location now maps to Bruno's request placement during import: 'query' → queryparams, otherwise header. Added unit tests, e2e fixtures/tests, Playwright locators, and small UI testids and modal wiring to support assertions. ChangesAPI Key Placement Import
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
tests/import/postman/import-apikey-query-collection.spec.ts (1)
23-23: 💤 Low valueConsider organizing fixtures using collection directory structure.
Same observation as the header test: the fixture path uses
fixtures/postman-import-apikey-query-collection.jsondirectly. Consider organizing fixtures into subdirectories as noted in the header test review.🤖 Prompt for 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. In `@tests/import/postman/import-apikey-query-collection.spec.ts` at line 23, The test uses a flat fixture path stored in the variable postmanFile; move the JSON into a postman-specific subdirectory (e.g., fixtures/postman/ or fixtures/postman/collections/) and update the postmanFile assignment to reference the new location (update the path.resolve call that constructs postmanFile). Ensure the new directory name follows the same convention used by other tests (matching the header test refactor) and update any other tests that reference this fixture variable if necessary.tests/import/postman/import-apikey-header-collection.spec.ts (1)
23-23: 💤 Low valueConsider organizing fixtures using collection directory structure.
The fixture path uses
fixtures/postman-import-apikey-header-collection.jsondirectly in the fixtures folder. Based on learnings from PR 7449, fixtures should be organized asfixtures/collection/(singular) when there's a single collection.Consider restructuring to:
tests/import/postman/fixtures/ ├── apikey-header-collection/ │ └── postman-import-apikey-header-collection.json └── apikey-query-collection/ └── postman-import-apikey-query-collection.jsonOr if these fixtures are minimal and test-specific:
tests/import/postman/fixtures/ └── collections/ ├── postman-import-apikey-header-collection.json └── postman-import-apikey-query-collection.jsonBased on learnings, fixtures are nested inside the
fixturesfolder.🤖 Prompt for 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. In `@tests/import/postman/import-apikey-header-collection.spec.ts` at line 23, The test uses the postmanFile constant in import-apikey-header-collection.spec.ts pointing directly to fixtures/postman-import-apikey-header-collection.json; move this fixture into a nested fixtures directory (either fixtures/apikey-header-collection/postman-import-apikey-header-collection.json or fixtures/collections/postman-import-apikey-header-collection.json) and update the postmanFile path resolution in the test (the postmanFile variable assignment) to reference the new nested folder; repeat the same restructure and path updates for the apikey-query fixture so both tests follow the fixtures/collection nesting convention.
🤖 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.
Nitpick comments:
In `@tests/import/postman/import-apikey-header-collection.spec.ts`:
- Line 23: The test uses the postmanFile constant in
import-apikey-header-collection.spec.ts pointing directly to
fixtures/postman-import-apikey-header-collection.json; move this fixture into a
nested fixtures directory (either
fixtures/apikey-header-collection/postman-import-apikey-header-collection.json
or fixtures/collections/postman-import-apikey-header-collection.json) and update
the postmanFile path resolution in the test (the postmanFile variable
assignment) to reference the new nested folder; repeat the same restructure and
path updates for the apikey-query fixture so both tests follow the
fixtures/collection nesting convention.
In `@tests/import/postman/import-apikey-query-collection.spec.ts`:
- Line 23: The test uses a flat fixture path stored in the variable postmanFile;
move the JSON into a postman-specific subdirectory (e.g., fixtures/postman/ or
fixtures/postman/collections/) and update the postmanFile assignment to
reference the new location (update the path.resolve call that constructs
postmanFile). Ensure the new directory name follows the same convention used by
other tests (matching the header test refactor) and update any other tests that
reference this fixture variable if necessary.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 972343e7-7762-43de-b281-296a0d0d6beb
📒 Files selected for processing (6)
packages/bruno-converters/src/postman/postman-to-bruno.jstests/import/postman/fixtures/postman-import-apikey-header-collection.jsontests/import/postman/fixtures/postman-import-apikey-query-collection.jsontests/import/postman/import-apikey-header-collection.spec.tstests/import/postman/import-apikey-query-collection.spec.tstests/utils/page/locators.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/request-auth.spec.js`:
- Around line 635-645: Add a test case to assert unknown Postman "in" values
default to header: in the same suite that uses buildApiKeyCollection and
postmanToBruno, add an it block (e.g., "should default placement to header when
Postman in is unknown") that builds a collection with an apiKey entry including
in: 'random' and then calls postmanToBruno and expects
result.items[0].request.auth.apikey.placement toBe('header'); this verifies
postmanToBruno handles unknown in values the same as a missing in.
🪄 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: 35a1aad4-d2b0-4a95-afcc-132e44b5b047
📒 Files selected for processing (7)
packages/bruno-app/src/components/RequestPane/Auth/ApiKeyAuth/index.jspackages/bruno-app/src/components/Sidebar/ImportCollection/index.jspackages/bruno-converters/src/postman/postman-to-bruno.jspackages/bruno-converters/tests/postman/postman-to-bruno/request-auth.spec.jstests/import/postman/import-apikey-header-collection.spec.tstests/import/postman/import-apikey-query-collection.spec.tstests/utils/page/locators.ts
✅ Files skipped from review due to trivial changes (2)
- packages/bruno-app/src/components/RequestPane/Auth/ApiKeyAuth/index.js
- packages/bruno-app/src/components/Sidebar/ImportCollection/index.js
🚧 Files skipped from review as they are similar to previous changes (4)
- packages/bruno-converters/src/postman/postman-to-bruno.js
- tests/import/postman/import-apikey-query-collection.spec.ts
- tests/utils/page/locators.ts
- tests/import/postman/import-apikey-header-collection.spec.ts
… defaults to header (usebruno#7968) * fix: 3014 - Postman import ignores API Key "in" placement setting and defaults to header * addressed review comments * addressed review comment * addressed review comment - added a test id * addressed reveiew comment
Description
Postman import ignores API Key "in" placement setting and defaults to header
Jira link - https://usebruno.atlassian.net/browse/BRU-3014
Postman's API Key auth supports two placements via the
infield ("header"or"query"), but Bruno's Postman importer was ignoring that field entirely and hard-coding the placement to"header". As a result, any Postman collection that authenticated by sending the API key as a query parameter would import incorrectly — the key/value were preserved, but the placement silently flipped to header, breaking the request. The fix is inpackages/bruno-converters/src/postman/postman-to-bruno.js: when processingAPIKEYauth, the converter now readsauthValues.inand maps"query"to Bruno's"queryparams"placement, falling back to"header"for"header", missing, or unknown values (which preserves the previous default for collections that don't specifyin). Two Playwright tests were added undertests/import/postman/covering both placements end-to-end — importing a fixture collection, opening the imported request, and asserting that the Auth tab's placement dropdown reflects the original Postman setting.Before:

After:

Contribution Checklist:
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
Bug Fixes
Tests
Chores