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

Remove empty ssl file upload #518

Merged
merged 12 commits into from
Jun 22, 2021

Conversation

jan-law
Copy link
Contributor

@jan-law jan-law commented Jun 16, 2021

Fixes #494

I'd appreciate some feedback to make the code more readable.

After the certValidator tries to parse the cert and throws an exception,filePath.toFile().delete() returns false if it failed. I'm not sure what's the cleanest way to handle this error since it's already in a try/catch block?

@jan-law
Copy link
Contributor Author

jan-law commented Jun 16, 2021

If I try to run the integration tests, the ClientAssetsIT throws a 500 error when it tries to download index.html:

ClientAssetsIT.setup:62 » Execution java.lang.Exception: HTTP 500

I haven't altered this test file. Any ideas about what happened?

@jan-law jan-law requested a review from andrewazores June 16, 2021 16:53
@andrewazores
Copy link
Member

If I try to run the integration tests, the ClientAssetsIT throws a 500 error when it tries to download index.html:

ClientAssetsIT.setup:62 » Execution java.lang.Exception: HTTP 500

I haven't altered this test file. Any ideas about what happened?

This will happen if you run itests with -Dcryostat.minimal=false, since a minimal build does not include the web-client assets. If you didn't include that -D property then something else is up, but the CI runner passed the integration tests so it looks okay from here.

@jan-law
Copy link
Contributor Author

jan-law commented Jun 16, 2021

This will happen if you run itests with -Dcryostat.minimal=false, since a minimal build does not include the web-client assets. If you didn't include that -D property then something else is up, but the CI runner passed the integration tests so it looks okay from here.

Ah, that's exactly what happened, thanks.

@jan-law jan-law marked this pull request as ready for review June 17, 2021 19:49
Copy link
Member

@andrewazores andrewazores 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 other than that last tiny unit test comment. Would you like to try your hand at writing an integration test to exercise this as well?

@jan-law
Copy link
Contributor Author

jan-law commented Jun 18, 2021

Looks good other than that last tiny unit test comment. Would you like to try your hand at writing an integration test to exercise this as well?

Yes, that would be useful to learn. I'll let you know if I have questions

@jan-law jan-law force-pushed the 494-remove-empty-ssl-file-upload branch from e484bee to d9f58ee Compare June 21, 2021 20:40
@jan-law jan-law force-pushed the 494-remove-empty-ssl-file-upload branch from d9f58ee to 5d7d1a3 Compare June 22, 2021 18:10
@andrewazores andrewazores merged commit f812545 into cryostatio:main Jun 22, 2021
@jan-law jan-law deleted the 494-remove-empty-ssl-file-upload branch June 23, 2021 14:53
andrewazores pushed a commit to andrewazores/cryostat that referenced this pull request Jun 24, 2021
* Delete empty file when handling exception

* Add unit test, apply formatting

* Handle case when file.delete() fails

* Prevent empty file creation

* Close outstream when finished writing

* Refactor file write, verify file not created

* Pass outputStreamFunction to constructor

* Apply spotless formatting

* Add integration test

* Move empty cert to test resources

* Rename test

* Remove unneeded assertion
aali309 pushed a commit to aali309/cryostat-legacy that referenced this pull request Jul 22, 2024
* fix(rules): rule archiving and re-activation bugfixes

* refactor

* blocking

* activate concurrently

* cancel job when target disappears

* fixup! cancel job when target disappears

* apply existing rules to newly appearing targets
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.

Uploading invalid SSL cert creates empty file in truststore
2 participants