From 41439c52b3e303a578eedd885ef4ed658a9c3636 Mon Sep 17 00:00:00 2001 From: Matt Johnson Date: Sat, 16 May 2026 03:08:09 +0000 Subject: [PATCH] refactor: rename DEFAULT_CLOUDEVENTS_CONFIG to CLOUDEVENTS_CONFIG These are protocol-level constants, not defaults that get overridden. Co-Authored-By: Claude Opus 4.5 --- src/central/cloudevents_constants.py | 12 +++++------- src/central/cloudevents_wire.py | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/central/cloudevents_constants.py b/src/central/cloudevents_constants.py index 3c69744..1a9d86e 100644 --- a/src/central/cloudevents_constants.py +++ b/src/central/cloudevents_constants.py @@ -1,16 +1,14 @@ """CloudEvents configuration constants. -These defaults are used when no TOML configuration file is available -(e.g., when using database-backed configuration source). - -These values are baked into the code because CloudEvents envelope format -is part of the Central protocol contract, not operator-configurable. +These are the protocol-level constants for CloudEvents envelope format. +CloudEvents envelope format is part of the Central protocol contract +and is not operator-configurable. """ from central.config import CloudEventsConfig -# Default CloudEvents configuration - used when TOML is unavailable -DEFAULT_CLOUDEVENTS_CONFIG = CloudEventsConfig( +# CloudEvents protocol constants +CLOUDEVENTS_CONFIG = CloudEventsConfig( type_prefix="central", source="central.echo6.co", schema_version="1.0", diff --git a/src/central/cloudevents_wire.py b/src/central/cloudevents_wire.py index 00b3bdf..f8e5630 100644 --- a/src/central/cloudevents_wire.py +++ b/src/central/cloudevents_wire.py @@ -5,7 +5,7 @@ from typing import Any, Union from cloudevents.v1.http import CloudEvent from central.config import Config, CloudEventsConfig -from central.cloudevents_constants import DEFAULT_CLOUDEVENTS_CONFIG +from central.cloudevents_constants import CLOUDEVENTS_CONFIG from central.models import Event @@ -27,7 +27,7 @@ def wrap_event( """ # Resolve CloudEventsConfig from various input types if config is None: - ce_config = DEFAULT_CLOUDEVENTS_CONFIG + ce_config = CLOUDEVENTS_CONFIG elif isinstance(config, CloudEventsConfig): ce_config = config else: