File Coverage

blib/lib/Net/OAuth2Server/Request/Authorization.pm
Criterion Covered Total %
statement 12 18 66.6
branch 0 2 0.0
condition 0 5 0.0
subroutine 4 8 50.0
pod 0 4 0.0
total 16 37 43.2


line stmt bran cond sub pod time code
1 1     1   459 use strict; use warnings;
  1     1   3  
  1         39  
  1         6  
  1         1  
  1         37  
2              
3             package Net::OAuth2Server::Request::Authorization;
4 1     1   583 use parent 'Net::OAuth2Server::Request';
  1         305  
  1         6  
5 1     1   66 use Object::Tiny::Lvalue qw( response_type redirect_uri );
  1         5  
  1         6  
6              
7 0     0 0   sub allowed_methods { qw( GET HEAD POST ) }
8 0     0 0   sub required_parameters { 'response_type' }
9 0     0 0   sub set_parameters { qw( scope response_type ) }
10              
11             sub get_grant {
12 0     0 0   my ( $self, $grant_maker ) = ( shift, shift );
13             # need validated redirect_uri so cannot shortcircuit on $self->error
14 0   0       my $grant = $grant_maker->for_authorization(
15             $self,
16             $self->param( 'client_id' ) || return,
17             $self->response_type,
18             $self->scope,
19             $self->param( 'redirect_uri' ),
20             @_,
21             );
22             # must compensate for lack of shortcircuit now
23 0 0 0       $self->error ? () : $grant || ();
24             }
25              
26             our $VERSION = '0.005';