Preferences/Schema.pm

filter: Statementstmt 77.7% 7 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 83.3% 10 / 12 CC 1 SCAR 0.9
CC
1
Cov
78%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Preferences/Schema/Result/PrfOwner.pm ↑ Summary Preferences.pm »
1  
2 package OpusVL::Preferences::Schema;
3  
4  
5 4 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 4 ▶use OpusVL::SimpleCrypto;
Subroutine BEGIN: called CC=1 SCAR=2.6
8  
9 extends 'DBIx::Class::Schema';
10  
11 has encryption_key => (is => 'rw', isa => 'Str');
12 has encryption_salt => (is => 'rw', isa => 'Str');
13 has encryption_client => (is => 'ro', lazy => 1, builder => '_build_encryption_client');
14  
15 sub _build_encryption_client
16 {
17 my $self = shift;
18 return undef unless $self->encryption_salt && $self->encryption_key;
19 my $crypto = OpusVL::SimpleCrypto->new({
20 key_string => $self->encryption_key,
21 deterministic_salt_string => $self->encryption_salt,
22 });
23 return $crypto;
24 }
25  
26  
27 __PACKAGE__->load_namespaces;
28  
29 __PACKAGE__->meta->make_immutable(inline_constructor => 0);
30  
31 1;
32  
33 __END__
34  
35 =pod
36  
37 =encoding UTF-8
38  
39 =head1 NAME
40  
41 OpusVL::Preferences::Schema
42  
43 =head1 VERSION
44  
45 version 0.24
46  
47 =head1 SYNOPSIS
48  
49 This is the DBIx::Class schema for the Preferences module.
50  
51 =head1 ATTRIBUTES
52  
53 =head2 encryption_key
54  
55 An Encryption key to use for symmetric cryptography of selected fields.
56  
57 This will be used in the L<OpusVL::SimpleCrypto> module, see that for
58 how to generate keys.
59  
60 =head2 encryption_salt
61  
62 A salt to use for symmetric cryptography of selected fields.
63  
64 This will be used in the L<OpusVL::SimpleCrypto> module, see that for
65 how to generate keys and salt.
66  
67 =head2 encryption_client
68  
69 The client to perform encryption. If the key or salt are not provided
70 this will return undef.
71  
72 =head1 AUTHOR
73  
74 OpusVL - www.opusvl.com
75  
76 =head1 COPYRIGHT AND LICENSE
77  
78 This software is copyright (c) 2011 by OpusVL - www.opusvl.com.
79  
80 This is free software; you can redistribute it and/or modify it under
81 the same terms as the Perl 5 programming language system itself.
82  
83 =cut
« Preferences/Schema/Result/PrfOwner.pm ↑ Summary Preferences.pm »