Ticket service issues lower-case ids (SCP-7)

The id a customer sees in replies now matches what forwarders and list
servers deliver. Existing upper-case tickets still match case-insensitively.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Assistant: claude-code
Assistant-Model: opus
Assistant-Process: 252470@bnt-lap001
Assistant-Session: ad628c8f-4be2-4979-94c9-76c7ed6f8241
This commit is contained in:
tegwick 2026-10-18 18:29:42 +02:00
parent 0f3a0da1c6
commit f78939af5c
2 changed files with 13 additions and 3 deletions

View file

@ -34,12 +34,16 @@ from mas_core.generator import resource_local_part
RESOURCE_TYPE = "ticket"
INTAKE_TARGET = "ticket"
_ALPHABET = "0123456789ABCDEFGHJKMNPQRSTVWXYZ" # Crockford base32, no I L O U
_ALPHABET = "0123456789abcdefghjkmnpqrstvwxyz" # Crockford base32, no i l o u
def default_ticket_id() -> str:
"""Non-guessable-preferred, per the great-service statute."""
return "GS-" + "".join(secrets.choice(_ALPHABET) for _ in range(10))
"""Non-guessable-preferred, per the great-service statute.
Lower case, so the address a customer sees is the one forwarders and
mailing lists deliver (spec 6.2, SCP-7).
"""
return "gs-" + "".join(secrets.choice(_ALPHABET) for _ in range(10))
SCHEMA = """

View file

@ -83,6 +83,12 @@ def test_canonical_lifecycle(env):
assert len(svc.outbox()) == before and len(svc.quarantine()) == 1
def test_default_ids_are_lower_case():
from ticket_service import default_ticket_id
tid = default_ticket_id()
assert tid == tid.lower() and tid.startswith("gs-") and len(tid) == 13
def test_lower_cased_id_correlates(env):
# IONOS forwards and Google Groups members arrive lower-cased (MAS-WP-0003 T04)
svc, send, *_ = env