line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
70560
|
use strict; |
|
1
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
32
|
|
2
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
77
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Mojolicious::Plugin::Web::Auth::Site::DropboxV2; |
5
|
|
|
|
|
|
|
our $VERSION = '0.000001'; |
6
|
1
|
|
|
1
|
|
487
|
use Mojo::Base qw/Mojolicious::Plugin::Web::Auth::OAuth2/; |
|
1
|
|
|
|
|
200279
|
|
|
1
|
|
|
|
|
10
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has access_token_url => 'https://api.dropboxapi.com/oauth2/token'; |
9
|
|
|
|
|
|
|
has authorize_url => 'https://www.dropbox.com/oauth2/authorize'; |
10
|
|
|
|
|
|
|
has response_type => 'code'; |
11
|
|
|
|
|
|
|
has grant_type => 'authorization_code'; |
12
|
|
|
|
|
|
|
|
13
|
0
|
|
|
0
|
0
|
|
sub moniker { 'dropboxv2' } |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
1; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=pod |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=encoding UTF-8 |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 NAME |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
Mojolicious::Plugin::Web::Auth::Site::DropboxV2 - Dropbox OAuth2 Plugin for Mojolicious::Plugin::Web::Auth |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 VERSION |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
version 0.000001 |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 SYNOPSIS |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
my $client_id = '9999'; |
32
|
|
|
|
|
|
|
my $client_secret = 'seekrit'; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# Mojolicious |
35
|
|
|
|
|
|
|
$self->plugin( |
36
|
|
|
|
|
|
|
'Web::Auth', |
37
|
|
|
|
|
|
|
module => 'DropboxV2', |
38
|
|
|
|
|
|
|
key => $client_id, |
39
|
|
|
|
|
|
|
secret => $client_secret, |
40
|
|
|
|
|
|
|
scope => 'view_private,write', |
41
|
|
|
|
|
|
|
on_finished => sub { |
42
|
|
|
|
|
|
|
my ( $c, $access_token, $access_secret ) = @_; |
43
|
|
|
|
|
|
|
...; |
44
|
|
|
|
|
|
|
}, |
45
|
|
|
|
|
|
|
); |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
# Mojolicious::Lite |
48
|
|
|
|
|
|
|
plugin 'Web::Auth', |
49
|
|
|
|
|
|
|
module => 'DropboxV2', |
50
|
|
|
|
|
|
|
key => $client_id, |
51
|
|
|
|
|
|
|
secret => $client_secret, |
52
|
|
|
|
|
|
|
scope => 'view_private,write', |
53
|
|
|
|
|
|
|
on_finished => sub { |
54
|
|
|
|
|
|
|
my ( $c, $access_token, $access_secret ) = @_; |
55
|
|
|
|
|
|
|
...; |
56
|
|
|
|
|
|
|
}; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 DESCRIPTION |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
This module adds |
61
|
|
|
|
|
|
|
L OAuth2 |
62
|
|
|
|
|
|
|
support to L. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 AUTHOR |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Olaf Alders |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
This software is copyright (c) 2019 by Olaf Alders. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
73
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=cut |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
__END__ |