S-19a · ACL writes the RegisterRecord to Objecten on approval (closes #149) #151
@@ -77,6 +77,14 @@ def main():
|
||||
if ok:
|
||||
print(f"OK — approval wrote the register record to Objecten: {detail}")
|
||||
return 0
|
||||
except urllib.error.HTTPError as e:
|
||||
# A 4xx is us, not a cold start — retrying just hides the reason until the deadline.
|
||||
# (A rejected objecttype URL shows up here as a 400 with a very specific body.)
|
||||
body = e.read().decode(errors="replace")[:400]
|
||||
if e.code < 500:
|
||||
print(f"FAIL — HTTP {e.code} from {e.url}: {body}", file=sys.stderr)
|
||||
return 1
|
||||
detail = f"HTTP {e.code}: {body}"
|
||||
except (urllib.error.URLError, ConnectionError, TimeoutError) as e:
|
||||
detail = f"transport: {e}"
|
||||
time.sleep(3)
|
||||
|
||||
@@ -146,15 +146,21 @@ echo "OK — behandelaar claimed and completed the Beoordelen task; the registra
|
||||
# Assert it for THIS registration (matched on its reference) rather than "some INGESCHREVEN record":
|
||||
# the shared verify stack carries records from earlier runs. The container-name filters are anchored
|
||||
# on the compose replica suffix so they don't also match objecten-db / objecttypen-db.
|
||||
#
|
||||
# Unlike every other check here, these two are reached by SERVICE NAME, not container IP. Objecttypen
|
||||
# echoes the request Host into the objecttype `url`, and Objecten only accepts the objecttype URL that
|
||||
# matches its configured api_root (http://objecttypen:8000/api/v2/) — an IP-addressed lookup yields a
|
||||
# URL Objecten rejects with 400 (ADR-0028). Compose DNS resolves both names on this network, and
|
||||
# neither request has OpenZaak's URL-validity constraint.
|
||||
echo ">> asserting the approval wrote the register record to Objecten (S-19a)"
|
||||
obj="$(docker ps -q --filter 'name=objecten[-_][0-9]+$' | head -1)"
|
||||
objt="$(docker ps -q --filter 'name=objecttypen[-_][0-9]+$' | head -1)"
|
||||
[ -n "$obj" ] || { echo "FAIL — no running objecten container" >&2; exit 1; }
|
||||
[ -n "$objt" ] || { echo "FAIL — no running objecttypen container" >&2; exit 1; }
|
||||
rr="$(docker create --network "$net" \
|
||||
-e "OBJECTEN=http://$(ip "$obj"):8000" \
|
||||
-e "OBJECTEN=http://objecten:8000" \
|
||||
-e "OBJECTEN_TOKEN=${OBJECTEN_TOKEN:-1234567890abcdef1234567890abcdef12345678}" \
|
||||
-e "OBJECTTYPEN=http://$(ip "$objt"):8000" \
|
||||
-e "OBJECTTYPEN=http://objecttypen:8000" \
|
||||
-e "OBJECTTYPEN_TOKEN=${OBJECTTYPEN_TOKEN:-0123456789abcdef0123456789abcdef01234567}" \
|
||||
-e "REGISTRATION_REFERENCE=$reg_id" \
|
||||
python:3-slim python /register-record-check.py)"
|
||||
|
||||
Reference in New Issue
Block a user