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

Feat/client cert types #2482

Merged
merged 9 commits into from
Jun 21, 2024
Merged

Conversation

lohxt1
Copy link
Collaborator

@lohxt1 lohxt1 commented Jun 18, 2024

Description

~ an option to choose between pfx and cert/key while adding client certificates

Contribution Checklist:

  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.
unselected cert_selected pfx_selected

@lohxt1 lohxt1 requested a review from helloanoop June 18, 2024 14:02
} else if (type === 'pfx') {
try {
const pfxFilePath = interpolateString(clientCert?.pfxFilePath, interpolationOptions);
pfxFilePath = path.isAbsolute(pfxFilePath) ? pfxFilePath : path.join(collectionPath, pfxFilePath);
Copy link
Contributor

Choose a reason for hiding this comment

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

Error reading pfx file TypeError: Assignment to constant variable.

httpsAgentRequestFields['cert'] = fs.readFileSync(certFilePath);
httpsAgentRequestFields['key'] = fs.readFileSync(keyFilePath);
} catch (err) {
console.error('Error reading cert/key file', err);
Copy link
Contributor

@pietrygamat pietrygamat Jun 18, 2024

Choose a reason for hiding this comment

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

These errors should be returned to the user somehow (in a timeline like other types of erros?). In case of missing cert file I simply get an Error: socket hang up, as if no cert was configured at all, which is different than handling invalid cert files, or incorrect passphrase.

@@ -76,35 +134,161 @@ const ClientCertSettings = ({ clientCertConfig, onUpdate, onRemove }) => {
) : null}
</div>
<div className="mb-3 flex items-center">
<label className="settings-label" htmlFor="certFilePath">
Cert file
<label className="settings-label" htmlFor="protocol">
Copy link
Contributor

@pietrygamat pietrygamat Jun 18, 2024

Choose a reason for hiding this comment

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

Should be htmlFor="type"? But the type input is missing id

@lohxt1 lohxt1 marked this pull request as ready for review June 19, 2024 07:33
@helloanoop helloanoop merged commit 5259c5f into usebruno:main Jun 21, 2024
3 checks passed
@helloanoop
Copy link
Contributor

Fantastic work @lohxt1 !

Thank you @pietrygamat for reviewing and approving the changes.

jwetzell pushed a commit to jwetzell/bruno that referenced this pull request Aug 2, 2024
* feat: pfx/cert client certificates

* ui updates

* file tooltip

* feat: updated client cert logic

* feat: updated validations

* const to let

* throw error incase of invalid file paths

* fix htmlFor label

* updated cli error messages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants