summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2010-12-19 11:30:37 -0600
committerJesse Luehrs <doy@tozt.net>2010-12-19 11:30:37 -0600
commitb39ba35be27f03578af985c08f91dd13e6ee1e15 (patch)
tree255c5aed6100d1c5cce13e7ec09f3e1cce4c5577
parentbdd526b5188b58e766f850a91e305876680ac550 (diff)
downloadkiokudb-serializer-crypt-b39ba35be27f03578af985c08f91dd13e6ee1e15.tar.gz
kiokudb-serializer-crypt-b39ba35be27f03578af985c08f91dd13e6ee1e15.zip
allow crypt to be specified without crypt_key
-rw-r--r--lib/KiokuDB/Serializer/Crypt.pm9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/KiokuDB/Serializer/Crypt.pm b/lib/KiokuDB/Serializer/Crypt.pm
index 9b52e5a..0eadbd1 100644
--- a/lib/KiokuDB/Serializer/Crypt.pm
+++ b/lib/KiokuDB/Serializer/Crypt.pm
@@ -37,9 +37,12 @@ C<default_key> in L<Crypt::Util>.
=cut
has crypt_key => (
- is => 'ro',
- isa => 'Str',
- required => 1,
+ is => 'ro',
+ isa => 'Str',
+ default => sub {
+ confess "The 'crypt_key' attribute for " . blessed($self)
+ . " is required if the 'crypt' attribute is not given";
+ },
);
=attr crypt_cipher