-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add a reload period for https material #32715
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
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.
Unreported flaky test detected, please review
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.webauthn.WebAuthnRegisterAndLoginTest#registerUserSuccessKeycloak CI - WebAuthn IT (chrome) org.keycloak.testsuite.saml.ArtifactBindingWithResolutionServiceTest#testReceiveArtifactLoginFullWithPostorg.keycloak.testsuite.forms.BrowserButtonsTest#clickRefreshButtonOnRegisterPageKeycloak CI - Forms IT (chrome) org.keycloak.testsuite.forms.LevelOfAssuranceFlowTest#testWithOTPAndRecoveryCodesAtLevel2Keycloak CI - Forms IT (chrome) org.keycloak.testsuite.forms.RegisterTest#registerUserNotContainsUsernamePasswordPolicyKeycloak CI - Forms IT (chrome) org.keycloak.testsuite.forms.ResetPasswordTest#resetPasswordWrongEmailKeycloak CI - Forms IT (chrome) org.keycloak.testsuite.forms.ResetPasswordTest#resetPasswordDisabledUserKeycloak CI - Forms IT (chrome) org.keycloak.testsuite.forms.ResetPasswordTest#resetPasswordMissingUsernameKeycloak CI - Forms IT (chrome) org.keycloak.testsuite.forms.ResetPasswordTest#resetPasswordTwiceKeycloak CI - Forms IT (chrome) org.keycloak.testsuite.forms.ResetPasswordTest#resetPasswordExpiredCodeAndAuthSessionKeycloak CI - Forms IT (chrome) |
|
@shawkins nice work! Haven't had a chance to look at it closer, but I'd vote to separate the PM improvements into a different PR. |
vmuzikar
left a comment
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 would be good to get to 26, however I'd postone the PM changes until after the release.
To avoid adding yet another option I can either keep the convention of mapping -1 to another value, which would need to be something effectively infinite yet still supported by quarkus / vertx - or just get rid of the -1 convention and let users always set their perferred period. Which do you prefer? |
I'd maybe rather consider getting rid off the 1h default, that would also align it with Quarkus. WDYT? |
|
I was the one who first suggested to have an automatic reload in the parent issue. If that is more difficult to maintain / not well-aligned with Quarkus, I'm ok to drop it. Dropping it would require users to actively configure it what I wanted to avoid. |
|
After looking at the old logic again, this preserves the single property approach and that uses -1 to map to no reload. If this seems too risky, then I vote that we drop the default of 1h. |
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.
Unreported flaky test detected, please review
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.webauthn.registration.passwordless.PwdLessPubKeySignRegTest#publicKeySignaturesRSAKeycloak CI - WebAuthn IT (chrome) |
ahus1
left a comment
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.
Thank you for this change, looks good to me.
mabartos
left a comment
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.
@shawkins Thanks for the PR! One thing in a review comment.
- IMO some comprehensive tests are not needed - we can rely on Quarkus
- (optional) As the option accepts String, it'd be good to verify invalid input - at least if the Quarkus ex is properly propagated?
- Perhaps good thing would be mention it in Configuring TLS guide. Provide more context and the benefits of it.
@shawkins WDYT?
| .defaultValue("1h") | ||
| .build(); | ||
|
|
||
| public static final Option<String> HTTPS_CERTIFICATES_RELOAD_PERIOD_INTERNAL = new OptionBuilder<>("https-certificates-reload-period-internal", String.class) |
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.
@shawkins I think it's not necessary to have it here, right?
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.
It is not - I was temporarly going to try another approach that didn't touch the property mappers, but abandoned that.
vmuzikar
left a comment
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.
See the PR description, this creates a container that does not get successfully shutdown. I can look into that more if desired.
Will do. |
@shawkins To clarify things: so, I assume it's related only to the tests? Otherwise, it's a bigger issue. But as I see the option description, these 30s are also mentioned, so? Wondering whether we should be more defensive and provide some validator at least for the 30s?
I thought more about what will happen in the case when some arbitrary String is provided - like |
The failing test I tried was for a value less than 30s, I'll retest from the cli. I'd opt for a follow-on issue to address this though.
Ideally that should not be necessary. Other than getting a little earlier feedback we shouldn't be adding much value with validation on our side - also quarkus durations support a non-standard format, so we'd need to account for that as well.
There will be a quarkus level exception resolving the value to a duration: At least from the cli that terminated correctly. |
Unfortunately after emitting: The cli hangs. Control c from the terminal window doesn't work, but issuing a kill does. I'll see if this is reproducible with just quarkus and open an upstream issue. So it will be clear to the user what is wrong, but the usability is terrible. How does everyone want to proceed with that? |
closes: keycloak#23771 Signed-off-by: Steve Hawkins <[email protected]>
@shawkins Yep, as I said, I'd vote to have an additional validator for the Duration (IMO, it should be enough as it's the accept value for the property). Just mimic the Quarkus exception to have it in front of Quarkus until the time the issue is fixed on their side. I don't want to block this PR due to that. After fixing the stuff on their side, we can remove the validator. WDYT? NOTE: Maybe as the recorder is invoked on the IO thread, the exception is not properly propagated or handled? |
My preferred options:
|
As long as we properly fail and exit on other invalid values (0, negative etc.), this works for me too. Otherwise I'd vote for to keep it simple on our side:
|
I would not do it. In that case, we'd just lose the nice config ability to set Duration, or just
Ok, if the usability issue is related only to the corner case, works for me. But, I would not hesitate to more emphasize the restriction (more than 30s) in the docs - until the issue is properly solved. |
|
Logged quarkusio/quarkus#43247 for the short reload hanging. Sounds like the concensus is not to do additional validation.
It does mention that restriction in the option description and in the docs. Are you wanting it to call out the quarkus bug specifically? |
mabartos
left a comment
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.
@shawkins I see the bug is fixed on the Quarkus side and be backported, so the current approach looks good to me! Not necessary emphasize the restriction more.
LGTM, thanks!
closes: keycloak#23771 Signed-off-by: Steve Hawkins <[email protected]>
closes: #23771
This is split into two commits. The first is a light refactoring of the propertymapper logic (cc @pedroigor @vmuzikar @mabartos) - this can be separated to another pr if needed. The major thing that the feature commit depends upon is the ability for a transformer to be able to unset a value - if we don't do this, the next best thing we can do is to map the disabling value (-1) to an effectively infinite interval.
Testing of this new option is cumbersome - when trying a failing test with a value less than 30s, the result is a "hung" vm that will fail to shutdown as expected. A succeeding test will need to wait a minimum of 30 seconds and do some file manipulations that aren't currently straight-forward with the distribution tests.
This will probably need to be rebased given some logging mapping changes just went in, I'll do that after some initial feedback.