Add `nx sign` and `nx verify` for module releases

Open
#688 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
cli, security

Research direction

Read the related issues NexyPy/nexy#686 and #687 and the registry data contract in NexyPy/nx-registry#1 first; this issue defines signing and verification only. Identify the existing nx/nexy CLI entry points and release archive checksum flow. Done means signing and nx verify meet the listed acceptance criteria, including tampering, namespace ownership, key handling, and unsigned releases, with tests and a documentation page.

Written by the indexing model from the issue text.

Description

enhancement

Problem

A checksum proves that a downloaded archive was not corrupted in transit, but it does not prove who published it. A Nexy module can edit nexyconfig.py, install packages and run migrations, so a developer needs a way to verify the identity of a release before nx add writes anything.

Proposed solution

Add nx sign (also available as nexy sign) that signs a module release before publishing:

  • Sign the archive checksum, not the whole registry record, so the signature stays valid across metadata edits.
  • Support a local key stored outside the project and a keyless CI signature. The choice and the key format must be documented before implementation.
  • Embed the signer identity, the module name, the version and the checksum in the signature file.
  • Let nx publish carry the signature with the release; let nx add verify it before writing files.
  • Add nx verify <name>@<version> to check a release without installing it.
  • Refuse to verify when the signer does not match the namespace owner recorded by the registry.
  • Keep private keys out of the archive, the repository and terminal output.

Acceptance criteria:

  • A signed release verifies with nx verify and installs with nx add.
  • A changed archive fails verification before any file is written.
  • A signature from a signer who does not own the namespace is refused.
  • An unsigned release is clearly labelled as unsigned, and the project trust setting decides whether it may install.
  • Tests cover signing, verification, tampering, namespace mismatch, key handling and unsigned releases.
  • A docs page explains key storage, CI signing, verification and what the signature does not guarantee.

Alternative solutions

Publish checksums only and ask developers to compare them by hand. That detects corruption but not a replacement of both archive and checksum by the same attacker.

Additional context

This issue depends on NexyPy/nx-registry#1 for the registry data contract. nx publish in NexyPy/nexy#687 carries the signature and nx add in NexyPy/nexy#686 verifies it. This issue covers signing and verification only, not dependency installation or registry hosting.

Validation

  • I have searched existing issues and this is not a duplicate.
  • I would be willing to help implement this feature.
Dominant language
Python
Stars
11
Forks
6
Avg merge
2h 14m
Merged PRs (30d)
265

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NexyPy/nexy

All issues in NexyPy/nexy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.