NAME

Maypole::Plugin::AutoUntaint - CDBI::AutoUntaint for Maypole

SYNOPSIS

package BeerDB;
use Maypole::Application qw( AutoUntaint );

# instead of this
#BeerDB::Brewery->untaint_columns( printable => [qw/name notes url/] );
#BeerDB::Style->  untaint_columns( printable => [qw/name notes/] );
#BeerDB::Pub->    untaint_columns( printable => {qw/name notes url/] );
#BeerDB::Beer->   untaint_columns( printable => [qw/abv name price notes/],
#                                 integer    => [qw/style brewery score/],
#                                 date       => [ qw/date/],
#                                 );   

# say this
BeerDB->auto_untaint;
setup

If the -Setup flag is passed in the call to Maypole::Application, auto_untaint will be called automatically, with no arguments.

auto_untaint( %args )

Takes the same arguments as Class::DBI::AutoUntaint::auto_untaint(), but untaint_columns and skip_columns must be further keyed by table:

untaint_columns
untaint_columns => { $table => { printable => [ qw( name title ) ],
                                 date => [ qw( birthday ) ],
                                 },
                     ...,
                     },
                     
skip_columns
skip_columns => { $table => [ qw( secret_stuff internal_data )  ],
                  ...,
                  },
                  

Accepts two additional arguments. match_cols_by_table is the same as the match_cols argument, but only applies to specific tables:

match_cols_by_table
match_cols_by_table => { $table => { qr(^(first|last)_name$) => 'printable',
                                     qr(^.+_event$)          => 'date',
                                     qr(^count_.+$)          => 'integer',
                                     },
                         ...,
                         },
                         

Column regexes here take precedence over any in <match_cols> that are the same.

untaint_tables

Specifies the tables to untaint as an arrayref. Defaults to <$r-config->{display_tables}>>.

debug

If the debug level in the Maypole application is set to 1, this module will report (via warn) each table it processes.

If the debug level is set to 2, it will report the untaint type used for each column.

TODO

Tests!

SEE ALSO

This module wraps Class::DBI::Plugin::AutoUntaint, which describes the arguments in more detail.

Maypole::Plugin::Untaint.

AUTHOR

David Baird, <cpan@riverside-cms.co.uk>

BUGS

Please report any bugs or feature requests to bug-maypole-plugin-autountaint@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Maypole-Plugin-AutoUntaint. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

COPYRIGHT & LICENSE

Copyright 2005 David Baird, All Rights Reserved.