unless $description =~ /^[\w\s]{3,255}$/;
my $callback_uri = URI->new($callback);
+
+my $legal_protocol
+ = $ENV{BUGZILLA_UNSAFE_AUTH_DELEGATION}
+ ? qr/^https?$/i # http or https
+ : qr/^https$/i; # https only
+
ThrowUserError('auth_delegation_illegal_protocol', { protocol => scalar $callback_uri->scheme })
- unless $callback_uri->scheme eq 'https';
+ unless $callback_uri->scheme =~ $legal_protocol;
my $callback_base = $callback_uri->clone;
$callback_base->query(undef);
die "database not available" unless $database_ok;
die "memcached server(s) not available" unless $memcached_ok;
die "mod_perl not configured?" unless $ENV{MOD_PERL};
+ die "BUGZILLA_UNSAFE_AUTH_DELEGATION" if $ENV{BUGZILLA_UNSAFE_AUTH_DELEGATION};
1;
};
warn "heartbeat error: $@" if !$ok && $@;