File Coverage

blib/lib/Global/Context/AuthToken.pm
Criterion Covered Total %
statement 7 7 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod 0 1 0.0
total 10 11 90.9


line stmt bran cond sub pod time code
1             package Global::Context::AuthToken;
2             {
3             $Global::Context::AuthToken::VERSION = '0.003';
4             }
5 2     2   1408 use Moose::Role;
  2         5  
  2         16  
6             # ABSTRACT: an authentication token
7              
8 2     2   5933 use namespace::autoclean;
  2         4  
  2         14  
9              
10              
11             has uri => (
12             is => 'ro',
13             isa => 'Str',
14             required => 1,
15             );
16              
17 1     1 0 36 sub as_string { $_[0]->uri }
18              
19             has agent => (
20             is => 'ro',
21             isa => 'Defined',
22             required => 1,
23             );
24              
25             1;
26              
27             __END__
28              
29             =pod
30              
31             =head1 NAME
32              
33             Global::Context::AuthToken - an authentication token
34              
35             =head1 VERSION
36              
37             version 0.003
38              
39             =head1 OVERVIEW
40              
41             Global::Context::AuthToken is a role.
42              
43             AuthToken objects represent the means by which a request was authenticated and
44             a handle by which actions can be checked for authorization.
45              
46             They have two required attributes: C<uri>, which must be a string, and
47             C<agent>, which must be a value pointing to the user.
48              
49             It is expected that any serious use of Global::Context will use a non-trivial
50             AuthToken class that has more stringent requirements.
51              
52             =head1 AUTHOR
53              
54             Ricardo Signes <rjbs@cpan.org>
55              
56             =head1 COPYRIGHT AND LICENSE
57              
58             This software is copyright (c) 2010 by Ricardo Signes.
59              
60             This is free software; you can redistribute it and/or modify it under
61             the same terms as the Perl 5 programming language system itself.
62              
63             =cut