Request/Token/TokenExchange.pm

filter: Statementstmt 54.5% 12 / 22 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 42.8% 3 / 7 Podpod 0.0% 0 / 4 totaltotal 36.5% 15 / 41 CC 5 SCAR 26.7
CC
5
Cov
40%
get_grant
30.0
grant_type
2.0
allowed_methods
2.0
CRAP 14.5
↑ Summary TokenExchange.pm »
1 1 ▶use strict; use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
2  
3 package Net::OAuth2Server::Request::Token::TokenExchange;
4 1 our $VERSION = '0.004';
5  
6 1 ▶use parent 'Net::OAuth2Server::Request';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 0 ▶sub grant_type { 'urn:ietf:params:oauth:grant-type:token-exchange' }
Subroutine grant_type: not called CC=1 SCAR=6.9
Pod undocumented
9 0 ▶sub allowed_methods { 'POST' }
Subroutine allowed_methods: not called CC=1 SCAR=6.9
Pod undocumented
10 0 ▶sub grant_parameters { qw( subject_token_type subject_token ) }
Subroutine grant_parameters: not called CC=1 SCAR=6.9
Pod undocumented
11 1 *required_parameters = \&grant_parameters;
12  
13 0 ▶sub get_grant {
Subroutine get_grant: not called CC=5 SCAR=34.0
Pod undocumented
14 0 my ( $self, $grant_maker ) = ( shift, shift );
15 0 ▶ return if $self->error;
Branch: 1 branch
BranchTrueFalseTotal
if $self->error 0 0 0
16  
17 0 ▶ if ( $self->has_param( 'actor_token' ) ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($self->has_param('actor_token')) { } 0 0 0
elsif ($self->has_param('actor_token_type')) { } 0 0 0
18 0 ▶ $self->ensure_required( 'actor_token_type' ) or return;
Branch: 1 branch
BranchTrueFalseTotal
$self->ensure_required("actor_token_type") or return 0 0 0
19 }
20 elsif ( $self->has_param( 'actor_token_type' ) ) {
21 0 $self->set_error_invalid_request( 'extraneous parameter: actor_token_type' );
22 0 return;
23 }
24  
25 0 $grant_maker->from_subject_token( $self, $self->params( $self->grant_parameters ), @_ );
26 }
27  
28 1 1;
↑ Summary TokenExchange.pm »