feat: Store client certificate paths in collection settings as relative to collection and display them the UI.
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.
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.
@sanjai0py @helloanoop consider this one when merging of #2336 . Thanks.
@pietrygamat Can you fix the conflicts? Otherwise this is GTG
@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.
@sanjai0py , is it still GTG?
Really looking forward to this! Could simplify a lot of our setup :)
Merged! Thanks @pietrygamat