lib/LWP/Authen/OAuth2/ServiceProvider/Line.pm

filter: Statementstmt 96.8% 31 / 32 Branchbran 50.0% 4 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 13 / 13 Podpod 50.0% 5 / 10 totaltotal 84.1% 53 / 63 SCAR 16.2
CC
5
Cov
88%
access_token_class
2.1
authorization_endpoint
2.0
token_endpoint
2.0
CRAP 5.0
« blib/lib/LWP/Authen/OAuth2/ServiceProvider/Line/AccessToken.pm ↑ Summary lib/LWP/Authen/OAuth2/ServiceProvider/Dwolla.pm »
1 package LWP::Authen::OAuth2::ServiceProvider::Line;
2  
3 # ABSTRACT: Access Line OAuth2 API v2
4 2 our $VERSION = '0.19'; # VERSION
5  
6 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 ▶use parent 'LWP::Authen::OAuth2::ServiceProvider';
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 sub required_init {
12 1 ▶ return qw(client_id client_secret redirect_uri);
Subroutine required_init: called CC=1 SCAR=0.0
Pod documented
13 }
14  
15 sub authorization_required_params {
16 1 ▶ return qw(client_id redirect_uri response_type state);
Subroutine authorization_required_params: called CC=1 SCAR=0.0
Pod undocumented
17 }
18  
19 sub authorization_default_params {
20 1 ▶ return response_type => 'code';
Subroutine authorization_default_params: called CC=1 SCAR=0.0
Pod undocumented
21 }
22  
23 sub request_required_params {
24 1 ▶ return qw(client_id redirect_uri grant_type client_secret code);
Subroutine request_required_params: called CC=1 SCAR=0.0
Pod undocumented
25 }
26  
27 sub request_default_params {
28 1 ▶ return grant_type => 'authorization_code';
Subroutine request_default_params: called CC=1 SCAR=0.0
Pod undocumented
29 }
30  
31 sub init {
32 1 ▶ my ($self, $opts) = @_;
Subroutine init: called CC=1 SCAR=0.0
Pod documented
33 1 $self->copy_option($opts, line_server => 'line.me');
34 1 $self->SUPER::init($opts);
35 }
36  
37 sub authorization_endpoint {
38 2 ▶ my $self = shift;
Subroutine authorization_endpoint: called CC=2 SCAR=7.1
Pod documented
39 2 ▶ my $server = $self->{line_server} or die 'line_server not configured. Forgot to call init()?';
Branch: 1 branch
BranchTrueFalseTotal
my $server = $self->{"line_server"} or die "line_server not configured. Forgot to call init()?" 0 2 2
40  
41 2 return "https://access.$server/dialog/oauth/weblogin";
42 }
43  
44 sub token_endpoint {
45 2 ▶ my $self = shift;
Subroutine token_endpoint: called CC=2 SCAR=7.1
Pod documented
46 2 ▶ my $server = $self->{line_server} or die 'line_server not configured. Forgot to call init()?';
Branch: 1 branch
BranchTrueFalseTotal
my $server = $self->{"line_server"} or die "line_server not configured. Forgot to call init()?" 0 2 2
47  
48 2 return "https://api.$server/v2/oauth/accessToken";
49 }
50  
51 sub api_url_base {
52 1 ▶ my $self = shift;
Subroutine api_url_base: called CC=2 SCAR=7.1
Pod undocumented
53 1 ▶ my $server = $self->{line_server} or die 'line_server not configured. Forgot to call init()?';
Branch: 1 branch
BranchTrueFalseTotal
my $server = $self->{"line_server"} or die "line_server not configured. Forgot to call init()?" 0 1 1
54  
55 1 return "https://api.$server/v2/";
56 }
57  
58 sub access_token_class {
59 1 ▶ my ($self, $type) = @_;
Subroutine access_token_class: called CC=2 SCAR=7.6
Pod documented
60  
61 1 ▶ if ($type eq 'bearer') {
Branch: 1 branch
BranchTrueFalseTotal
if ($type eq "bearer") 1 0 1
62 1 return 'LWP::Authen::OAuth2::ServiceProvider::Line::AccessToken';
63 }
64  
65 0 return $self->SUPER::access_token_class($type);
66 }
67  
68  
69 2 1;
70  
71 __END__
« blib/lib/LWP/Authen/OAuth2/ServiceProvider/Line/AccessToken.pm ↑ Summary lib/LWP/Authen/OAuth2/ServiceProvider/Dwolla.pm »