Skip to content

Commit

Permalink
Merge pull request redpanda-data#15823 from vbotbuildovich/backport-p…
Browse files Browse the repository at this point in the history
…r-15817-v23.3.x-214

[v23.3.x] audit: Renamed audit log topic
  • Loading branch information
piyushredpanda committed Dec 21, 2023
2 parents 62757d6 + 73745fd commit 17ffb6f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
5 changes: 4 additions & 1 deletion src/v/cluster/tests/partition_balancer_planner_fixture.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "cluster/topic_updates_dispatcher.h"
#include "cluster/types.h"
#include "model/metadata.h"
#include "model/namespace.h"
#include "random/generators.h"
#include "test_utils/fixture.h"
#include "units.h"
Expand Down Expand Up @@ -65,7 +66,9 @@ struct controller_workers {
config::mock_binding<uint32_t>(uint32_t{partitions_reserve_shard0}),
config::mock_binding<std::vector<ss::sstring>>(
std::vector<ss::sstring>{
{"__audit_log", "__consumer_offsets", "_schemas"}}),
{model::kafka_audit_logging_topic,
"__consumer_offsets",
"_schemas"}}),
config::mock_binding<bool>(true))
.get();
// use node status that is not used in test as self is always available
Expand Down
3 changes: 2 additions & 1 deletion src/v/config/configuration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "config/node_config.h"
#include "config/validators.h"
#include "model/metadata.h"
#include "model/namespace.h"
#include "pandaproxy/schema_registry/schema_id_validation.h"
#include "security/gssapi_principal_mapper.h"
#include "security/mtls.h"
Expand Down Expand Up @@ -1244,7 +1245,7 @@ configuration::configuration()
"kafka_nodelete_topics",
"Prevents the topics in the list from being deleted via the kafka api",
{.needs_restart = needs_restart::no, .visibility = visibility::user},
{"__audit_log", "__consumer_offsets", "_schemas"},
{model::kafka_audit_logging_topic(), "__consumer_offsets", "_schemas"},
&validate_non_empty_string_vec)
, kafka_noproduce_topics(
*this,
Expand Down
2 changes: 1 addition & 1 deletion src/v/model/namespace.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ inline const model::topic kafka_consumer_offsets_topic("__consumer_offsets");
inline const model::topic_namespace kafka_consumer_offsets_nt(
model::kafka_namespace, kafka_consumer_offsets_topic);

inline const model::topic kafka_audit_logging_topic("__audit_log");
inline const model::topic kafka_audit_logging_topic("_redpanda.audit_log");

inline const model::topic_namespace
kafka_audit_logging_nt(model::kafka_namespace, kafka_audit_logging_topic);
Expand Down
8 changes: 4 additions & 4 deletions tests/rptest/tests/audit_log_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def user_cert(self) -> Optional[tls.Certificate]:

class AuditLogTestBase(RedpandaTest):
"""Base test object for testing the audit logs"""
audit_log = "__audit_log"
audit_log = "_redpanda.audit_log"
kafka_rpc_service_name = "kafka rpc protocol"
admin_audit_svc_name = "Redpanda Admin HTTP Server"
sr_audit_svc_name = "Redpanda Schema Registry Service"
Expand Down Expand Up @@ -759,7 +759,7 @@ def __init__(self, test_context):
@cluster(num_nodes=4)
def test_config_rejected(self):
"""
Ensures that attempting to add __audit_log to excluded topics will be
Ensures that attempting to add _redpanda.audit_log to excluded topics will be
rejected
"""
# Should pass
Expand Down Expand Up @@ -1490,10 +1490,10 @@ def contains_principal(principal: str, record):
assert r[
'class_uid'] == 6003, f'Should not see any ignored users in class {r["class_uid"]}'
assert {
"name": "__audit_log",
"name": self.audit_log,
"type": "topic"
} in r[
'resources'], 'Did not find __audit_log topic in resources'
'resources'], f'Did not find {self.audit_log} topic in resources'
except TimeoutError:
pass

Expand Down

0 comments on commit 17ffb6f

Please sign in to comment.