OAuth/SignatureMethod/HMAC_SHA1.pm

filter: Statementstmt 100% 20 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 92.8% 26 / 28 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« OAuth/XauthAccessTokenRequest.pm ↑ Summary OAuth/SignatureMethod/HMAC_SHA256.pm »
1 package Net::OAuth::SignatureMethod::HMAC_SHA1;
2 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 8 ▶use Digest::SHA ();
Subroutine BEGIN: called CC=1 SCAR=0.0
5 8 ▶use MIME::Base64;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 sub sign {
8 28 ▶ my $self = shift;
Subroutine sign: called CC=1 SCAR=0.0
Pod undocumented
9 28 my $request = shift;
10 28 my $hmac_digest = Digest::SHA::hmac_sha1(
11 $request->signature_base_string, $request->signature_key
12 );
13 28 return encode_base64($hmac_digest, '');
14 }
15  
16 sub verify {
17 12 ▶ my $self = shift;
Subroutine verify: called CC=1 SCAR=0.0
Pod undocumented
18 12 my $request = shift;
19 12 return $request->signature eq $self->sign($request);
20 }
21  
22 =head1 NAME
23  
24 Net::OAuth::SignatureMethod::HMAC_SHA1 - HMAC_SHA1 Signature Method for OAuth protocol
25  
26 =head1 SEE ALSO
27  
28 L<Net::OAuth>, L<http://oauth.net>
29  
30 =head1 AUTHOR
31  
32 Originally by Keith Grennan <foss@nearlyfree.org>
33  
34 Currently maintained by Robert Rothenberg <perl@rhizomnic.com>
35  
36 =head1 COPYRIGHT & LICENSE
37  
38 Copyright 2007-2012, 2024-2025 Keith Grennan
39  
40 This program is free software; you can redistribute it and/or modify it
41 under the same terms as Perl itself.
42  
43 =cut
44  
45 8 1;
« OAuth/XauthAccessTokenRequest.pm ↑ Summary OAuth/SignatureMethod/HMAC_SHA256.pm »