Apache2-POST200

 view release on metacpan or  search on metacpan

lib/Apache2/POST200.pm  view on Meta::CPAN

package Apache2::POST200;

use 5.008;
use strict;
use warnings;
no warnings qw(uninitialized);

use Apache2::RequestRec;
use Apache2::RequestUtil;
use Apache2::RequestIO;
use Apache2::ServerUtil;
use Apache2::Connection;
use Apache2::CmdParms;
use Apache2::Module;
use Apache2::Filter;
use APR::Brigade;
use APR::Bucket;
use APR::Table;
use Apache2::Const -compile=>qw{OK DECLINED
				TAKE1 TAKE12 TAKE123 TAKE3 FLAG OR_ALL
				M_POST M_GET
				HTTP_OK REDIRECT NOT_FOUND};

use MIME::Base64 ();
use Crypt::CBC ();
use Crypt::Blowfish ();
use Digest::MD5 ();
use Digest::CRC ();
use DBI;

our $VERSION = '0.05';
my $rcounter=0;

# these 2 values were once read from /dev/random on my box
my $default_key=("tFS\343x\314\357uh\212W\177+#\332\0q\317S\231\321\316\270H".
		 "\252\205\313\264\357LT\16h\362\36\354cK\317\362\e\253`[8".
		 "\211\365\347\217:\f1\224\321L*");
my $default_iv="P\363\32\310\24\340\265\373";

my $msg302=<<'EOF';
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="%{location}">here</a>.</p>
</body></html>
EOF

my @directives=
  (
   {
    name         => 'Post200Storage',
    func         => __PACKAGE__ . '::config123',
    req_override => Apache2::Const::OR_ALL,
    args_how     => Apache2::Const::TAKE123,
    errmsg       => 'Post200Storage DBI-DSN [USER] [PASSWORD]',
    cmd_data     => 'storage',
   },
   {
    name         => 'Post200Table',
    func         => __PACKAGE__ . '::config123',
    req_override => Apache2::Const::OR_ALL,
    args_how     => Apache2::Const::TAKE3,
    errmsg       => 'Post200Table TABLENAME KEY-COLUMN VALUE-COLUMN',
    cmd_data     => 'table',
   },
   {
    name         => 'Post200Label',
    func         => __PACKAGE__ . '::config123',
    req_override => Apache2::Const::OR_ALL,
    args_how     => Apache2::Const::TAKE1,
    errmsg       => 'Post200Label marker (default: "-redirect-")',
    cmd_data     => 'location',
   },
   {
    name         => 'Post200Secret',
    func         => __PACKAGE__ . '::config123',
    req_override => Apache2::Const::OR_ALL,
    args_how     => Apache2::Const::TAKE12,
    errmsg       => 'Post200Secret SECRET [INITVECTOR]',
    cmd_data     => 'secret',
   },
   {
    name         => 'Post200IpCheck',
    func         => __PACKAGE__ . '::config123',
    req_override => Apache2::Const::OR_ALL,
    args_how     => Apache2::Const::FLAG,
    errmsg       => 'Post200IpCheck On|Off (default: On)',
    cmd_data     => 'checkip',
   },
   {
    name         => 'Post200DataBlockSize',
    func         => __PACKAGE__ . '::config123',
    req_override => Apache2::Const::OR_ALL,
    args_how     => Apache2::Const::TAKE1,
    errmsg       => 'Post200DataBlockSize bytes',
    cmd_data     => 'blocksize',



( run in 1.168 second using v1.01-cache-2.11-cpan-d8267643d1d )