| 1 | package Net::OAuth::Easy::Roles::Types; | ||||||||||
| 2 | 2 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 2 | $Net::OAuth::Easy::Roles::Types::VERSION = '0.001_07'; | |||||||||
| 4 | } | ||||||||||
| 5 | 2 | ▶ | use Moose::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 2 | ▶ | use Moose::Util::TypeConstraints; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 2 | ▶ | use File::Slurp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 2 | ▶ | use Data::Validate::URI qw(is_uri); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 2 | require Crypt::OpenSSL::RSA; | |||||||||
| 10 | |||||||||||
| 11 | # ABSTRACT: Role to tuck away types into | ||||||||||
| 12 | |||||||||||
| 13 | 2 | enum 'OAuthProtocol' => qw(1.0 1.0a); | |||||||||
| 14 | |||||||||||
| 15 | 2 | enum 'RequestMethod' => qw(GET POST); | |||||||||
| 16 | |||||||||||
| 17 | 2 | enum 'SignatureMethod' => qw(HMAC-SHA1 RSA-SHA1); | |||||||||
| 18 | |||||||||||
| 19 | 2 | subtype SignatureKey => as 'Crypt::OpenSSL::RSA'; | |||||||||
| 20 | coerce SignatureKey => | ||||||||||
| 21 | from Str => | ||||||||||
| 22 | 1 | ▶ | via { my $file = $_[0]; | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.1
| |||||||||||
| 23 | 1 | ▶ | die sprintf q{%s does not exist as a readable file}, $file | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | unless -r $file; | ||||||||||
| 25 | 1 | Crypt::OpenSSL::RSA->new_private_key( join '', read_file($file) ); | |||||||||
| 26 | 2 | }; | |||||||||
| 27 | |||||||||||
| 28 | 8 | ▶ | type ValidURI => as Str => where {is_uri($_)}; | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 29 | |||||||||||
| 30 | 2 | 1; | |||||||||
| 31 | |||||||||||
| 32 | __END__ | ||||||||||