usebruno / bruno

Opensource IDE For Exploring and Testing Api's (lightweight alternative to postman/insomnia)
https://www.usebruno.com/
MIT License
25.22k stars 1.15k forks source link

[Feature Request] Store client certificate paths in collection settings as relative to collection #2420

Closed pietrygamat closed 2 weeks ago

pietrygamat commented 3 months ago

I have checked the following:

Describe the feature you want to add

The path to cert and key files stored in bruno.json file should be relative to collection.

Currenlty, when I pick up a cert or a key file in UI they are persisted as absolute paths on my disk, which is not git friendly, especially when the certificates are themselves part of my git repo. The path should also be normalized (to POSIX standard?), because we do not want to see these pesky \\ pollution from our Windows friends.

Note, bruno does not seem to have the problem when loading data like this, but should always save it this way.

Mockups or Images of the feature

This is good

 "clientCertificates": {
    "enabled": true,
    "certs": [
      {
        "domain": "localhost",
        "certFilePath": "../certs/my.cer",
        "keyFilePath": "../certs/my.privkey.pem",
        "passphrase": ""
      },

This is bad

 "clientCertificates": {
    "enabled": true,
    "certs": [
      {
    "domain": "host.docker.internal",
        "certFilePath": "C:\\Users\\bruno\\Projects\\collections\\certs\\my.cer",
        "keyFilePath": "C:\\Users\\bruno\\Projects\\collections\\certs\\my.privkey.pem",
        "passphrase": ""
      },
pidj commented 3 months ago

Kudos for this feature request. I'm interested by this feature too :-)