-
Notifications
You must be signed in to change notification settings - Fork 18
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
[MWTELE-48]: Do not create report if cert/key not present and report cannot be sent. #41
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment. Otherwise LGTM.
We might also consider improvement in InsightsMultiClient.sendInsightsReport()
(https://github.com/RedHatInsights/insights-java-client/blob/main/api/src/main/java/com/redhat/insights/http/InsightsMultiClient.java#L38) to filter clients which "are not ready" to sent.
@Override | ||
public boolean isReadyToSend() { | ||
return new File(config.getCertFilePath()).exists() | ||
&& new File(config.getKeyFilePath()).exists(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that for file upload the location of cert/key is given and we should use defaults:
InsightsConfiguration.DEFAULT_RHEL_CERT_FILE_PATH
and InsightsConfiguration.DEFAULT_RHEL_KEY_FILE_PATH
pointing to key and cert in /etc/pki/consumer
directory. Retrieving it from configuration might be overriden by env/system properties.
We should investigate also https://github.com/RedHatInsights/insights-ingress-java/issues/126 to improve this logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to contain a bug.
@Override | ||
public boolean isReadyToSend() { | ||
return new File(configuration.getCertFilePath()).exists() | ||
&& new File(configuration.getKeyFilePath()).exists(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How will this code work if we're using token-based auth & there are no certs?
…cannot be sent. * InsightsMultiClient checks that at leat one of the client is ready. * InsightsFileWritingClient checks that the Insights certificates are present. * InsightsJdkHttpClient checks that the Insights certificates are present or that a token is being used. Jira: https://issues.redhat.com/browse/MWTELE-48 Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Jira: https://issues.redhat.com/browse/MWTELE-48