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 <noreply@anthropic.com>
This commit is contained in:
Matt Johnson 2026-05-16 03:08:09 +00:00
commit 41439c52b3
2 changed files with 7 additions and 9 deletions

View file

@ -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",

View file

@ -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: