| 1 | package OAuth::Lite2::Server::GrantHandler::ServerState; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 8 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 8 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 8 | ▶ | use parent 'OAuth::Lite2::Server::GrantHandler'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 8 | ▶ | use OAuth::Lite2::Server::Error; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 8 | ▶ | use OAuth::Lite2::ParamMethod::AuthHeader; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 8 | ▶ | use Carp (); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | sub is_required_client_authentication { | ||||||||||||||||||||||||||||
| 12 | 1 | ▶ | return 0; | ||||||||||||||||||||||||||
|
Subroutine
is_required_client_authentication: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 13 | } | ||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | sub handle_request { | ||||||||||||||||||||||||||||
| 16 | 2 | ▶ | my ($self, $dh) = @_; | ||||||||||||||||||||||||||
|
Subroutine
handle_request: called CC=4 SCAR=14.5
Pod
documented
| |||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 2 | my $req = $dh->request; | |||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 2 | my $parser = OAuth::Lite2::ParamMethod::AuthHeader->new; | |||||||||||||||||||||||||||
| 21 | 2 | my $header_credentials = $parser->basic_credentials($req); | |||||||||||||||||||||||||||
| 22 | 2 | ▶ | my $client_id = ($header_credentials->{client_id}) ? $header_credentials->{client_id} : $req->param("client_id"); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | # create server_state | ||||||||||||||||||||||||||||
| 25 | 2 | my $server_state = $dh->create_server_state( | |||||||||||||||||||||||||||
| 26 | client_id => $client_id, | ||||||||||||||||||||||||||||
| 27 | ); | ||||||||||||||||||||||||||||
| 28 | 2 | ▶ | Carp::croak "OAuth::Lite2::Server::DataHandler::create_server_state doesn't return OAuth::Lite2::Model::ServerState" | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$server_state and $server_state->isa("OAuth::Lite2::Model::ServerState")
MC/DC0%0/2
$server_state and $server_state->isa("OAuth::Lite2::Model::ServerState")
$server_state
$server_state->isa("OAuth::Lite2::Model::ServerState")
Truth table33%1/3
A and B
A= $server_stateB= $server_state->isa("OAuth::Lite2::Model::ServerState")
| |||||||||||||||||||||||||||||
| 29 | unless ($server_state | ||||||||||||||||||||||||||||
| 30 | && $server_state->isa("OAuth::Lite2::Model::ServerState")); | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 2 | my $res = { | |||||||||||||||||||||||||||
| 33 | server_state => $server_state->server_state, | ||||||||||||||||||||||||||||
| 34 | expires_in => $server_state->expires_in | ||||||||||||||||||||||||||||
| 35 | }; | ||||||||||||||||||||||||||||
| 36 | 2 | return $res; | |||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | =head1 NAME | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | OAuth::Lite2::Server::GrantHandler::ServerState - handler for 'server_state' grant_type request | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | my $handler = OAuth::Lite2::Server::GrantHandler::ServerState->new; | ||||||||||||||||||||||||||||
| 46 | my $res = $handler->handle_request( $data_handler ); | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | handler for 'server_state' grant_type request. | ||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | =head1 METHODS | ||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | =head2 handle_request( $req ) | ||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | See L<OAuth::Lite2::Server::GrantHandler> document. | ||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | =head1 AUTHOR | ||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | Ryo Ito, E<lt>ritou.06@gmail.comE<gt> | ||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | Lyo Kato, E<lt>lyo.kato@gmail.comE<gt> | ||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | =head1 COPYRIGHT AND LICENSE | ||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | Copyright (C) 2010 by Lyo Kato | ||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 68 | This library is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||
| 69 | it under the same terms as Perl itself, either Perl version 5.8.8 or, | ||||||||||||||||||||||||||||
| 70 | at your option, any later version of Perl 5 you may have available. | ||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | =cut | ||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||
| 74 | 8 | 1; | |||||||||||||||||||||||||||