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

To address the DOS issues identified in SonarCloud #3333

Draft
wants to merge 11 commits into
base: develop
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* admin role. If not it uses a predicate to determine if the user can access a resource.
*/
@SuppressFBWarnings(value = "SE_BAD_FIELD", justification = "Gets serialised by the JSC cache")
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, property = "class")
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "class")
public class AccessPredicate implements BiPredicate<User, String>, Serializable {

private final Predicate<User> userPredicate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* Utility methods for Schema Properties.
*/
public final class PropertiesUtil {
private static final Pattern PROPERTY_ALLOWED_CHARACTERS = Pattern.compile("[a-zA-Z0-9|-]*");
private static final Pattern PROPERTY_ALLOWED_CHARACTERS = Pattern.compile("[a-zA-Z0-9|-]*+");

private PropertiesUtil() {
// Private constructor to prevent instantiation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class PropertiesUtilTest {
void shouldThrowExceptionWithInvalidStringName() {
assertThatIllegalArgumentException()
.isThrownBy(() -> PropertiesUtil.validateName(INVALID_STRING))
.withMessage("Property is invalid: inv@l1dStr|ng&^, it must match regex: [a-zA-Z0-9|-]*");
.withMessage("Property is invalid: inv@l1dStr|ng&^, it must match regex: [a-zA-Z0-9|-]*+");
}

@Test
Expand Down
Loading