test(satellite): scaffold per-id secret topology entries
This commit is contained in:
1 parent
6a6cfadd95
commit
eeeefd5ad5
2 files changed
+23
No files matched your search
@@ -98,7 +98,15 @@ def generate_reflector_conf(name: str) -> str:
|
|||||||
lines += [
|
lines += [
|
||||||
"[SATELLITE]",
|
"[SATELLITE]",
|
||||||
f"LISTEN_PORT={T.SATELLITE['listen_port']}",
|
f"LISTEN_PORT={T.SATELLITE['listen_port']}",
|
||||||
|
# Default/fallback secret — used by satellites that do not
|
||||||
|
# match any SECRET_<id>= entry below.
|
||||||
f"SECRET={T.SATELLITE['secret']}",
|
f"SECRET={T.SATELLITE['secret']}",
|
||||||
|
# Per-id secret for SAT_PINNED.
|
||||||
|
f"SECRET_{T.SATELLITE_PINNED_ID}={T.SATELLITE_PINNED_SECRET}",
|
||||||
|
# Intentionally malformed id key — the parent must warn and
|
||||||
|
# ignore this at startup. SAT_BAD_KEY_ID still falls through
|
||||||
|
# to the default SECRET above when it connects.
|
||||||
|
f"{T.SATELLITE_BAD_KEY}={T.SATELLITE_BAD_VALUE}",
|
||||||
"",
|
"",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -66,6 +66,21 @@ SATELLITE = {
|
|||||||
"listen_port": 5303,
|
"listen_port": 5303,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Extra satellite identities used by tests/test_satellite_secrets.py.
|
||||||
|
# - SAT_PINNED has its own SECRET_<id>=... entry in the parent's
|
||||||
|
# [SATELLITE] section.
|
||||||
|
# - SAT_UNPINNED has no per-id entry; it falls through to the default
|
||||||
|
# [SATELLITE].SECRET.
|
||||||
|
# - SAT_BAD_KEY_ID is the *id* used to verify that a malformed
|
||||||
|
# SECRET_<bad.id>=... key is ignored at startup; this satellite uses
|
||||||
|
# the default secret too.
|
||||||
|
SATELLITE_PINNED_ID = "SAT_PINNED"
|
||||||
|
SATELLITE_PINNED_SECRET = "secret_pinned"
|
||||||
|
SATELLITE_UNPINNED_ID = "SAT_UNPINNED"
|
||||||
|
SATELLITE_BAD_KEY_ID = "bad.id"
|
||||||
|
SATELLITE_BAD_KEY = f"SECRET_{SATELLITE_BAD_KEY_ID}"
|
||||||
|
SATELLITE_BAD_VALUE = "ignored_by_startup_validator"
|
||||||
|
|
||||||
# A real satellite-mode reflector — runs as a satellite of the primary
|
# A real satellite-mode reflector — runs as a satellite of the primary
|
||||||
# reflector. Used to verify that satellite mode preserves features like
|
# reflector. Used to verify that satellite mode preserves features like
|
||||||
# MQTT publishing and the V2 client server.
|
# MQTT publishing and the V2 client server.
|
||||||
|
|||||||
Reference in new issue
Block a user