Authen::Passphrase 0
Authen::Passphrase::BlowfishCrypt 0
+ Bytes::Random::Secure 0
Class::Method::Modifiers 0
Date::Parse 0
DBIx::Class 0
DBD::Pg 0
+ Digest::SHA 0
File::Slurp 0
IO::Prompter 0
Lingua::EN::Inflect 0
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-02-10 18:42:04
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:L/ExLdA0pkJ1DeM+RzlDjw
+use Bytes::Random::Secure qw/random_bytes/;
use Class::Method::Modifiers qw/after/;
+use Digest::SHA qw/hmac_sha1_base64/;
after qw/insert update delete/ => sub {
my ($self) = @_;
)->as_rfc2307});
}
+my $hmackey = $ENV{GRUNTMASTER_HMAC_KEY};
+
+sub make_reset_hmac {
+ my ($self, $expire) = @_;
+ $expire //= time + 60 * 60;
+ $hmackey //= random_bytes 512;
+ hmac_sha1_base64 $self->id . " $expire " . $self->passphrase, $hmackey;
+}
+
1;
__END__