File Coverage

blib/lib/CatalystX/OAuth2/ActionRole/RequestInjector.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package CatalystX::OAuth2::ActionRole::RequestInjector;
2 8     8   4910 use Moose::Role;
  8         24  
  8         64  
3 8     8   41872 use Moose::Util;
  8         26  
  8         63  
4              
5             # ABSTRACT: A role for injecting oauth2 logic into a catalyst request object
6              
7 8     8   4821 use CatalystX::OAuth2::Request;
  8         32  
  8         926  
8              
9             requires 'execute';
10             requires 'build_oauth2_request';
11              
12             before execute => sub {
13             my $self = shift;
14             my ( $controller, $c ) = @_;
15             my $req = $c->req;
16              
17             Moose::Util::ensure_all_roles( $req, 'CatalystX::OAuth2::Request',
18             { rebless_params => { oauth2 => $self->build_oauth2_request(@_) } } );
19              
20             };
21              
22             1;
23              
24             __END__
25              
26             =pod
27              
28             =head1 NAME
29              
30             CatalystX::OAuth2::ActionRole::RequestInjector - A role for injecting oauth2 logic into a catalyst request object
31              
32             =head1 VERSION
33              
34             version 0.001006
35              
36             =head1 AUTHOR
37              
38             Eden Cardim <edencardim@gmail.com>
39              
40             =head1 COPYRIGHT AND LICENSE
41              
42             This software is copyright (c) 2017 by Suretec Systems Ltd.
43              
44             This is free software; you can redistribute it and/or modify it under
45             the same terms as the Perl 5 programming language system itself.
46              
47             =cut