Skip to content

feat: collection level headers and authorization #3505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 47 commits into from
Dec 13, 2023

Conversation

nivedin
Copy link
Member

@nivedin nivedin commented Nov 7, 2023

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

@nivedin nivedin changed the title feat: added properties option for root collection feat: ability to set auth & headers at a root collection Nov 7, 2023
@nivedin nivedin changed the title feat: ability to set auth & headers at a root collection feat: collection level headers and authorization Nov 23, 2023
@nivedin nivedin force-pushed the feat/coll-root-auth-headers branch 3 times, most recently from 84e5b02 to 70ab963 Compare December 7, 2023 17:31
@nivedin nivedin requested a review from liyasthomas December 8, 2023 09:33
@nivedin nivedin marked this pull request as ready for review December 8, 2023 09:34
Copy link
Member

@jamesgeorge007 jamesgeorge007 left a comment

Choose a reason for hiding this comment

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

  • The modal is not displayed, and a few exceptions get logged to the console while attempting to import a collection that follows the old format (without authorization and headers set at the root level).

    old-collections-format-exception.mov
  • The collection entries synced to the personal workspace from local storage added while logged out do not persist. For instance, deleting any of them while being logged out affects the one in the personal workspace.

    personal-workspace-collections-affected-by-unauth-state.mov
  • Authorization and headers set at the collection level go to the default state while importing collections into the team workspace.

    inconsistent-sate-collections-logged-in.mov
  • There are exceptions thrown in the UI under headers while opting for the API key as the Authorization type and choosing the values to be supplied via headers. There is a similar issue that already exists for the request Authorization/Headers tabs, Ref. This might be happening since common components are involved. Please confirm.

    ui-exceptions-pass-by-headers.mov
  • Is it intentional that the default Authorization type for a request not belonging to a collection is inherit? Shouldn't we keep the default type of None for those requests?

    default-auth-type-non-collection-request.mov

Copy link
Member

@jamesgeorge007 jamesgeorge007 left a comment

Choose a reason for hiding this comment

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

REST & GQL collections could not inherit from the ancestor levels and default to the authorization type of None.

rest-collections-ancestor-inherit.mov

Also, can you look into the failing tests?

@nivedin nivedin force-pushed the feat/coll-root-auth-headers branch from 0565660 to 292e664 Compare December 12, 2023 10:30
Copy link
Member

@jamesgeorge007 jamesgeorge007 left a comment

Choose a reason for hiding this comment

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

  • The currently active tab (REST & GQL) doesn't reflect changes made at the ancestor level. This applies to both headers and authorization.

    Screen.Recording.2023-12-13.at.1.07.18.PM.mov
  • The modal is not displayed while importing GQL collections that follow the old format (without auth & headers) and there are errors logged to the console.

@nivedin nivedin force-pushed the feat/coll-root-auth-headers branch from d09fa1e to 891824f Compare December 13, 2023 11:37
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