Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add new AlwaysSecureGlob directive
It's not possible to enumerate all the admin URLs or ActionMaps that should be
generated secure-only, so this new directive allows matching.
  • Loading branch information
jonjensen committed Mar 25, 2017
1 parent fdaad55 commit b498ab7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
6 changes: 6 additions & 0 deletions dist/strap/catalog.cfg
Expand Up @@ -364,6 +364,12 @@ AlwaysSecure <<EOD
query/order_detail
EOD

AlwaysSecureGlob <<EOD
admin*,
cert*,
ui*,
EOD

## Set this if you have a different secure server
#AlwaysSecure order ord/basket process

Expand Down
5 changes: 3 additions & 2 deletions lib/Vend/Config.pm
@@ -1,6 +1,6 @@
# Vend::Config - Configure Interchange
#
# Copyright (C) 2002-2016 Interchange Development Group
# Copyright (C) 2002-2017 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
#
# This program was originally based on Vend 0.2 and 0.3
Expand Down Expand Up @@ -54,7 +54,7 @@ use Vend::Data;
use Vend::Cron;
use Vend::CharSet ();

$VERSION = '2.248';
$VERSION = '2.249';

my %CDname;
my %CPname;
Expand Down Expand Up @@ -649,6 +649,7 @@ sub catalog_directives {
['OptionsAttribute', undef, ''],
['Options', 'locale', ''],
['AlwaysSecure', 'boolean', ''],
['AlwaysSecureGlob', 'list_wildcard_full', ''],
['Password', undef, ''],
['AdminSub', 'boolean', ''],
['ExtraSecure', 'yesno', 'No'],
Expand Down
10 changes: 7 additions & 3 deletions lib/Vend/Util.pm
@@ -1,6 +1,6 @@
# Vend::Util - Interchange utility functions
#
# Copyright (C) 2002-2016 Interchange Development Group
# Copyright (C) 2002-2017 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
#
# This program was originally based on Vend 0.2 and 0.3
Expand Down Expand Up @@ -102,7 +102,7 @@ use Vend::Safe;
use Vend::File;
use subs qw(logError logGlobal);
use vars qw($VERSION @EXPORT @EXPORT_OK);
$VERSION = '2.128';
$VERSION = '2.129';

my $Eval_routine;
my $Eval_routine_file;
Expand Down Expand Up @@ -1382,7 +1382,11 @@ sub vendUrl {
$opt->{secure} = $CGI::secure;
}

if($opt->{secure} or exists $Vend::Cfg->{AlwaysSecure}{$path}) {
my $asg = $Vend::Cfg->{AlwaysSecureGlob};
if ($opt->{secure}
or exists $Vend::Cfg->{AlwaysSecure}{$path}
or ($asg and $path =~ $asg)
) {
$r = $Vend::Cfg->{SecureURL};
}

Expand Down

0 comments on commit b498ab7

Please sign in to comment.