GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Zonemaster::Backend::Validator(3) User Contributed Perl Documentation Zonemaster::Backend::Validator(3)

This module contains a set of procedures for validating data types. The "check_*" procedures take the value to validate and potential extra arguments and return either undef if the validation succeeded or the reason of the failure.

    use Zonemaster::Backend::Validator qw( :format );
    # prints "invalid value: The domain name character(s) are not supported"
    if ( defined ( my $error = check_domain( 'not a domain' ) ) ) {
        print "invalid value: $error\n";
    } else {
        print "value is valid\n";
    }
    # prints "value is valid"
    if ( defined ( my $error = check_domain( 'zonemaster.net' ) ) ) {
        print "invalid value: $error\n";
    } else {
        print "value is valid\n";
    }

Returns a hashref to be used with the "format" method in JSON::Validator. The keys are the names of the custom formats, supports: "domain", "language_tag", "ip" and "profile".

The method takes a Config object as argument.

Validates a domain name <https://github.com/zonemaster/zonemaster/blob/master/docs/public/using/backend/rpcapi-reference.md#domain-name>.

Validates a <https://github.com/zonemaster/zonemaster/blob/master/docs/public/using/backend/rpcapi-reference.md#language-tag>.

%locales
A hash of configured locales, as returned by Zonemaster::Backend::Config::LANGUAGE_locale.

Validates an IP address <https://github.com/zonemaster/zonemaster/blob/master/docs/public/using/backend/rpcapi-reference.md#ip-address>.

Validates a profile name <https://github.com/zonemaster/zonemaster/blob/master/docs/public/using/backend/rpcapi-reference.md#profile-name>.

%profiles
A hash of configured profiles, as returned by Zonemaster::Backend::Config::PUBLIC_PROFILES.

This module contains a set of procedures for validating and untainting strings.

    use Zonemaster::Backend::Validator qw( :untaint );
    # prints "untainted: sqlite"
    if ( defined ( my $value = untaint_engine_type( 'sqlite' ) ) ) {
        print "untainted: $value\n";
    }
    # does not print anything
    if ( defined ( my $value = untaint_engine_type( 'Excel' ) ) ) {
        print "untainted: $value\n";
    }

These procedures all take a possibly tainted single string argument. If the string is accepted an untainted copy of the string is returned.

Accepts the strings "MySQL", "PostgreSQL" and "SQLite", case-insensitively.

Accepts an IPv4 or IPv6 address.

Accepts an IPv4 address.

Accepts an IPv6 address.

Accepts an LDH domain name or an IPv4 or IPv6 address.

Accepts an LDH domain name.

Accepts a locale tag.

2024-12-04 perl v5.40.2

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.