Sounds a little vague.. Can you describe your problem a little more? What are you protecting? Sensitive information? Subsctiption content?
Why are you so worried about calls to runmodes?
Your cgiapp should be expecting to get bogus data.
In fact you should code a cgiapp as if 99.99% is going to be bogus and malicious data.
Use CGI::Application::Plugin::Session, if youdon't already. You can use that to check a level of authentication you have put on someone, perhaps.
With my cgiapps that are interfaces to sensitive material, i check and recheck every single tiny little call to the server. I assume at ALL states of my application, in ALL runmodes, that I am getting bad data, bogus data, malicious data, etc.
You can have things like..
# uses CGI::Application::Plugin::Forward and Authen.. etc
# you must know these by now..
sub break_a_leg : Runmode {
my $self = shift;
$self->__check or return $self->forward('error');
# ... do whatever...
}
sub __check {
my $self = shift;
$self->authen or die('no way.');
$self->_my_sub_check_user_input() or return 0;
return 1;
}
And you can call check in every runmode.
Furthermore, you are aware that with CGI::Application::Plugin::Authentication, you can block ALL runmodes NOT matching whatever.. such as..
#more incomplete code..
sub _authen_config {
my $self = shift;
# authenticate
$self->authen->config(
DRIVER => [
'Generic',
sub {
return $self->_verify_credentials(@_);
},
],
LOGIN_SESSION_TIMEOUT => '45m',
# TODO change to 35m for release
CREDENTIALS =>
['authen_username','authen_password','authen_captcha'],
STORE => 'Session',
LOGIN_RUNMODE => 'login',
);
$self->authen->protected_runmodes(qr/^(?!login)/);
return 1;
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.