mirror of
https://github.com/zvx-echo6/central.git
synced 2026-05-22 02:24:38 +02:00
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:
parent
c6cbdb0825
commit
41439c52b3
2 changed files with 7 additions and 9 deletions
|
|
@ -1,16 +1,14 @@
|
||||||
"""CloudEvents configuration constants.
|
"""CloudEvents configuration constants.
|
||||||
|
|
||||||
These defaults are used when no TOML configuration file is available
|
These are the protocol-level constants for CloudEvents envelope format.
|
||||||
(e.g., when using database-backed configuration source).
|
CloudEvents envelope format is part of the Central protocol contract
|
||||||
|
and is not operator-configurable.
|
||||||
These values are baked into the code because CloudEvents envelope format
|
|
||||||
is part of the Central protocol contract, not operator-configurable.
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from central.config import CloudEventsConfig
|
from central.config import CloudEventsConfig
|
||||||
|
|
||||||
# Default CloudEvents configuration - used when TOML is unavailable
|
# CloudEvents protocol constants
|
||||||
DEFAULT_CLOUDEVENTS_CONFIG = CloudEventsConfig(
|
CLOUDEVENTS_CONFIG = CloudEventsConfig(
|
||||||
type_prefix="central",
|
type_prefix="central",
|
||||||
source="central.echo6.co",
|
source="central.echo6.co",
|
||||||
schema_version="1.0",
|
schema_version="1.0",
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ from typing import Any, Union
|
||||||
from cloudevents.v1.http import CloudEvent
|
from cloudevents.v1.http import CloudEvent
|
||||||
|
|
||||||
from central.config import Config, CloudEventsConfig
|
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
|
from central.models import Event
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -27,7 +27,7 @@ def wrap_event(
|
||||||
"""
|
"""
|
||||||
# Resolve CloudEventsConfig from various input types
|
# Resolve CloudEventsConfig from various input types
|
||||||
if config is None:
|
if config is None:
|
||||||
ce_config = DEFAULT_CLOUDEVENTS_CONFIG
|
ce_config = CLOUDEVENTS_CONFIG
|
||||||
elif isinstance(config, CloudEventsConfig):
|
elif isinstance(config, CloudEventsConfig):
|
||||||
ce_config = config
|
ce_config = config
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue