SYNOPSIS

        use Net::LDAP::SimpleServer;
    
        # Or, specifying a Net::Server personality
        use Net::LDAP::SimpleServer 'PreFork';
    
        # using default configuration file
        my $server = Net::LDAP::SimpleServer->new();
    
        # passing a specific configuration file
        my $server = Net::LDAP::SimpleServer->new({
            conf_file => '/etc/ldapconfig.conf'
        });
    
        # passing configurations in a hash
        my $server = Net::LDAP::SimpleServer->new({
            port => 5000,
            data_file => '/path/to/data.ldif',
        });
    
        # make it spin
        $server->run();
    
        # make it spin with options
        $server->run({ allow_anon => 0 });

DESCRIPTION

    As the name suggests, this module aims to implement a simple LDAP
    server, using many components already available in CPAN. It can be used
    for prototyping and/or development purposes. This is NOT intended to be
    a production-grade server, although some brave souls in small offices
    might use it as such.

    As of April 2010, the server will load a LDIF file and serve its
    contents through the LDAP protocol. Many operations are NOT available
    yet, notably writing into the directory tree.

    The constructors will follow the rules defined by Net::Server, but the
    most useful are the two forms described below.

    Net::LDAP::SimpleServer will use the directory ${HOME}/.ldapsimple as a
    BASEDIR for server files. If there exists a file:

        BASEDIR/server.conf

    it will be used as the default configuration file. Similarly, if there
    exists a file:

        BASEDIR/server.ldif

    it will be used as the default data file for this server.

    Instantiates a server object. If the default configuration file is
    available, the options in it will be used.

    Instantiates a server object using the options specified in a hash
    reference.

    As specified in Net::Server, this method creates new options for the,
    server, namely:

    As specified in Net::Server, this method provides default values for a
    number of options.

    Notice that we do set a default password for the cn=root DN. This
    allows for out-of-the-box testing, but make sure you change the
    password when putting this to production use.

    Method specified by Net::Server to validate the parameters used in the
    server instance.

    Method specified by Net::Server to actually handle one connection. In
    this module it basically delegates the processing to
    Net::LDAP::SimpleServer::ProtocolHandler.

CONFIGURATION AND ENVIRONMENT

    Net::LDAP::SimpleServer may use a configuration file to specify the
    server settings. If no file is specified and options are not passed in
    a hash, this module will look for a default configuration file named
    BASEDIR/server.conf.

        data_file /path/to/a/ldif/file.ldif
        #port 389
        #root_dn cn=root
        #root_pw somepassword

TODO

    We plan to implement more options in Net::LDAP::SimpleServer. Some
    ideas are:

        #objectclass_req (true|false)
        #user_tree dc=some,dc=subtree,dc=com
        #user_id_attr uid
        #user_pw_attr password

    Keeping in mind we do NOT want to implement a full blown LDAP server.

POD ERRORS

    Hey! The above document had some coding errors, which are explained
    below:

    Around line 55:

      Unknown directive: =method

    Around line 60:

      Unknown directive: =method

    Around line 65:

      Unknown directive: =method

    Around line 70:

      Unknown directive: =method

    Around line 79:

      Unknown directive: =method

    Around line 84:

      Unknown directive: =method