Skip to content
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

Support host aliases in client certificate configuration #1117

Open
wants to merge 39 commits into
base: master
Choose a base branch
from

Conversation

mpcjanssen
Copy link

We are using an enterprise service bus where different users have different authorisations and use different client certificates. So I need to be able to configure multiple client certificates for the same host.

This PR allows changing the host of the http request in the certificate settings so one can define an alias for every different certificate on the same host.

Another option to achieve the same effect would be to be able to define a certificate on every request but that is a bigger change and requires more duplication in the http files themselves.

Example use:

config.json

{
    "rest-client.certificates": {
        "esbnode_certa": {
            "hostname": "esbnode",
            "pfx": "user_a.p12",
            "passphrase": "pw_a"
        },
        "esbnode_certb": {
            "hostname": "esbnode",
            "pfx": "user_b.p12",
            "passphrase": "pw_b"
        }
    }
}

And then in the http file:

### with cert a
GET https://esbnode_certa/operation

### with cert b
GET https://esbnode_certb/operation

mpcjanssen and others added 27 commits January 11, 2023 09:48
* Added auto logic to make password type inputs hide entry

* Added password input usage to readme. Reverted any Prettier changes made on last commit.
Bumps [http-cache-semantics](https://github.com/kornelski/http-cache-semantics) from 4.0.3 to 4.1.1.
- [Release notes](https://github.com/kornelski/http-cache-semantics/releases)
- [Commits](kornelski/http-cache-semantics@v4.0.3...v4.1.1)

---
updated-dependencies:
- dependency-name: http-cache-semantics
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [qs](https://github.com/ljharb/qs) from 6.5.2 to 6.5.3.
- [Release notes](https://github.com/ljharb/qs/releases)
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](ljharb/qs@v6.5.2...v6.5.3)

---
updated-dependencies:
- dependency-name: qs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…eign clouds (Huachao#1159)

* Add support for AzureChinaCloud and AzureUSGovernment sovereign clouds

* Fix tslint error

* Fix tslint error

---------

Co-authored-by: Huachao Mao <[email protected]>
Bumps [minimist](https://github.com/minimistjs/minimist), [minimist](https://github.com/minimistjs/minimist) and [mkdirp](https://github.com/isaacs/node-mkdirp). These dependencies needed to be updated together.

Updates `minimist` from 1.2.5 to 1.2.8
- [Release notes](https://github.com/minimistjs/minimist/releases)
- [Changelog](https://github.com/minimistjs/minimist/blob/main/CHANGELOG.md)
- [Commits](minimistjs/minimist@v1.2.5...v1.2.8)

Updates `minimist` from 1.2.0 to 1.2.8
- [Release notes](https://github.com/minimistjs/minimist/releases)
- [Changelog](https://github.com/minimistjs/minimist/blob/main/CHANGELOG.md)
- [Commits](minimistjs/minimist@v1.2.5...v1.2.8)

Updates `mkdirp` from 0.5.1 to 0.5.6
- [Release notes](https://github.com/isaacs/node-mkdirp/releases)
- [Changelog](https://github.com/isaacs/node-mkdirp/blob/main/CHANGELOG.md)
- [Commits](isaacs/node-mkdirp@0.5.1...v0.5.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
- dependency-name: minimist
  dependency-type: indirect
- dependency-name: mkdirp
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [ajv](https://github.com/ajv-validator/ajv) and [har-validator](https://github.com/ahmadnassri/node-har-validator). These dependencies needed to be updated together.

Updates `ajv` from 6.12.2 to 6.12.6
- [Release notes](https://github.com/ajv-validator/ajv/releases)
- [Commits](ajv-validator/ajv@v6.12.2...v6.12.6)

Updates `har-validator` from 5.1.0 to 5.1.5
- [Release notes](https://github.com/ahmadnassri/node-har-validator/releases)
- [Changelog](https://github.com/ahmadnassri/node-har-validator/blob/master/.releaserc)
- [Commits](ahmadnassri/node-har-validator@v5.1.0...v5.1.5)

---
updated-dependencies:
- dependency-name: ajv
  dependency-type: indirect
- dependency-name: har-validator
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [terser](https://github.com/terser/terser) from 4.6.13 to 4.8.1.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/commits)

---
updated-dependencies:
- dependency-name: terser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](json5/json5@v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Huachao Mao <[email protected]>
Updated the environmentVariableProvider so that it supports variable resolution in all environments.

Co-authored-by: Kristijan Vulinovic <[email protected]>
…#928)

* Added ability to percent-encode variables when referenced

* Updated README to cover percent-encoding file variables
Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](SamVerschueren/decode-uri-component@v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: decode-uri-component
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@nt126716
Copy link

Hi @mpcjanssen
Instead of having hostname in certificate block, can we have requestUrl as below

{
    "rest-client.certificates": {
        "certa": {
            "requestUrl": "https://example.com/path1",
            "pfx": "user_a.p12",
            "passphrase": "pw_a"
        },
        "certb": {
            "requestUrl": "https://example.com/path2",
            "pfx": "user_b.p12",
            "passphrase": "pw_b"
        }
    }
}

And then users can simple use regular syntax or can follow the same syntax of having per-request settings standard as
Regular Syntax:

GET https://example.com/path1/operation

###
GET https://example.com/path2/operation

Per-request settings:

# @cert certa
GET https://example.com/path1/operation

###
# @cert certb
GET https://example.com/path2/operation
GET

jeremyfiel and others added 2 commits May 10, 2024 09:08
While RFC2616 indicates http header field `names` are case insensitive,
it leaves http header field `values` more open to interpretation,
such as using the text

> Applications ought to follow "common form", where one is known or
indicated, when generating HTTP constructs, since there might exist
some implementations that fail to accept anything beyond the common forms.

This is a small user experience improvement for REST Client users
to prevent a negative experience by using a case sensitive value.

fixes Huachao#1236
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.