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::Authorization; |
11
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:RSRCHBOY'; |
12
|
|
|
|
|
|
|
$BLAH::Enforces::Authorization::VERSION = '0.001'; # TRIAL |
13
|
|
|
|
|
|
|
# ABSTRACT: BLAH role for enforced authentication |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
1
|
|
373719
|
use Moose::Role; |
|
1
|
|
|
|
|
155984
|
|
|
1
|
|
|
|
|
5
|
|
16
|
1
|
|
|
1
|
|
6139
|
use namespace::autoclean 0.24; |
|
1
|
|
|
|
|
7886
|
|
|
1
|
|
|
|
|
6
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
with 'BLAH::Role::Authorization'; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
before execute => sub { |
22
|
|
|
|
|
|
|
my $self = shift @_; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
confess 'Attempt to execute without authorization!' |
25
|
|
|
|
|
|
|
unless $self->callable; |
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::Authorization - BLAH role for enforced authentication |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 VERSION |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
This document describes version 0.001 of BLAH::Enforces::Authorization - released August 26, 2015 as part of BLAH. |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 DESCRIPTION |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
A L<BLAH> role for enforcing authorization -- that is, our C<callable()> |
53
|
|
|
|
|
|
|
method returns true. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 METHODS |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head2 execute |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
We wrap the C<execute()> method to invoke C<< $self->callable() >> first, in |
60
|
|
|
|
|
|
|
order to determine if our invocation is considered authorized by the BLAH. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
If C<callable()> 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::Authorization|BLAH::Role::Authorization> |
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 |