--
You received this message because you are subscribed to the Google Groups "Keycloak Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to keycloak-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/keycloak-dev/AM0PR10MB19234C0E872F1ABBD94CFD6FED009%40AM0PR10MB1923.EURPRD10.PROD.OUTLOOK.COM.
Hi,
makes sense to me to allow message change, mainly for highly configurable validators like pattern.
I personally prefer to configure it directly over the validator's config in the user profile config file rather than over explicit i18n key lookup, as this is more consistent with the rest of the user profile configuration format, and also less work as it requires only impl in the validator itself, not in bindings to GUIs where i18n happens ;-)
Looking into Validator SPI and how is it integrated into user
profile and distinct GUIs, support for ${} construct may be
relatively complex as we have to support putting parameters into
the message itself (eg min and max for length validator), I'm not
sure whether this construct can even support that internal
replacing in the message itself.
And BTW some validators produce more error messages, so what we agree here will be more like "rule how to implement configurable messages for simple validators" and it needs to be implemented and documented on the per validator basis (ideally some support implemented in some basic class like org.keycloak.validate.AbstractSimpleValidator).
So IMHO best solution is configuration like:
"validations": {
"pattern": {
"pattern": "[0-9]+",
"message": "error.userprofile.format.zipcode"
}
}
Where error.userprofile.format.zipcode is message key for i18n.
Vl.
-- Vlastimil Elias He / Him / His Principal Software Engineer, DXP Application Development Red Hat
Hi,
makes sense to me to allow message change, mainly for highly configurable validators like pattern.
I personally prefer to configure it directly over the validator's config in the user profile config file rather than over explicit i18n key lookup, as this is more consistent with the rest of the user profile configuration format, and also less work as it requires only impl in the validator itself, not in bindings to GUIs where i18n happens ;-)
Looking into Validator SPI and how is it integrated into user profile and distinct GUIs, support for ${} construct may be relatively complex as we have to support putting parameters into the message itself (eg min and max for length validator), I'm not sure whether this construct can even support that internal replacing in the message itself.
And BTW some validators produce more error messages, so what we agree here will be more like "rule how to implement configurable messages for simple validators" and it needs to be implemented and documented on the per validator basis (ideally some support implemented in some basic class like org.keycloak.validate.AbstractSimpleValidator).