Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions source/extensions/filters/common/rbac/engine_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ namespace Filters {
namespace Common {
namespace RBAC {

namespace {
const Envoy::Http::HeaderMapImpl empty_header = Envoy::Http::HeaderMapImpl();
const envoy::api::v2::core::Metadata empty_metadata = envoy::api::v2::core::Metadata();
} // namespace

RoleBasedAccessControlEngineImpl::RoleBasedAccessControlEngineImpl(
const envoy::config::rbac::v2alpha::RBAC& rules)
: allowed_if_matched_(rules.action() ==
Expand Down Expand Up @@ -45,7 +40,11 @@ bool RoleBasedAccessControlEngineImpl::allowed(const Network::Connection& connec
}

bool RoleBasedAccessControlEngineImpl::allowed(const Network::Connection& connection) const {
return allowed(connection, empty_header, empty_metadata, nullptr);
static const Http::HeaderMapImpl* empty_header = new Http::HeaderMapImpl();
static const envoy::api::v2::core::Metadata* empty_metadata =
new envoy::api::v2::core::Metadata();

return allowed(connection, *empty_header, *empty_metadata, nullptr);
}

} // namespace RBAC
Expand Down
2 changes: 1 addition & 1 deletion test/fuzz/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ inline Http::TestHeaderMapImpl fromHeaders(const test::fuzz::Headers& headers) {
}

// Convert from HeaderMap to test proto Headers.
inline test::fuzz::Headers toHeaders(const Http::HeaderMapImpl headers) {
inline test::fuzz::Headers toHeaders(const Http::HeaderMap& headers) {
test::fuzz::Headers fuzz_headers;
headers.iterate(
[](const Http::HeaderEntry& header, void* ctxt) -> Http::HeaderMap::Iterate {
Expand Down