-
-
04 Jul 2021 21:45:25 UTC
- Distribution: Apache-OneTimeURL
- Module version: 1.35
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues
- Testers (15 / 0 / 0)
- Kwalitee
Bus factor: 3- % Coverage
- License: perl_5
- Perl: v5.6.0
- Activity
24 month- Tools
- Download (11.11KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors-
Simon Cozens
NAME
Apache::OneTimeURL - One-time use URLs for sensitive data
SYNOPSIS
PerlModule Apache::OneTimeURL <Location /secret> PerlHandle Apache:OneTimeURL SetHandler perl-script PerlSetVar OneTimeDb /opt/secret/access.db PerlSetVar OneTimeDoc /opt/secret/realfile.html PerlSetVar OneTimeEmail intruder@simon-cozens.org </Location>
authorize.pl:
#!/usr/bin/perl use Apache::OneTimeURL; my $comments = join " ", @ARGV; my $db = "/opt/secret/access.db"; print "http://www.my.server.int/secret/", Apache::OneTimeURL->authorize($db, $comments), "\n";
Now:
% authorize.pl Given to Simon C on IRC http://www.my.server.int/secret/2c61de78edd612cf79c0d73a3c7c94fb
This URL will only be viewable once, and will then return an error. For the first five times that the URL is accessed in error, a mail will be sent to the email address given in the config. The number of times can be configured with the
OneTimeMailCount
variable; if you don't want any mail, set this to minus one.DESCRIPTION
The synopsis pretty much wraps it up. I'm paranoid about giving out certain information, and although I can't really control what people do with the HTML when they download it, I can damned well ensure that URLs in mail I send don't end up on the web and being a liability. Hence the desire for a URL that's only valid once. You may have your own interesting uses for such a set-up.
I've hopefully designed the module so that if there's some aspect of its behaviour you don't like, you can switch to the "method handler" style (ie.
PerlHandler Apache::OneTime::URL->handler
and subclass to override the bits you're unhappy about. This may be easier than convincing me to make changes to the module.THANKS
Peter Sergeant offered several useful ideas which contributed to the 1.1 and 1.2. releases of this module.
REPOSITORY
https://github.com/cpan-janitor/Apache-OneTimeURL
AUTHOR
Simon Cozens,
simon@kasei.com
COPYRIGHT AND LICENSE
Copyright 2003 Simon Cozens.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install Apache::OneTimeURL, copy and paste the appropriate command in to your terminal.
cpanm Apache::OneTimeURL
perl -MCPAN -e shell install Apache::OneTimeURL
For more information on module installation, please visit the detailed CPAN module installation guide.