Migrate SSL Labs integration from API v3 to v4#6448
Conversation
Co-authored-by: valfirst <5081226+valfirst@users.noreply.github.com>
Co-authored-by: valfirst <5081226+valfirst@users.noreply.github.com>
Co-authored-by: valfirst <5081226+valfirst@users.noreply.github.com>
Co-authored-by: valfirst <5081226+valfirst@users.noreply.github.com>
Qodana for JVM3 new problems were found
💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at qodana-support@jetbrains.com
|
| <constructor-arg index="2" value="${ssl-labs.api-endpoint}"/> | ||
| <constructor-arg index="3" value="${ssl-labs.email}"/> | ||
| </bean> | ||
|
|
Check warning
Code scanning / QDJVM
Unresolved placeholders configured in the Spring XML application context Warning
| HttpResponse response = httpClient.doHttpGet(URI.create( | ||
| HttpGet httpGet = new HttpGet(URI.create( | ||
| String.format("%s%s%s", sslLabHost, API_VERSION, String.format(ANALYZE_CALL, host)))); | ||
| httpGet.addHeader("email", email); |
Check notice
Code scanning / QDJVM
Unknown HTTP header Note
| this.jsonUtils = jsonUtils; | ||
| this.sslLabHost = sslLabHost; | ||
| this.email = Validate.notBlank(email, | ||
| "SSL Labs API v4 requires a registered email address. Please set the 'ssl-labs.email' property."); |
There was a problem hiding this comment.
| "SSL Labs API v4 requires a registered email address. Please set the 'ssl-labs.email' property."); | |
| "SSL Labs API v4 requires a registered email address"); |
| duration.when(() -> Duration.ofMinutes(10)).thenReturn(Duration.ZERO); | ||
| duration.when(() -> Duration.ofSeconds(30)).thenReturn(Duration.ZERO); |
There was a problem hiding this comment.
No, since WAITER is a static final field already initialized by the time this test runs. Removed them in 27a6641.
…ary mocks, update docs formatting Co-authored-by: valfirst <5081226+valfirst@users.noreply.github.com>
Updated in 27a6641 — switched to the bold mandatory property pattern with |
| this.jsonUtils = jsonUtils; | ||
| this.sslLabHost = sslLabHost; | ||
| this.email = Validate.notBlank(email, | ||
| "SSL Labs API v4 requires a registered email address"); |
There was a problem hiding this comment.
Removed the validation, the Validate import, and the corresponding test in 4626255.
Co-authored-by: valfirst <5081226+valfirst@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6448 +/- ##
==========================================
Coverage 97.77% 97.77%
- Complexity 7397 7630 +233
==========================================
Files 1014 1014
Lines 21405 21408 +3
Branches 1403 1403
==========================================
+ Hits 20928 20931 +3
Misses 361 361
Partials 116 116 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|



SslLabsClient.java: Change API version fromv3tov4, addemailconstructor parameter, sendemailas HTTP header in analyze requests usingHttpGet+httpClient.execute()spring.xml: Add email property (ssl-labs.email) as constructor argument (index 3) forsslLabsClientbeandefault.properties: Add newssl-labs.emailproperty (empty by default, user must configure)SslLabsClientTests.java: Update tests to pass email parameter, mockhttpClient.execute(ClassicHttpRequest)plugin-web-app-to-rest-api.adoc): Addssl-labs.emailproperty to docs table with bold mandatory pattern💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.