| 1 | package Catalyst::ActionRole::RequireSSL::Role; | ||||||||||
| 2 | |||||||||||
| 3 | 2 | ▶ | use Moose::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 2 | our $VERSION = '0.07'; | |||||||||
| 6 | |||||||||||
| 7 | =head1 NAME | ||||||||||
| 8 | |||||||||||
| 9 | Catalyst::ActionRole::RequireSSL::Role - Roles. | ||||||||||
| 10 | |||||||||||
| 11 | =head1 VERSION | ||||||||||
| 12 | |||||||||||
| 13 | version 1.00 | ||||||||||
| 14 | |||||||||||
| 15 | =head1 SYNOPSIS | ||||||||||
| 16 | |||||||||||
| 17 | =cut | ||||||||||
| 18 | |||||||||||
| 19 | 2 | my @ignore_chain = qw/Catalyst::ActionRole::NoSSL Catalyst::ActionRole::RequireSSL/; | |||||||||
| 20 | |||||||||||
| 21 | =head1 METHODS | ||||||||||
| 22 | |||||||||||
| 23 | =head2 check_chain($c) | ||||||||||
| 24 | |||||||||||
| 25 | check we are most relevant action | ||||||||||
| 26 | |||||||||||
| 27 | =cut | ||||||||||
| 28 | |||||||||||
| 29 | 10 | ▶ | sub check_chain { | ||||||||
|
Subroutine
check_chain: called CC=6 SCAR=17.9
Pod
documented
| |||||||||||
| 30 | 10 | my ($self,$c) = @_; | |||||||||
| 31 | return $c->config->{require_ssl}->{path_cache}->{$c->action->private_path} | ||||||||||
| 32 | eq $self->private_path | ||||||||||
| 33 | 10 | ▶ | if $c->config->{require_ssl}->{path_cache}->{$c->action->private_path}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 34 | 8 | ▶ | if($c->action->can('chain')) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 35 | 7 | foreach my $action (reverse @{$c->action->chain}) { | |||||||||
| 36 | 10 | foreach my $role (@{$action->attributes->{Does}}) { | |||||||||
| 37 | 7 | ▶ | if(grep {$role eq $_} @ignore_chain ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 38 | 7 | $c->config->{require_ssl}->{path_cache}->{$action->private_path} | |||||||||
| 39 | = $action->private_path; | ||||||||||
| 40 | 7 | return $action->private_path eq $self->private_path; | |||||||||
| 41 | } | ||||||||||
| 42 | } | ||||||||||
| 43 | } | ||||||||||
| 44 | } | ||||||||||
| 45 | 1 | return 1; | |||||||||
| 46 | } | ||||||||||
| 47 | |||||||||||
| 48 | 2 | 1; | |||||||||