adonisjs / validator

Schema based validator for AdonisJS
MIT License
116 stars 39 forks source link

Options for Email is set but not used #154

Closed Barbapapazes closed 2 years ago

Barbapapazes commented 2 years ago

Hello,

We are speaking about the email rules.

You say that we can use any options available in validator.js but in the code, options returned are filtered.

return {
    compiledOptions: {
        domain_specific_validation: options.domainSpecificValidation,
        allow_ip_domain: options.allowIpDomain,
        ignore_max_length: options.ignoreMaxLength,
        sanitize: sanitizationOptions,
    },
 };

So it's impossible to use an option list host_blacklist !

And here is the type

/**
 * Options to validate email
 */
export type EmailValidationOptions = {
    allowDisplayName?: boolean;
    requireDisplayName?: boolean;
    allowUtf8LocalPart?: boolean;
    requireTld?: boolean;
    ignoreMaxLength?: boolean;
    allowIpDomain?: boolean;
    domainSpecificValidation?: boolean;
    hostBlacklist?: string[];
};
Barbapapazes commented 1 year ago

Hello @thetutlage,

I'm sorry to only view this now but you didn't added hostBlacklist. Is that wanted?