| 1 | package OAuth::Lite2::Model::AuthInfo; | ||||||||||
| 2 | |||||||||||
| 3 | 17 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 17 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 17 | ▶ | use base 'Class::Accessor::Fast'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 17 | __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 | ▶ | use Params::Validate; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 20 | |||||||||||
| 21 | 37 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 22 | 37 | my $class = shift; | |||||||||
| 23 | 37 | ▶ | my @args = @_ == 1 ? %{$_[0]} : @_; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | 37 | 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 | 37 | my $self = bless \%params, $class; | |||||||||
| 39 | 37 | 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, E<lt>ritou.06@gmail.comE<gt> | ||||||||||
| 83 | |||||||||||
| 84 | Lyo Kato, E<lt>lyo.kato@gmail.comE<gt> | ||||||||||
| 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 | 17 | 1; | |||||||||