[PR #3505] [MERGED] feat: collection level headers and authorization #4415

Closed
opened 2026-03-17 01:57:07 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/3505
Author: @nivedin
Created: 11/7/2023
Status: Merged
Merged: 12/13/2023
Merged by: @AndrewBastin

Base: release/2023.12.0Head: feat/coll-root-auth-headers


📝 Commits (10+)

  • 1896e5a feat: added properties option for root collection
  • f8aeb42 chore: improve UI flow and add i18n
  • ae531f5 chore: update properties UI flow
  • 59735c1 refactor: update components to encapsulate
  • d326063 chore: update types
  • a48d7e8 refactor: inherited auth and header for req runner
  • 2687592 refactor: add auth and header fields coll in sh
  • 7c3a842 refactor: add fallback for new request auth state
  • b893607 refactor: inherit properties when saving
  • 0a54455 refactor: inherit header from multiple collecions

📊 Changes

95 files changed (+3216 additions, -965 deletions)

View changed files

📝 packages/hoppscotch-cli/src/types/collections.ts (+2 -2)
📝 packages/hoppscotch-cli/src/types/request.ts (+1 -1)
📝 packages/hoppscotch-cli/src/utils/checks.ts (+2 -9)
📝 packages/hoppscotch-cli/src/utils/collections.ts (+52 -54)
📝 packages/hoppscotch-cli/src/utils/mutators.ts (+18 -16)
📝 packages/hoppscotch-common/assets/themes/base-themes.scss (+1 -0)
📝 packages/hoppscotch-common/locales/en.json (+5 -0)
📝 packages/hoppscotch-common/src/components.d.ts (+1 -0)
📝 packages/hoppscotch-common/src/components/app/spotlight/entry/GQLRequest.vue (+2 -2)
📝 packages/hoppscotch-common/src/components/app/spotlight/entry/RESTRequest.vue (+2 -2)
📝 packages/hoppscotch-common/src/components/collections/Collection.vue (+20 -4)
📝 packages/hoppscotch-common/src/components/collections/ImportExport.vue (+29 -12)
📝 packages/hoppscotch-common/src/components/collections/MyCollections.vue (+31 -10)
packages/hoppscotch-common/src/components/collections/Properties.vue (+166 -0)
📝 packages/hoppscotch-common/src/components/collections/SaveRequest.vue (+61 -0)
📝 packages/hoppscotch-common/src/components/collections/TeamCollections.vue (+31 -1)
📝 packages/hoppscotch-common/src/components/collections/graphql/Add.vue (+46 -46)
📝 packages/hoppscotch-common/src/components/collections/graphql/AddFolder.vue (+40 -38)
📝 packages/hoppscotch-common/src/components/collections/graphql/Collection.vue (+55 -12)
📝 packages/hoppscotch-common/src/components/collections/graphql/Edit.vue (+7 -6)

...and 75 more files

📄 Description

Closes HFE-238 HFE-348 HFE-331 HFE-330 #2259 #1741

Description

This PR adds ability to set authorization & headers in collection and folder level which their requests can inherit.

  • There is a new option for collection/folder called properties

image

  • In the properties use can set headers and authorization

image

image

  • The children request can either inherit the parent collection authorization or headers

  • The request authorization has a new option 'inherit' where the auth is inherited from their parent collection/folder if selected.

image

The authorizatiuon priority is like this
The auth set in request > Parent Folder > Root Colection

  • The header are can be inherited from the entire tree ie,

    - Collection  (has header 1, header 2)
       - Folder  (has header 3, header 4)
          - Request (this will inherit header 1, 2, 3, 4)
    

image

The request has the ability to overide the following headers

Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

Additional information

TODO

  • Fix syncing collection (currently it breaks this feature due to addition of two new fields for auth and headers for collection)
  • Add support for Team Collection
  • Implement in GraphQl
  • Add versioning of collection
  • Fix TS errors

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/3505 **Author:** [@nivedin](https://github.com/nivedin) **Created:** 11/7/2023 **Status:** ✅ Merged **Merged:** 12/13/2023 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `release/2023.12.0` ← **Head:** `feat/coll-root-auth-headers` --- ### 📝 Commits (10+) - [`1896e5a`](https://github.com/hoppscotch/hoppscotch/commit/1896e5afe1c574a629e2de1338cbe41b6352bbb5) feat: added properties option for root collection - [`f8aeb42`](https://github.com/hoppscotch/hoppscotch/commit/f8aeb42da57c95b1f8a61b633b3c4e4f5a69f3f4) chore: improve UI flow and add i18n - [`ae531f5`](https://github.com/hoppscotch/hoppscotch/commit/ae531f588204288e6818ac0b5d2a49e253ac6fdb) chore: update properties UI flow - [`59735c1`](https://github.com/hoppscotch/hoppscotch/commit/59735c15e4e2af9bef681ddcb3c461e5d9b69625) refactor: update components to encapsulate - [`d326063`](https://github.com/hoppscotch/hoppscotch/commit/d32606365942a157a3d778a90d065d63a9c666b3) chore: update types - [`a48d7e8`](https://github.com/hoppscotch/hoppscotch/commit/a48d7e879f0b94ecab2e3fcd9b02144b78b2e404) refactor: inherited auth and header for req runner - [`2687592`](https://github.com/hoppscotch/hoppscotch/commit/2687592a565412b4cdf6eb4f45212d3eb7dd5bc3) refactor: add auth and header fields coll in sh - [`7c3a842`](https://github.com/hoppscotch/hoppscotch/commit/7c3a84246dc28ed24437725939b03bd220404d1e) refactor: add fallback for new request auth state - [`b893607`](https://github.com/hoppscotch/hoppscotch/commit/b893607ad1f9d74abb7bce8278900f0aae0ed836) refactor: inherit properties when saving - [`0a54455`](https://github.com/hoppscotch/hoppscotch/commit/0a54455fe72d94ed73572e3f18190ebed592ef8e) refactor: inherit header from multiple collecions ### 📊 Changes **95 files changed** (+3216 additions, -965 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-cli/src/types/collections.ts` (+2 -2) 📝 `packages/hoppscotch-cli/src/types/request.ts` (+1 -1) 📝 `packages/hoppscotch-cli/src/utils/checks.ts` (+2 -9) 📝 `packages/hoppscotch-cli/src/utils/collections.ts` (+52 -54) 📝 `packages/hoppscotch-cli/src/utils/mutators.ts` (+18 -16) 📝 `packages/hoppscotch-common/assets/themes/base-themes.scss` (+1 -0) 📝 `packages/hoppscotch-common/locales/en.json` (+5 -0) 📝 `packages/hoppscotch-common/src/components.d.ts` (+1 -0) 📝 `packages/hoppscotch-common/src/components/app/spotlight/entry/GQLRequest.vue` (+2 -2) 📝 `packages/hoppscotch-common/src/components/app/spotlight/entry/RESTRequest.vue` (+2 -2) 📝 `packages/hoppscotch-common/src/components/collections/Collection.vue` (+20 -4) 📝 `packages/hoppscotch-common/src/components/collections/ImportExport.vue` (+29 -12) 📝 `packages/hoppscotch-common/src/components/collections/MyCollections.vue` (+31 -10) ➕ `packages/hoppscotch-common/src/components/collections/Properties.vue` (+166 -0) 📝 `packages/hoppscotch-common/src/components/collections/SaveRequest.vue` (+61 -0) 📝 `packages/hoppscotch-common/src/components/collections/TeamCollections.vue` (+31 -1) 📝 `packages/hoppscotch-common/src/components/collections/graphql/Add.vue` (+46 -46) 📝 `packages/hoppscotch-common/src/components/collections/graphql/AddFolder.vue` (+40 -38) 📝 `packages/hoppscotch-common/src/components/collections/graphql/Collection.vue` (+55 -12) 📝 `packages/hoppscotch-common/src/components/collections/graphql/Edit.vue` (+7 -6) _...and 75 more files_ </details> ### 📄 Description Closes HFE-238 HFE-348 HFE-331 HFE-330 #2259 #1741 ### Description This PR adds ability to set authorization & headers in collection and folder level which their requests can inherit. - There is a new option for collection/folder called properties ![image](https://github.com/hoppscotch/hoppscotch/assets/53208152/05b30c30-60af-4fae-81f5-465b76d0cdc2) - In the properties use can set headers and authorization ![image](https://github.com/hoppscotch/hoppscotch/assets/53208152/5911d186-123d-4be3-90f3-35ea80647835) ![image](https://github.com/hoppscotch/hoppscotch/assets/53208152/64d9ec85-a13d-43d1-8ed1-d0ca5882fa7a) - The children request can either inherit the parent collection authorization or headers - The request authorization has a new option 'inherit' where the auth is inherited from their parent collection/folder if selected. ![image](https://github.com/hoppscotch/hoppscotch/assets/53208152/c5632fac-39b8-45a8-93fd-46951b85c709) The authorizatiuon priority is like this The auth set in request > Parent Folder > Root Colection - The header are can be inherited from the entire tree ie, - Collection (has header 1, header 2) - Folder (has header 3, header 4) - Request (this will inherit header 1, 2, 3, 4) ![image](https://github.com/hoppscotch/hoppscotch/assets/53208152/b96184f3-f503-44c5-93b1-84ec741fc74d) The request has the ability to overide the following headers ### Checks - [x] My pull request adheres to the code style of this project - [x] My code requires changes to the documentation - [ ] I have updated the documentation as required - [x] All the tests have passed ### Additional information #### TODO - [x] Fix syncing collection (currently it breaks this feature due to addition of two new fields for auth and headers for collection) - [x] Add support for Team Collection - [x] Implement in GraphQl - [x] Add versioning of collection - [x] Fix TS errors --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 01:57:07 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#4415
No description provided.