line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package OAuthomatic::OAuthInteraction::ViaMicroWeb; |
2
|
|
|
|
|
|
|
# ABSTRACT: Handling oauth callback via embedded web server |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
943
|
use Moose; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use namespace::sweep; |
8
|
|
|
|
|
|
|
use Proc::Background; |
9
|
|
|
|
|
|
|
use Carp; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has 'micro_web' => (is=>'ro', isa=>'OAuthomatic::Internal::MicroWeb', required=>1, |
13
|
|
|
|
|
|
|
handles => [ 'callback_url', 'wait_for_oauth_grant' ]); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub prepare_to_work { |
16
|
|
|
|
|
|
|
my $self = shift; |
17
|
|
|
|
|
|
|
$self->micro_web->start_using; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub cleanup_after_work { |
21
|
|
|
|
|
|
|
my $self = shift; |
22
|
|
|
|
|
|
|
$self->micro_web->finish_using; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
with 'OAuthomatic::OAuthInteraction'; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
__END__ |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=pod |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=encoding UTF-8 |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 NAME |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
OAuthomatic::OAuthInteraction::ViaMicroWeb - Handling oauth callback via embedded web server |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 VERSION |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
version 0.01 |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 DESCRIPTION |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
This module uses in-process web server to handle callback after OAuth permission |
44
|
|
|
|
|
|
|
is granted. Used as default implementation of C<oauth_interaction> plugin |
45
|
|
|
|
|
|
|
of L<OAuthomatic>. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 PARAMETERS |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head2 micro_web |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Embedded web server object. Here it will be used to handle OAuth callback and display |
52
|
|
|
|
|
|
|
minimal info to the user afterwards. |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 AUTHOR |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Marcin Kasperski <Marcin.Kasperski@mekk.waw.pl> |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
This software is copyright (c) 2015 by Marcin Kasperski. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
63
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=cut |