Skip to content

use IDEA certificate manager when connecting to the cluster (#600) #607

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

Merged
merged 2 commits into from
Jun 1, 2023

Conversation

adietish
Copy link
Collaborator

@adietish adietish commented May 25, 2023

fixes #600

@adietish
Copy link
Collaborator Author

adietish commented May 25, 2023

Current simplistic implementation is using the IDEA setting "Accept non-trusted certificates automatically". It tells our kubernetes-client to automatically accept all certificates if the setting is enabled in IDEA. It is very limited though:

  1. The plugin cannot respect a change in this setting without the IDE being restarted. The reason for this is that the IDE wont notify the plugin of a change in this setting.
  2. The plugin cannot take the certificates into account, that you manually add in the settings.

A solution to both these limitation would be to hand the IDEA certificate manager over to our kubernetes-client. This isn't possible currently because the client expect the certificate-manager and the key-manager. I need to get the ones used by the client, hand it over to IDEA and give the client the IDEA managers. The client currently wont allow me to access those, it looks as if I need a change in kubernetes-client for this.

@adietish
Copy link
Collaborator Author

If you follow the steps with our cluster bot, to reproduce this the plugin now behaves as follows:

You are prompted to accept or reject the untrusted certificate for your cluster:
image
Once you accept it you can deal with your cluster in IDEA

@adietish adietish self-assigned this May 31, 2023
@adietish adietish marked this pull request as ready for review May 31, 2023 08:03
@adietish adietish changed the title use IDEA setting 'accept non-trusted certificates' (#600) use IDEA certificate manager when connecting to the cluster (#600) May 31, 2023
@adietish adietish requested a review from datho7561 May 31, 2023 17:59
@adietish
Copy link
Collaborator Author

Hi @datho7561, can you please test this? You can find the steps to reproduce the issue and test this PR in #600 (comment). The variant 2, where you use the slack "Cluster Bot" is the simpler approach. There's no need to install a self-signed certificate since the cluster that the bot creates has a self-signed certificate already. Thanks!

Copy link
Contributor

@datho7561 datho7561 left a comment

Choose a reason for hiding this comment

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

Looks good, and it's working well for me!

@adietish adietish force-pushed the issue-600 branch 6 times, most recently from 2fbf008 to 792e904 Compare June 1, 2023 08:22
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 1, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.9% 0.9% Duplication

@adietish
Copy link
Collaborator Author

adietish commented Jun 1, 2023

Added unit-tests and javadoc.

@adietish adietish merged commit 248dc4f into redhat-developer:main Jun 1, 2023
@adietish adietish deleted the issue-600 branch June 1, 2023 09:27
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.

"unable to find valid certification path to requested target" when trying to edit a resource
2 participants