File Coverage

blib/lib/Net/OAuth2Server/Request/Token.pm
Criterion Covered Total %
statement 9 21 42.8
branch 0 8 0.0
condition n/a
subroutine 3 9 33.3
pod 0 6 0.0
total 12 44 27.2


line stmt bran cond sub pod time code
1 1     1   1922 use strict; use warnings;
  1     1   4  
  1         64  
  1         5  
  1         2  
  1         77  
2              
3             package Net::OAuth2Server::Request::Token;
4             our $VERSION = '0.006';
5              
6 1     1   5 use parent 'Net::OAuth2Server::Request';
  1         26  
  1         9  
7              
8 0     0 0   sub allowed_methods { 'POST' }
9 0     0 0   sub accepted_auth { 'Basic' }
10 0     0 0   sub required_parameters { 'grant_type' }
11 0     0 0   sub confidential_parameters { 'client_secret' }
12              
13       0 0   sub get_grant {}
14              
15             sub dispatch {
16 0     0 0   my ( $self, @class ) = ( shift, @_ );
17 0 0         return $self if $self->error;
18 0 0         for ( @class ) { s/\A\+/__PACKAGE__.'::'/e unless ref }
  0            
  0            
19 0           my $type = $self->param( 'grant_type' );
20 0 0         my ( $class ) = defined $type ? grep $type eq $_->grant_type, @class : ();
21 0 0         $class ? $class->new( %$self ) : $self->set_error_unsupported_grant_type;
22             }
23              
24             1;