bruno icon indicating copy to clipboard operation
bruno copied to clipboard

feat: Store client certificate paths in collection settings as relative to collection and display them the UI.

Open pietrygamat opened this issue 1 year ago • 5 comments

Description

The UI for collection level certificates does not reveal which file is used for which domains, so the only way to make sure you are using correct keys is to remove and re-add them. Also, the paths to key and cert files are kept in bruno.json file as absolute paths, making it unsuitable for version control and sharing between users with various setups.

With this change, the paths picked with file picker are relative to current collection and displayed in the Client Certificates view of collection settings.

Screenshot from 2024-07-02 09-27-27

Note, the absolute paths are still supported, so collections using old format are not affected.

fixes #2420

Contribution Checklist:

  • [x] The pull request only addresses one issue or adds one feature.
  • [x] The pull request does not introduce any breaking changes
  • [x] I have added screenshots or gifs to help explain the change if applicable.
  • [x] I have read the contribution guidelines.
  • [x] 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.

pietrygamat avatar Jun 06 '24 18:06 pietrygamat

@sanjai0py @helloanoop consider this one when merging of #2336 . Thanks.

pietrygamat avatar Jun 12 '24 21:06 pietrygamat

@pietrygamat Can you fix the conflicts? Otherwise this is GTG

helloanoop avatar Jun 21 '24 05:06 helloanoop

@helloanoop done. As a sidenote: from my testing, when running bruno on Windows the path.relative produces wrong results (i.e. posix implementation is fired even though win32 one should). I am not sure it's my build issue, or electron issue.

I work around this by using:

      if (isWindowsOS()) {
        relativePath = slash(path.win32.relative(root, e.files[0].path));
      } else {
        relativePath = path.posix.relative(root, e.files[0].path);
      }

I think there are a couple more places in the application, that this may cause problems.

pietrygamat avatar Jun 21 '24 10:06 pietrygamat

@sanjai0py , is it still GTG?

pietrygamat avatar Jul 24 '24 13:07 pietrygamat

Really looking forward to this! Could simplify a lot of our setup :)

Merged! Thanks @pietrygamat

helloanoop avatar Aug 27 '24 10:08 helloanoop