/usr/share/perl5/Net/OAuth/AccessToken.pm is in libnet-oauth-perl 0.28-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | package Net::OAuth::AccessToken;
use warnings;
use strict;
use base qw(Class::Accessor::Fast);
__PACKAGE__->mk_accessors(qw/client token token_secret session_handle expires_in authorization_expires_in/);
sub new {
my $class = shift;
my %opts = @_;
my $self = bless \%opts, $class;
return $self;
}
sub request {
my $self = shift;
my ($method, $uri, $header, $content, %params) = @_;
my $oauth_req = $self->client->_make_request(
'protected resource',
request_method => $method,
request_url => $self->client->site_url($uri),
token => $self->token,
token_secret => $self->token_secret,
%params,
);
$oauth_req->sign;
return $self->client->request(HTTP::Request->new(
$method => $oauth_req->to_url, $header, $content
));
}
sub get {
return shift->request('GET', @_);
}
sub post {
return shift->request('POST', @_);
}
sub delete {
return shift->request('DELETE', @_);
}
sub put {
return shift->request('PUT', @_);
}
=head1 NAME
Net::OAuth::AccessToken - OAuth Access Token
=head1 DESCRIPTION
WARNING: Net::OAuth::AccessToken is alpha code. The rest of Net::OAuth is quite
stable but this particular module is new, and is under-documented and under-tested.
=head1 SEE ALSO
L<Net::OAuth>
=head1 LICENSE AND COPYRIGHT
Copyright 2011 Keith Grennan.
This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
=cut
1;
|