presto-plugin-toolkit/src/main/java/io/prestosql/plugin/base/security/PrincipalUserMatchRule.java/PrincipalUserMatchRule/PrincipalUserMatchRule
class PrincipalUserMatchRule:    @JsonCreator
    public PrincipalUserMatchRule(
            @JsonProperty("principal") Pattern principalRegex,
            @JsonProperty("user") Optional<Pattern> userRegex,
            @JsonProperty("principal_to_user") Optional<String> principalToUserSubstitution,
            @JsonProperty("allow") boolean allow)
    {
        this.principalRegex = requireNonNull(principalRegex, "principalRegex is null");
        this.userRegex = requireNonNull(userRegex, "userRegex is null");
        this.principalToUserSubstitution = requireNonNull(principalToUserSubstitution, "principalToUserSubstitution is null");
        checkState(
                userRegex.isPresent() || principalToUserSubstitution.isPresent(),
                "A valid principal rule must provide at least one criterion of user and user_extraction");
        this.allow = allow;
    }