Skip to content

Feature/accept mtls keys instead of paths#68

Open
alexbourret wants to merge 8 commits intofeature/move-mtls-settings-to-presetsfrom
feature/accept-mtls-keys-instead-of-paths
Open

Feature/accept mtls keys instead of paths#68
alexbourret wants to merge 8 commits intofeature/move-mtls-settings-to-presetsfrom
feature/accept-mtls-keys-instead-of-paths

Conversation

@alexbourret
Copy link
Copy Markdown
Collaborator

@alexbourret alexbourret commented Apr 2, 2026

"label": "Path to certificate",
"description": "",
"type": "STRING",
"description": "or full certificate from -----BEGIN to END CERTIFICATE-----",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I would put this so the user can better understand the expected format. Same for other fields

Suggested change
"description": "or full certificate from -----BEGIN to END CERTIFICATE-----",
"description": "or full certificate starting with -----BEGIN CERTIFICATE",

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

👍 Done in 581a267

@@ -130,15 +130,15 @@
{
"name": "mtls_certificate_path",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I guess it should no longer be named path

Suggested change
"name": "mtls_certificate_path",
"name": "mtls_certificate",

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure about that one:

  • we still accept path in this variable
  • it will create incompatibilities with presets created during the beta testing phase, which is fine because that was a beta testing phase, but will still create some confusion...

Comment thread python-lib/rest_api_client.py Outdated

def normalize_key(key):
tempo_text = str(key)
tempo_text = tempo_text.replace("BEGIN CERTIFICATE", "BEGINCERTIFICATE")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

By doing this we really need to be sure that the clieant won't pass in RSA or other type of keys.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

👍 Done in 1cfed44

tempo_text = tempo_text.replace("END CERTIFICATE", "ENDCERTIFICATE")
tempo_text = tempo_text.replace("-----BEGIN PRIVATE KEY-----", "-----BEGINPRIVATEKEY-----")
tempo_text = tempo_text.replace("-----END PRIVATE KEY-----", "-----ENDPRIVATEKEY-----")
tempo_text = tempo_text.replace(" ", "\n")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could this be avoided if the input to the cert was a textarea instead of a input field? If I understand correctly we're trying to rebuild the certificate content because it was flattened when the user pasted into the input field

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We have to use the password type here so that the certificate and key are encrypted on the instance... Using Textarea would be less safe in that regard.

@alexbourret alexbourret requested a review from tdnghia98 April 16, 2026 11:41
Copy link
Copy Markdown

@tdnghia98 tdnghia98 left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

2 participants