Skip to content

Commit

Permalink
rbac/fuzz: fix build (#4150)
Browse files Browse the repository at this point in the history
Signed-off-by: Stephan Zuercher <stephan@turbinelabs.io>
  • Loading branch information
zuercher authored and mattklein123 committed Aug 14, 2018
1 parent 07bc27c commit c3652aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
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

0 comments on commit c3652aa

Please sign in to comment.