Dezi

 view release on metacpan or  search on metacpan

lib/Dezi/Config.pm  view on Meta::CPAN

sub BUILDARGS {
    my $class = shift;
    my %args;
    if ( @_ == 1 and ref( $_[0] ) eq 'HASH' ) {
        %args = %{ $_[0] };
    }
    else {
        %args = @_;
    }

    # save credentials in a closure but not plain in args
    my $username      = delete $args{username};
    my $password      = delete $args{password};
    my $authenticator = ( defined $username and defined $password )
        ? sub {
        my ( $u, $p ) = @_;
        return $u eq $username && $p eq $password;
        }
        : undef;
    $args{authenticator} ||= $authenticator;

lib/Dezi/Config.pm  view on Meta::CPAN

    admin_class     => 'Dezi::Admin',
    # or
    # admin           => Dezi::Admin->new(),
    
    base_uri        => '',
    server_class    => 'Dezi::Server',
    
    # authentication for non-idempotent requests.
    # if both username && password are defined,
    # then /index, /commit and /rollback require
    # basic authentication credentials.
    username        => 'someone',
    password        => 'somesecret',
    
    # optional
    # see Dezi::Stats
    stats_logger => Dezi::Stats->new(
        type        => 'DBI',
        dsn         => 'DBI::mysql:database=mydb;host=localhost;port=3306',
        username    => 'myuser',
        password    => 'mysecret',



( run in 0.228 second using v1.01-cache-2.11-cpan-4d50c553e7e )