Add NewRule constructor to secret package#714
Conversation
Rule has unexported fields so external packages cannot construct one directly. NewRule provides the standard Go constructor pattern, allowing callers outside this package to build custom Requirements and Rejects rules for PasswordValidator. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
there's another way to go here if we prefer, and it's to add a built-in rule that does the character whitelist we have which is |
Hi @zzzeek sorry for being late here. The original idea was to have a set of common rules that might have been applied to all the operators. If this pattern applies to all services, I'm good w/ a generic/static rule. Based on the above (and your tests) we can land this one or add the pattern to the built-in rule. |
we're looking to move this code to use lib-common:
https://github.com/openstack-k8s-operators/mariadb-operator/blob/66665ea51eed2025f566351a2aabd82b2f049fac/internal/controller/mariadbaccount_controller.go#L761-L785
however we need to be able to create a rule with that character whitelist.