| 1 | package WWW::JSON::Role::Authentication::OAuth2; | ||||||||||
| 2 | 8 | ▶ | use Moo::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 8 | ▶ | use Safe::Isa; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 8 | requires 'authentication'; | |||||||||
| 5 | 8 | requires 'ua'; | |||||||||
| 6 | |||||||||||
| 7 | sub _validate_OAuth2 { | ||||||||||
| 8 | 0 | ▶ | my ( $self, $auth ) = @_; | ||||||||
|
Subroutine
_validate_OAuth2: not called CC=2 SCAR=17.9
| |||||||||||
| 9 | 0 | ▶ | die "Must pass a Net::OAuth2::AccessToken object when using " | ||||||||
|
Branch: 1 branch
| |||||||||||
| 10 | . __PACKAGE__ | ||||||||||
| 11 | . " authentication." | ||||||||||
| 12 | unless $auth->$_isa('Net::OAuth2::AccessToken'); | ||||||||||
| 13 | } | ||||||||||
| 14 | |||||||||||
| 15 | sub _auth_OAuth2 { | ||||||||||
| 16 | 0 | ▶ | my ( $self, $auth, $req ) = @_; | ||||||||
|
Subroutine
_auth_OAuth2: not called CC=1 SCAR=6.9
| |||||||||||
| 17 | 0 | $req->header( Authorization => 'Bearer ' . $auth->access_token ); | |||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | 8 | 1; | |||||||||