File Coverage

blib/lib/BLAH/Enforces/Authentication.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             #
2             # This file is part of BLAH
3             #
4             # This software is Copyright (c) 2015 by Chris Weyl.
5             #
6             # This is free software, licensed under:
7             #
8             # The GNU Lesser General Public License, Version 2.1, February 1999
9             #
10             package BLAH::Enforces::Authentication;
11             our $AUTHORITY = 'cpan:RSRCHBOY';
12             $BLAH::Enforces::Authentication::VERSION = '0.001'; # TRIAL
13             # ABSTRACT: BLAH role for enforced authentication
14              
15 1     1   467232 use Moose::Role;
  1         213287  
  1         6  
16 1     1   7539 use namespace::autoclean 0.24;
  1         9990  
  1         7  
17              
18             with 'BLAH::Role::Authentication';
19              
20              
21             before execute => sub {
22             my $self = shift @_;
23              
24             confess 'Attempt to execute without authentication!'
25             unless $self->authenticated;
26              
27             return;
28             };
29              
30             !!42;
31              
32             __END__
33              
34             =pod
35              
36             =encoding UTF-8
37              
38             =for :stopwords Chris Weyl
39              
40             =for :stopwords Wishlist flattr flattr'ed gittip gittip'ed
41              
42             =head1 NAME
43              
44             BLAH::Enforces::Authentication - BLAH role for enforced authentication
45              
46             =head1 VERSION
47              
48             This document describes version 0.001 of BLAH::Enforces::Authentication - released August 26, 2015 as part of BLAH.
49              
50             =head1 DESCRIPTION
51              
52             A L<BLAH> role for enforcing authentication -- that is, our C<authenticated()>
53             method returns true.
54              
55             =head1 METHODS
56              
57             =head2 execute
58              
59             We wrap the C<execute()> method to invoke C<< $self->authenticated() >> first, in
60             order to determine if our invocation is considered authenticated by the BLAH.
61              
62             If C<authenticated()> returns true, we go on our merry way; if false then we
63             C<confess> our sins.
64              
65             =head1 SEE ALSO
66              
67             Please see those modules/websites for more information related to this module.
68              
69             =over 4
70              
71             =item *
72              
73             L<BLAH|BLAH>
74              
75             =item *
76              
77             L<BLAH|BLAH>
78              
79             =item *
80              
81             L<BLAH::Role::Authentication|BLAH::Role::Authentication>
82              
83             =back
84              
85             =head1 BUGS
86              
87             Please report any bugs or feature requests on the bugtracker website
88             https://github.com/RsrchBoy/blah/issues
89              
90             When submitting a bug or request, please include a test-file or a
91             patch to an existing test-file that illustrates the bug or desired
92             feature.
93              
94             =head1 AUTHOR
95              
96             Chris Weyl <cweyl@alumni.drew.edu>
97              
98             =head2 I'm a material boy in a material world
99              
100             =begin html
101              
102             <a href="https://gratipay.com/RsrchBoy/"><img src="http://img.shields.io/gratipay/RsrchBoy.svg" /></a>
103             <a href="http://bit.ly/rsrchboys-wishlist"><img src="http://wps.io/wp-content/uploads/2014/05/amazon_wishlist.resized.png" /></a>
104             <a href="https://flattr.com/submit/auto?user_id=RsrchBoy&url=https%3A%2F%2Fgithub.com%2FRsrchBoy%2Fblah&title=RsrchBoy's%20CPAN%20BLAH&tags=%22RsrchBoy's%20BLAH%20in%20the%20CPAN%22"><img src="http://api.flattr.com/button/flattr-badge-large.png" /></a>
105              
106             =end html
107              
108             Please note B<I do not expect to be gittip'ed or flattr'ed for this work>,
109             rather B<it is simply a very pleasant surprise>. I largely create and release
110             works like this because I need them or I find it enjoyable; however, don't let
111             that stop you if you feel like it ;)
112              
113             L<Flattr|https://flattr.com/submit/auto?user_id=RsrchBoy&url=https%3A%2F%2Fgithub.com%2FRsrchBoy%2Fblah&title=RsrchBoy's%20CPAN%20BLAH&tags=%22RsrchBoy's%20BLAH%20in%20the%20CPAN%22>,
114             L<Gratipay|https://gratipay.com/RsrchBoy/>, or indulge my
115             L<Amazon Wishlist|http://bit.ly/rsrchboys-wishlist>... If and *only* if you so desire.
116              
117             =head1 COPYRIGHT AND LICENSE
118              
119             This software is Copyright (c) 2015 by Chris Weyl.
120              
121             This is free software, licensed under:
122              
123             The GNU Lesser General Public License, Version 2.1, February 1999
124              
125             =cut