|
1 | 1 | # Package Provenance and Publishing Integrity |
2 | 2 |
|
3 | | -This guide explains how PocketPay SDK releases should preserve package |
4 | | -provenance and how consumers can verify that an installed package came from the |
5 | | -official repository and release process. |
6 | | - |
7 | | -## Maintainer Release Practices |
8 | | - |
9 | | -- Publish only from the official `Axionvera/pocketpay-sdk` repository or a |
10 | | - documented release workflow owned by the project. |
11 | | -- Keep the package name, version, git tag, and changelog entry aligned before |
12 | | - publishing. |
13 | | -- Run the release checklist and verification script before any publish attempt. |
14 | | -- Prefer npm trusted publishing or provenance-enabled publishing when the |
15 | | - project adds an automated release workflow. |
16 | | -- Require maintainer review before changing package metadata, build scripts, |
17 | | - publish scripts, or release workflow files. |
18 | | - |
19 | | -## What Maintainers Should Avoid |
20 | | - |
21 | | -- Do not publish from an unreviewed local checkout, personal fork, or dirty |
22 | | - working tree. |
23 | | -- Do not paste npm tokens, one-time passwords, signing keys, or registry |
24 | | - credentials into issues, pull requests, logs, or documentation. |
25 | | -- Do not bypass `prepublishOnly`, build output review, or test verification to |
26 | | - speed up a release. |
27 | | -- Do not change `package.json` scripts or package entrypoints in the same PR as |
28 | | - an emergency publish unless reviewers explicitly approve the combined scope. |
| 3 | +This guide defines how PocketPay SDK releases should preserve package |
| 4 | +provenance, publishing integrity, and consumer trust. |
29 | 5 |
|
30 | | -## Consumer Verification |
| 6 | +## Goals |
| 7 | + |
| 8 | +- Make each published npm package traceable to the official repository. |
| 9 | +- Keep publishing credentials out of local machines, logs, issues, and pull |
| 10 | + requests. |
| 11 | +- Give consumers repeatable checks for package source and integrity. |
| 12 | +- Keep release metadata reviewable before a version is published. |
| 13 | + |
| 14 | +## Recommended Publishing Model |
| 15 | + |
| 16 | +Prefer npm trusted publishing with GitHub Actions provenance enabled for future |
| 17 | +SDK releases. In that model, maintainers publish from a protected release |
| 18 | +workflow instead of a local laptop, and npm records provenance that links the |
| 19 | +package back to the repository workflow run. |
| 20 | + |
| 21 | +When trusted publishing is not available, maintainers should still publish only |
| 22 | +from a clean checkout of the approved release commit and should record the |
| 23 | +commit, tag, package version, and verification evidence in the release PR. |
31 | 24 |
|
32 | | -Consumers can perform lightweight checks before upgrading: |
| 25 | +## Maintainer Rules |
33 | 26 |
|
34 | | -1. Confirm the package name and version match the release notes or git tag. |
35 | | -2. Inspect the npm package metadata for repository and provenance information |
36 | | - when available. |
37 | | -3. Compare the package contents against the documented public entrypoints and |
38 | | - expected `dist/` output. |
39 | | -4. Review dependency changes before installing in production applications. |
40 | | -5. Pin versions in lockfiles and upgrade through reviewed pull requests rather |
41 | | - than ad-hoc installs on production machines. |
| 27 | +- Do not commit npm tokens, GitHub tokens, `.env` files, or registry |
| 28 | + credentials. |
| 29 | +- Do not paste package tokens or one-time passwords into issues, pull requests, |
| 30 | + CI logs, or chat transcripts. |
| 31 | +- Do not publish from a branch with unreviewed changes. |
| 32 | +- Do not reuse, overwrite, or force-move release tags after publication. |
| 33 | +- Do not publish a package whose `npm pack --dry-run` output contains |
| 34 | + unexpected files. |
| 35 | +- Rotate any credential that may have appeared in logs or local shell history. |
42 | 36 |
|
43 | | -## Trusted Publishing Roadmap |
| 37 | +## Release Integrity Checklist |
| 38 | + |
| 39 | +Before publishing, maintainers should confirm: |
| 40 | + |
| 41 | +- The release commit is merged and tagged from the official repository. |
| 42 | +- `package.json` and `package-lock.json` contain the intended version. |
| 43 | +- `npm ci`, `npm run verify`, and applicable smoke checks pass. |
| 44 | +- `npm pack --dry-run` contains only intended package files. |
| 45 | +- The npm package name, version, license, entry points, and repository metadata |
| 46 | + match the reviewed source. |
| 47 | +- Any provenance or publishing workflow run is linked from the release notes. |
| 48 | + |
| 49 | +## Consumer Verification |
44 | 50 |
|
45 | | -The current release checklist documents a manual publish flow. If the project |
46 | | -adopts automated publishing later, the workflow should: |
| 51 | +Consumers who need stronger assurance can: |
47 | 52 |
|
48 | | -- run verification from a protected branch or signed tag, |
49 | | -- use npm trusted publishing or short-lived identity-based credentials, |
50 | | -- publish with provenance metadata enabled, |
51 | | -- avoid storing long-lived registry tokens in repository secrets when a safer |
52 | | - trusted-publishing path exists, and |
53 | | -- make release logs available without exposing secrets. |
| 53 | +- Compare the npm package version with the GitHub release tag. |
| 54 | +- Inspect npm provenance metadata when available. |
| 55 | +- Check that the package `repository` field points to the official repo. |
| 56 | +- Use lockfiles so package integrity hashes are reviewed and repeatable. |
| 57 | +- Reinstall in a clean environment when investigating supply-chain concerns. |
| 58 | +- Avoid packages with unexpected names, unpublished source, or missing release |
| 59 | + history. |
54 | 60 |
|
55 | | -## Related Documents |
| 61 | +## Incident Response |
56 | 62 |
|
57 | | -- [Release Checklist](./release-checklist.md) |
58 | | -- [Security Best Practices](./security.md) |
| 63 | +If a provenance or publishing-integrity issue is suspected, maintainers should |
| 64 | +pause further releases, preserve the affected package metadata, rotate relevant |
| 65 | +credentials, publish a corrective release if needed, and document consumer |
| 66 | +actions in the changelog or release notes. |
0 commit comments