File Coverage

blib/lib/OAuth/Lite2/Model/AuthInfo.pm
Criterion Covered Total %
statement 18 18 100.0
branch 2 2 100.0
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 26 26 100.0


line stmt bran cond sub pod time code
1             package OAuth::Lite2::Model::AuthInfo;
2              
3 17     17   59766 use strict;
  17         21  
  17         399  
4 17     17   52 use warnings;
  17         16  
  17         354  
5              
6 17     17   48 use base 'Class::Accessor::Fast';
  17         17  
  17         6464  
7              
8             __PACKAGE__->mk_accessors(qw(
9             id
10             user_id
11             client_id
12             scope
13             refresh_token
14             code
15             redirect_uri
16             server_state
17             ));
18              
19 17     17   31988 use Params::Validate;
  17         6277  
  17         1972  
20              
21             sub new {
22 23     23 1 4767 my $class = shift;
23 23 100       60 my @args = @_ == 1 ? %{$_[0]} : @_;
  22         85  
24 23         918 my %params = Params::Validate::validate_with(
25             params => \@args,
26             spec => {
27             id => 1,
28             user_id => 1,
29             client_id => 1,
30             scope => { optional => 1 },
31             refresh_token => { optional => 1 },
32             code => { optional => 1 },
33             redirect_uri => { optional => 1 },
34             server_state => { optional => 1 },
35             },
36             allow_extra => 1,
37             );
38 23         144 my $self = bless \%params, $class;
39 23         76 return $self;
40             }
41              
42             =head1 NAME
43              
44             OAuth::Lite2::Model::AuthInfo - model class that represents authorization info.
45              
46             =head1 ACCESSORS
47              
48             =head2 id
49              
50             Identifier of this authorization info.
51              
52             =head2 user_id
53              
54             User identifier for resource owner
55              
56             =head2 client_id
57              
58             CLient identifier for obtain token
59              
60             =head2 scope
61              
62             Scope string for authorization info
63              
64             =head2 refresh_token
65              
66             Refresh token related with authorization info
67              
68             =head2 code
69              
70             Authorization code related with authorization info
71              
72             =head2 redirect_uri
73              
74             Redirect URI related with authorization info
75              
76             =head2 server_state
77              
78             Server State for CSRF Protection
79              
80             =head1 AUTHOR
81              
82             Ryo Ito, Eritou.06@gmail.comE
83              
84             Lyo Kato, Elyo.kato@gmail.comE
85              
86             =head1 COPYRIGHT AND LICENSE
87              
88             Copyright (C) 2010 by Lyo Kato
89              
90             This library is free software; you can redistribute it and/or modify
91             it under the same terms as Perl itself, either Perl version 5.8.8 or,
92             at your option, any later version of Perl 5 you may have available.
93              
94             =cut
95              
96             1;