From 387830084a0d22eef56a47906f3b0523be89164f Mon Sep 17 00:00:00 2001 From: disqualifier Date: Fri, 3 Jul 2026 16:15:53 -0400 Subject: [PATCH] fix: coerce null _id to empty string in revoke fingerprint match (v0.1.7) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit a key doc with an explicit `_id: null` made doc.get("_id", "") return None instead of the default, so .startswith(prefix) raised an uncaught AttributeError instead of the contracted clean [✘] + exit 1. Signed-off-by: disqualifier --- README.md | 8 ++++---- pyproject.toml | 2 +- src/envelope_authorizer/__init__.py | 2 +- src/envelope_authorizer/commands/revoke.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 926f198..cf70937 100644 --- a/README.md +++ b/README.md @@ -13,26 +13,26 @@ authorization system and the key-document schema; the crypto primitives live in ## Install ``` -envelope_authorizer @ git+ssh://git@git.rethinkstudios.io/rethink-public/envelope_authorizer.git@v0.1.6 +envelope_authorizer @ git+ssh://git@git.rethinkstudios.io/rethink-public/envelope_authorizer.git@v0.1.7 ``` Direct: ```bash -pip install "envelope_authorizer @ git+ssh://git@git.rethinkstudios.io/rethink-public/envelope_authorizer.git@v0.1.6" +pip install "envelope_authorizer @ git+ssh://git@git.rethinkstudios.io/rethink-public/envelope_authorizer.git@v0.1.7" ``` The base install uses a local JSON file for storage (stdlib only). For shared dev→server storage, install the mongo extra: ```bash -pip install "envelope_authorizer[mongo] @ git+ssh://git@git.rethinkstudios.io/rethink-public/envelope_authorizer.git@v0.1.6" +pip install "envelope_authorizer[mongo] @ git+ssh://git@git.rethinkstudios.io/rethink-public/envelope_authorizer.git@v0.1.7" ``` Installing pulls `envelope_crypto` (and `mongo` with the extra). After install, the `authorizer` command is on your PATH; `python -m envelope_authorizer` also works. -Drop the `@v0.1.6` suffix from the line above to install the latest unpinned. +Drop the `@v0.1.7` suffix from the line above to install the latest unpinned. ## Trust model (read this) diff --git a/pyproject.toml b/pyproject.toml index 1d672de..bab698a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "envelope_authorizer" -version = "0.1.6" +version = "0.1.7" description = "CLI key-authorization manager for envelope_crypto" requires-python = ">=3.10" dependencies = [ diff --git a/src/envelope_authorizer/__init__.py b/src/envelope_authorizer/__init__.py index 0a8da88..f1380ee 100644 --- a/src/envelope_authorizer/__init__.py +++ b/src/envelope_authorizer/__init__.py @@ -1 +1 @@ -__version__ = "0.1.6" +__version__ = "0.1.7" diff --git a/src/envelope_authorizer/commands/revoke.py b/src/envelope_authorizer/commands/revoke.py index f064c5f..a7b28b0 100644 --- a/src/envelope_authorizer/commands/revoke.py +++ b/src/envelope_authorizer/commands/revoke.py @@ -23,7 +23,7 @@ def _find_by_fingerprint(storage, prefix: str): """ if not prefix: raise CommandError("fingerprint prefix must not be empty") - matches = [doc for doc in storage.get_all() if doc.get("_id", "").startswith(prefix)] + matches = [doc for doc in storage.get_all() if (doc.get("_id") or "").startswith(prefix)] if len(matches) > 1: ids = ", ".join(d["_id"][:16] for d in matches) raise CommandError(f"fingerprint prefix '{prefix}' is ambiguous; matches: {ids}")