Skip to content

Signing: rename _canonical.py etc. to match sibling-package convention #189

Description

@bokelley

Follow-up from the expert review of #183.

Problem

The signing module uses underscore-prefixed module names (`_canonical.py`, `_crypto.py`, `_digest.py`, `_errors.py`, `_jwks.py`, `_middleware.py`, `_replay.py`, `_revocation.py`, `_signer.py`, `_verifier.py`). This doesn't match the rest of the repo's convention:

  • `adcp/server/` uses `test_controller.py`, `responses.py`, etc. — plain names.
  • `adcp/protocols/` uses `base.py`, `a2a.py`, `mcp.py` — plain names.
  • `adcp/utils/` same.
  • `adcp/testing/` same.

The only precedent for `_`-prefixed modules in the repo is `adcp/types/`, and that's explicitly documented in CLAUDE.md as a layering policy for auto-generated schema types — not a general 'internal module' convention.

Tests also import from `adcp.signing._canonical`, `adcp.signing._crypto`, `adcp.signing._replay` directly — if a test needs it, the module arguably isn't private.

Fix

Rename:

  • `_canonical.py` → `canonical.py`
  • `_crypto.py` → `crypto.py`
  • `_digest.py` → `digest.py`
  • `_errors.py` → `errors.py`
  • `_jwks.py` → `jwks.py`
  • `_middleware.py` → `middleware.py`
  • `_replay.py` → `replay.py`
  • `_revocation.py` → `revocation.py`
  • `_signer.py` → `signer.py`
  • `_verifier.py` → `verifier.py`

Update imports across src and tests. Keep the `init.py` re-export layer.

Why this wasn't done in #183

The rename touches ~30 import statements across 12 source files and 7 test files. Bundled with the security/correctness fixes from the expert review it would've made the PR much harder to review. Doing it as a standalone PR lets the diff speak for itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions