From bf7e50f91f5a8172a4ab0ab71263addca092fbf7 Mon Sep 17 00:00:00 2001 From: disqualifier Date: Mon, 6 Jul 2026 19:31:38 -0400 Subject: [PATCH] fix: list tolerates a null _id; declare the cryptography dependency A stored doc with a present-but-null _id crashed the whole list table: doc.get('_id', '')[:16] slices None (the '' default only applies when _id is absent), so one bad doc aborted the render - now uses (doc.get('_id') or '')[:16], mirroring revoke's finder, so it renders a blank placeholder row. cli.py imports cryptography.exceptions.InvalidTag but pyproject only pulled cryptography transitively via envelope_crypto - declare it directly. Signed-off-by: disqualifier --- pyproject.toml | 1 + src/envelope_authorizer/commands/list_keys.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bab698a..fb3a1b4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,6 +9,7 @@ description = "CLI key-authorization manager for envelope_crypto" requires-python = ">=3.10" dependencies = [ "envelope_crypto @ git+ssh://git@git.rethinkstudios.io/rethink-public/envelope_crypto.git", + "cryptography>=42.0", "tomli>=2.0; python_version<'3.11'", ] diff --git a/src/envelope_authorizer/commands/list_keys.py b/src/envelope_authorizer/commands/list_keys.py index e8a0e08..fd54011 100644 --- a/src/envelope_authorizer/commands/list_keys.py +++ b/src/envelope_authorizer/commands/list_keys.py @@ -40,7 +40,7 @@ def run(config, storage, args) -> None: for doc in docs: meta = doc_meta(doc) print( - f"{doc.get('_id', '')[:16]:<18} " + f"{(doc.get('_id') or '')[:16]:<18} " f"{str(meta.get('friendly', '-')):<16} " f"{str(meta.get('created_by', '-')):<18} " f"{_created(meta):<21} "