Maypole::Plugin::AutoUntaint - CDBI::AutoUntaint for Maypole
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;
Installs the Class::DBI::Plugin::AutoUntaint::auto_untaint() method into the model class.
Class::DBI::Plugin::AutoUntaint::auto_untaint()
Takes the same arguments as Class::DBI::AutoUntaint::auto_untaint(), but untaint_columns and skip_columns must be further keyed by table:
Class::DBI::AutoUntaint::auto_untaint()
untaint_columns
skip_columns
untaint_columns => { $table => { printable => [ qw( name title ) ], date => [ qw( birthday ) ], }, ..., },
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
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.
Specifies the tables to untaint as an arrayref. Defaults to <$r-config->{display_tables}>>.
<$r-
The debug level of the Maypole application is passed on to Class::DBI::Plugin::AutoUntaint. If set to 1, this notes (via warn) each table processed.
warn
If the debug level is set to 2, it will report the untaint type used for each column.
If debug mode is turned off, this module switches on Class::DBI::Plugin::AutoUntaint's 'strict' mode.
Tests!
This module wraps Class::DBI::Plugin::AutoUntaint, which describes the arguments in more detail.
Maypole::Plugin::Untaint.
David Baird, <cpan@riverside-cms.co.uk>
<cpan@riverside-cms.co.uk>
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.
bug-maypole-plugin-autountaint@rt.cpan.org
Copyright 2005 David Baird, All Rights Reserved.
To install Maypole::Plugin::AutoUntaint, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Maypole::Plugin::AutoUntaint
CPAN shell
perl -MCPAN -e shell install Maypole::Plugin::AutoUntaint
For more information on module installation, please visit the detailed CPAN module installation guide.