Skip to content

Add regression coverage for folder auth inheritance precedence#10000

Merged
yaoweiprc merged 2 commits into
fix/oauthfrom
copilot/fix-review-comment-3332874212
Jun 1, 2026
Merged

Add regression coverage for folder auth inheritance precedence#10000
yaoweiprc merged 2 commits into
fix/oauthfrom
copilot/fix-review-comment-3332874212

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 1, 2026

A review comment requested explicit regression coverage for getOrInheritAuthentication, specifically to lock in folder-auth inheritance ordering and type: 'none' behavior. This PR adds focused tests for those two cases without changing runtime logic.

  • What this addresses

    • Adds missing unit coverage for auth inheritance behavior that was previously untested.
    • Ensures inheritance semantics are explicit when parent folders provide conflicting auth configs.
  • Test additions

    • Verifies the closest parent folder auth wins over higher-level folder auth.
    • Verifies a closer { type: 'none' } stops inheritance from higher-level folders.
  • Scope

    • Changes are limited to:
      • packages/insomnia/src/network/__tests__/network.test.ts
expect(networkUtils.getOrInheritAuthentication({ request, requestGroups })).toEqual({
  type: 'basic',
  username: 'closest',
  password: 'closest-pass',
});

expect(networkUtils.getOrInheritAuthentication({ request, requestGroups })).toEqual({
  type: 'none',
});

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI changed the title [WIP] Fix code based on review comment Add regression coverage for folder auth inheritance precedence Jun 1, 2026
Copilot AI requested a review from yaoweiprc June 1, 2026 09:37
@yaoweiprc yaoweiprc marked this pull request as ready for review June 1, 2026 09:41
@yaoweiprc yaoweiprc merged commit 385b1f5 into fix/oauth Jun 1, 2026
10 of 11 checks passed
@yaoweiprc yaoweiprc deleted the copilot/fix-review-comment-3332874212 branch June 1, 2026 09:41
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

⚠️ Circular References Report

Generated at: 2026-06-01T09:46:19.347Z
Status: ⚠️ WARNING

Summary

Metric Base (fix/oauth) PR Change
Total Circular References 10 12 +2 (+20.00%)

⚠️ New Circular References Added (4)

Click to expand/collapse
insomnia/src/network/network.ts -> insomnia/src/common/render.ts -> insomnia/src/templating/index.ts -> insomnia/src/plugins/index.ts -> insomnia/src/plugins/context/app.ts -> insomnia/src/templating/types.ts -> insomnia/src/plugins/context/network.ts
insomnia/src/plugins/index.ts -> insomnia/src/plugins/context/app.ts -> insomnia/src/templating/types.ts -> insomnia/src/plugins/context/store.ts
insomnia/src/plugins/index.ts -> insomnia/src/plugins/misc.ts
insomnia/src/templating/types.ts -> insomnia/src/plugins/context/network.ts

✨ Circular References Removed (2)

Click to expand/collapse
insomnia/src/plugins/index.ts -> insomnia/src/plugins/context/store.ts
insomnia/src/plugins/misc.ts -> insomnia/src/plugins/index.ts
Click to view all circular references in PR (12)
insomnia-inso/src/db/models/types.ts -> insomnia-inso/src/db/types.ts
insomnia/src/network/network.ts -> insomnia-scripting-environment/src/objects/index.ts -> insomnia-scripting-environment/src/objects/collection.ts -> insomnia-scripting-environment/src/objects/response.ts
insomnia/src/network/network.ts -> insomnia-scripting-environment/src/objects/index.ts -> insomnia-scripting-environment/src/objects/insomnia.ts -> insomnia-scripting-environment/src/objects/interfaces.ts
insomnia/src/network/network.ts -> insomnia/src/common/render.ts
insomnia/src/network/network.ts -> insomnia/src/common/render.ts -> insomnia/src/templating/index.ts -> insomnia/src/plugins/index.ts -> insomnia/src/plugins/context/app.ts -> insomnia/src/templating/types.ts -> insomnia/src/plugins/context/network.ts
insomnia/src/plugins/index.ts -> insomnia/src/plugins/context/app.ts -> insomnia/src/templating/types.ts -> insomnia/src/plugins/context/store.ts
insomnia/src/plugins/index.ts -> insomnia/src/plugins/misc.ts
insomnia/src/templating/types.ts -> insomnia/src/plugins/context/network.ts
insomnia/src/ui/components/settings/import-export.tsx -> insomnia/src/ui/components/modals/export-requests-modal.tsx
insomnia/src/ui/components/tabs/tab-list.tsx -> insomnia/src/ui/components/tabs/tab.tsx
insomnia/src/ui/components/templating/tag-editor-arg-sub-form.tsx -> insomnia/src/ui/components/templating/external-vault/external-vault-form.tsx
insomnia/src/ui/components/viewers/response-viewer.tsx -> insomnia/src/ui/components/viewers/response-multipart-viewer.tsx
Click to view all circular references in base branch (10)
insomnia-inso/src/db/models/types.ts -> insomnia-inso/src/db/types.ts
insomnia/src/network/network.ts -> insomnia-scripting-environment/src/objects/index.ts -> insomnia-scripting-environment/src/objects/collection.ts -> insomnia-scripting-environment/src/objects/response.ts
insomnia/src/network/network.ts -> insomnia-scripting-environment/src/objects/index.ts -> insomnia-scripting-environment/src/objects/insomnia.ts -> insomnia-scripting-environment/src/objects/interfaces.ts
insomnia/src/network/network.ts -> insomnia/src/common/render.ts
insomnia/src/plugins/index.ts -> insomnia/src/plugins/context/store.ts
insomnia/src/plugins/misc.ts -> insomnia/src/plugins/index.ts
insomnia/src/ui/components/settings/import-export.tsx -> insomnia/src/ui/components/modals/export-requests-modal.tsx
insomnia/src/ui/components/tabs/tab-list.tsx -> insomnia/src/ui/components/tabs/tab.tsx
insomnia/src/ui/components/templating/tag-editor-arg-sub-form.tsx -> insomnia/src/ui/components/templating/external-vault/external-vault-form.tsx
insomnia/src/ui/components/viewers/response-viewer.tsx -> insomnia/src/ui/components/viewers/response-multipart-viewer.tsx

Analysis

⚠️ Warning: This PR introduces 2 new circular references. Consider refactoring to avoid adding circular dependencies.


This report was generated automatically by comparing against the fix/oauth branch.

yaoweiprc added a commit that referenced this pull request Jun 2, 2026
…NS-2671] (#9999)

* tmp

* Fix the bug that inherited auth is not applied as expected

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Add regression coverage for folder auth inheritance precedence (#10000)

* Initial plan

* test: add auth inheritance regression coverage

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
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.

3 participants