-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Issue with Handling Negative Values in Certain Fields of Brute Force Detection #40538
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.cluster.ClientScopeInvalidationClusterTest#crudWithFailover
org.keycloak.testsuite.cluster.RealmInvalidationClusterTest#crudWithFailover
org.keycloak.testsuite.cluster.SessionFailoverClusterTest#sessionFailover
|
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.
@douglaspalmer I think that it would better to check this when moving from rep to model in the DefaultExportImportManager
. And I always prefer to return an error than doing nothing. WDYT?
And try with this commit rmartinc@2204992 in the UI part. It's not perfect but much better.
model/jpa/src/main/java/org/keycloak/models/jpa/RealmAdapter.java
Outdated
Show resolved
Hide resolved
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.
Don't you like the changes in the UI rmartinc@2204992 ?
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.cluster.GroupInvalidationClusterTest#crudWithFailover
|
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.
@douglaspalmer For me it's OK. But maybe adding a method to all the calls would more readable:
public static int checkNonNegativeNumber(int value, String name) {
if(value < 0) {
throw new ModelException(name + " may not be a negative value");
}
return value;
}
And just call it something line:
if (rep.getMaxTemporaryLockouts() != null) {
newRealm.setMaxTemporaryLockouts(checkNonNegativeNumber(rep.getMaxTemporaryLockouts(), "Maximum temporary lockouts"));
}
Besides this way we execute the CI again to remove the failure. But the idea is OK, it's just an improvement.
b6262df
to
b94c968
Compare
…Detection Closes keycloak#40353 Signed-off-by: Douglas Palmer <dpalmer@redhat.com>
…Detection Closes keycloak#40353 Signed-off-by: rmartinc <rmartinc@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.
Thanks @douglaspalmer! LGTM!
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.
Approved the UI part.
Closes #40353