jwt-toolkit 1.2.1__tar.gz → 1.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. jwt_toolkit-1.3.0/.github/dependabot.yml +68 -0
  2. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/.github/workflows/ci.yml +34 -4
  3. jwt_toolkit-1.3.0/.github/workflows/pr-title.yml +23 -0
  4. jwt_toolkit-1.3.0/.github/workflows/publish.yml +142 -0
  5. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/.gitignore +3 -0
  6. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/.pre-commit-config.yaml +13 -0
  7. jwt_toolkit-1.3.0/.release-please-manifest.json +3 -0
  8. jwt_toolkit-1.3.0/CHANGELOG.md +130 -0
  9. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/CONTRIBUTING.md +18 -8
  10. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/Makefile +11 -3
  11. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/PKG-INFO +31 -3
  12. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/README.md +30 -2
  13. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/__init__.py +1 -1
  14. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/cli/console.py +15 -3
  15. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/cli/credentials.py +6 -8
  16. jwt_toolkit-1.3.0/jwt_toolkit/cli/decoding.py +75 -0
  17. jwt_toolkit-1.3.0/jwt_toolkit/cli/errors.py +62 -0
  18. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/commands/audit.py +7 -24
  19. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/commands/crack.py +9 -19
  20. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/commands/decode.py +3 -3
  21. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/commands/diff.py +18 -19
  22. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/commands/download_wordlists.py +45 -41
  23. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/commands/forge.py +8 -9
  24. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/commands/generate_secret.py +10 -7
  25. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/commands/sign.py +70 -74
  26. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/commands/verify.py +20 -41
  27. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/core/crypto.py +30 -17
  28. jwt_toolkit-1.3.0/jwt_toolkit/core/errors.py +160 -0
  29. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/core/forge.py +10 -3
  30. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/core/jwks.py +56 -32
  31. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/pyproject.toml +4 -2
  32. jwt_toolkit-1.3.0/release-please-config.json +35 -0
  33. jwt_toolkit-1.3.0/scripts/check_commit_message.py +85 -0
  34. jwt_toolkit-1.3.0/scripts/package_check.py +165 -0
  35. jwt_toolkit-1.3.0/scripts/run_cliprobe.py +77 -0
  36. jwt_toolkit-1.3.0/scripts/smoke_installed.py +172 -0
  37. jwt_toolkit-1.3.0/tests/test_cmd_errors.py +231 -0
  38. jwt_toolkit-1.3.0/tests/test_cmd_global_flags.py +138 -0
  39. jwt_toolkit-1.3.0/tests/test_errors.py +110 -0
  40. jwt_toolkit-1.3.0/tests/test_repo_dependabot.py +27 -0
  41. jwt_toolkit-1.3.0/tests/test_repo_release.py +142 -0
  42. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/uv.lock +263 -1
  43. jwt_toolkit-1.2.1/.github/dependabot.yml +0 -25
  44. jwt_toolkit-1.2.1/.github/workflows/publish.yml +0 -93
  45. jwt_toolkit-1.2.1/jwt_toolkit/cli/decoding.py +0 -118
  46. jwt_toolkit-1.2.1/jwt_toolkit/core/errors.py +0 -59
  47. jwt_toolkit-1.2.1/tests/test_cmd_global_flags.py +0 -67
  48. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/.editorconfig +0 -0
  49. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/.gitattributes +0 -0
  50. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  51. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  52. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/.github/ISSUE_TEMPLATE/documentation.yml +0 -0
  53. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  54. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  55. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/.python-version +0 -0
  56. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/LICENSE +0 -0
  57. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/SECURITY.md +0 -0
  58. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/cli/__init__.py +0 -0
  59. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/cli/algorithms.py +0 -0
  60. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/cli/banner.py +0 -0
  61. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/cli/panels.py +0 -0
  62. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/cli/wordlists.py +0 -0
  63. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/commands/__init__.py +0 -0
  64. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/core/__init__.py +0 -0
  65. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/core/auditor.py +0 -0
  66. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/core/claims.py +0 -0
  67. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/core/cracker.py +0 -0
  68. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/core/decoder.py +0 -0
  69. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/core/diff.py +0 -0
  70. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/core/encoding.py +0 -0
  71. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/core/lifetime.py +0 -0
  72. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/core/timestamps.py +0 -0
  73. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/core/wordlist.py +0 -0
  74. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/jwt_toolkit/py.typed +0 -0
  75. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/tests/__init__.py +0 -0
  76. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/tests/conftest.py +0 -0
  77. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/tests/helpers.py +0 -0
  78. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/tests/test_auditor.py +0 -0
  79. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/tests/test_claims.py +0 -0
  80. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/tests/test_cmd_audit.py +0 -0
  81. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/tests/test_cmd_crack.py +0 -0
  82. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/tests/test_cmd_decode.py +0 -0
  83. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/tests/test_cmd_diff.py +0 -0
  84. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/tests/test_cmd_download_wordlists.py +0 -0
  85. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/tests/test_cmd_forge.py +0 -0
  86. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/tests/test_cmd_generate_secret.py +0 -0
  87. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/tests/test_cmd_sign.py +0 -0
  88. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/tests/test_cmd_verify.py +0 -0
  89. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/tests/test_cracker.py +0 -0
  90. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/tests/test_credentials.py +0 -0
  91. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/tests/test_crypto.py +0 -0
  92. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/tests/test_crypto_asymmetric.py +0 -0
  93. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/tests/test_decoder.py +0 -0
  94. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/tests/test_diff.py +0 -0
  95. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/tests/test_encoding.py +0 -0
  96. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/tests/test_forge.py +0 -0
  97. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/tests/test_jwks.py +0 -0
  98. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/tests/test_lifetime.py +0 -0
  99. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/tests/test_markup_escaping.py +0 -0
  100. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/tests/test_package.py +0 -0
  101. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/tests/test_timestamps.py +0 -0
  102. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/tests/test_wordlist.py +0 -0
  103. {jwt_toolkit-1.2.1 → jwt_toolkit-1.3.0}/wordlists/common-secrets.txt +0 -0
@@ -0,0 +1,68 @@
1
+ # Dependency updates: grouped pull requests, once a week.
2
+ #
3
+ # Commit types are chosen so that merging an update never cuts a release on its
4
+ # own: release-please releases on feat, fix, security, perf, revert and docs, and
5
+ # these use build and ci. An update ships with the next release of real changes.
6
+ # Merge with "squash and merge", like any other pull request; the PR title is the
7
+ # commit message release-please reads.
8
+ version: 2
9
+
10
+ updates:
11
+ - package-ecosystem: uv # reads pyproject.toml and uv.lock
12
+ directory: /
13
+ schedule:
14
+ interval: weekly
15
+ day: monday
16
+ time: "06:00"
17
+ # Skip versions published in the last week, so a bad or compromised release
18
+ # has time to be pulled before it reaches the lockfile.
19
+ cooldown:
20
+ default-days: 7
21
+ # Update the lockfile only. The lower bounds in pyproject.toml stay low so
22
+ # users can resolve click, cryptography and rich alongside their other tools;
23
+ # raise a bound by hand (as a fix or security commit) when a CVE requires it.
24
+ versioning-strategy: lockfile-only
25
+ commit-message:
26
+ prefix: build
27
+ prefix-development: build
28
+ include: scope # build(deps): ... and build(deps-dev): ...
29
+ groups:
30
+ # Minor and patch updates: one pull request each, usually a straight merge.
31
+ runtime:
32
+ dependency-type: production
33
+ update-types: [minor, patch]
34
+ dev-dependencies:
35
+ dependency-type: development
36
+ update-types: [minor, patch]
37
+ # Major updates: separate pull requests, since they may need code changes.
38
+ runtime-major:
39
+ dependency-type: production
40
+ update-types: [major]
41
+ dev-dependencies-major:
42
+ dependency-type: development
43
+ update-types: [major]
44
+ # Security updates are batched as well, but never wait for the cooldown.
45
+ security:
46
+ applies-to: security-updates
47
+ patterns: ["*"]
48
+
49
+ - package-ecosystem: github-actions
50
+ directory: /
51
+ schedule:
52
+ interval: weekly
53
+ day: monday
54
+ time: "06:00"
55
+ cooldown:
56
+ default-days: 7
57
+ # Actions are pinned to full commit SHAs with the version in a comment;
58
+ # Dependabot updates both.
59
+ commit-message:
60
+ prefix: ci
61
+ include: scope # ci(deps): ...
62
+ groups:
63
+ github-actions:
64
+ patterns: ["*"]
65
+ update-types: [minor, patch]
66
+ github-actions-major:
67
+ patterns: ["*"]
68
+ update-types: [major]
@@ -23,7 +23,7 @@ jobs:
23
23
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
24
24
  with:
25
25
  persist-credentials: false
26
- - uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
26
+ - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
27
27
  with:
28
28
  enable-cache: true
29
29
  - name: Install dev dependencies
@@ -42,7 +42,7 @@ jobs:
42
42
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
43
43
  with:
44
44
  persist-credentials: false
45
- - uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
45
+ - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
46
46
  with:
47
47
  enable-cache: true
48
48
  - run: uv sync --locked --group dev
@@ -55,7 +55,7 @@ jobs:
55
55
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
56
56
  with:
57
57
  persist-credentials: false
58
- - uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
58
+ - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
59
59
  with:
60
60
  enable-cache: true
61
61
  - run: uv sync --locked --group dev
@@ -84,7 +84,7 @@ jobs:
84
84
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
85
85
  with:
86
86
  persist-credentials: false
87
- - uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
87
+ - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
88
88
  with:
89
89
  enable-cache: true
90
90
  python-version: ${{ matrix.python-version }}
@@ -98,3 +98,33 @@ jobs:
98
98
  name: coverage
99
99
  path: coverage.xml
100
100
  if-no-files-found: ignore
101
+
102
+ package:
103
+ name: Package (${{ matrix.os }})
104
+ runs-on: ${{ matrix.os }}
105
+ strategy:
106
+ fail-fast: false
107
+ matrix:
108
+ os: [ubuntu-latest, windows-latest, macos-latest]
109
+ steps:
110
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
111
+ with:
112
+ persist-credentials: false
113
+ - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
114
+ with:
115
+ enable-cache: true
116
+ python-version: "3.13"
117
+ - run: uv sync --locked --group dev
118
+ # Builds both artifacts, checks their contents and metadata, then runs the
119
+ # installed entry point from fresh venvs outside the repository.
120
+ - name: Build, check and smoke-test the installed package
121
+ run: uv run python scripts/package_check.py --keep-venv "${{ runner.temp }}/pkg-env"
122
+ - name: Set up Node for cliprobe
123
+ if: runner.os == 'Linux'
124
+ uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
125
+ with:
126
+ node-version: "24"
127
+ # --strict: a warning (color in a pipe, NO_COLOR ignored, a prompt) fails too.
128
+ - name: cliprobe self-check
129
+ if: runner.os == 'Linux'
130
+ run: uv run python scripts/run_cliprobe.py --strict "${{ runner.temp }}/pkg-env"
@@ -0,0 +1,23 @@
1
+ name: PR title
2
+
3
+ # Squash merges use the PR title as the commit message on main, and release-please
4
+ # reads it to pick the next version, so the title must follow Conventional Commits.
5
+ on:
6
+ pull_request:
7
+ types: [opened, edited, reopened, synchronize]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ title:
14
+ name: Conventional PR title
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
18
+ with:
19
+ persist-credentials: false
20
+ - name: Check the title
21
+ env:
22
+ TITLE: ${{ github.event.pull_request.title }}
23
+ run: python3 scripts/check_commit_message.py --max-length 100 --title "$TITLE"
@@ -0,0 +1,142 @@
1
+ # The file name and the `pypi` environment are registered with PyPI Trusted
2
+ # Publishing; renaming either breaks publishing until PyPI is updated too.
3
+ name: Release
4
+
5
+ on:
6
+ # release-please keeps a release PR up to date. Merging it tags the commit,
7
+ # creates the GitHub Release, and this same run validates, builds and publishes.
8
+ # (A release made with GITHUB_TOKEN cannot trigger another workflow.)
9
+ push:
10
+ branches: [main]
11
+ # Recovery for an existing release tag: gh workflow run publish.yml --ref vX.Y.Z
12
+ workflow_dispatch:
13
+
14
+ permissions:
15
+ contents: read
16
+
17
+ concurrency:
18
+ group: release-${{ github.ref }}
19
+ cancel-in-progress: false
20
+
21
+ jobs:
22
+ release-please:
23
+ name: Release PR and tag
24
+ if: github.event_name == 'push'
25
+ runs-on: ubuntu-latest
26
+ permissions:
27
+ contents: write
28
+ pull-requests: write
29
+ outputs:
30
+ release_created: ${{ steps.release.outputs.release_created }}
31
+ tag_name: ${{ steps.release.outputs.tag_name }}
32
+ steps:
33
+ - uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
34
+ id: release
35
+ with:
36
+ config-file: release-please-config.json
37
+ manifest-file: .release-please-manifest.json
38
+
39
+ target:
40
+ name: Pick the release to publish
41
+ needs: release-please
42
+ if: >-
43
+ always() && needs.release-please.result != 'failure' && (
44
+ github.event_name == 'workflow_dispatch' ||
45
+ needs.release-please.outputs.release_created == 'true')
46
+ runs-on: ubuntu-latest
47
+ outputs:
48
+ tag: ${{ steps.pick.outputs.tag }}
49
+ steps:
50
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
51
+ with:
52
+ persist-credentials: false
53
+ fetch-depth: 0
54
+ - name: Resolve and check the release tag
55
+ id: pick
56
+ env:
57
+ EVENT: ${{ github.event_name }}
58
+ REF_TYPE: ${{ github.ref_type }}
59
+ REF_NAME: ${{ github.ref_name }}
60
+ NEW_TAG: ${{ needs.release-please.outputs.tag_name }}
61
+ SHA: ${{ github.sha }}
62
+ run: |
63
+ if [ "$EVENT" = "workflow_dispatch" ]; then
64
+ if [ "$REF_TYPE" != "tag" ]; then
65
+ echo "::error::Run the recovery publish on a release tag: gh workflow run publish.yml --ref vX.Y.Z"
66
+ exit 1
67
+ fi
68
+ tag="$REF_NAME"
69
+ else
70
+ tag="$NEW_TAG"
71
+ git fetch --quiet origin "refs/tags/$tag:refs/tags/$tag"
72
+ fi
73
+ if [ "$(git rev-parse "refs/tags/$tag^{commit}")" != "$SHA" ]; then
74
+ echo "::error::Tag $tag does not point at the commit this run validates ($SHA)"
75
+ exit 1
76
+ fi
77
+ echo "tag=$tag" >> "$GITHUB_OUTPUT"
78
+
79
+ # The full CI gate (lint, types, security, tests on every OS and Python, package
80
+ # smoke test) on the exact commit being released.
81
+ validate:
82
+ name: Validate release commit
83
+ needs: target
84
+ permissions:
85
+ contents: read
86
+ # The newer self-repository form ($/...) is not verified for job-level reusable
87
+ # workflows yet, and this path only runs at release time, so keep the proven form.
88
+ uses: ./.github/workflows/ci.yml # zizmor: ignore[self-repository]
89
+
90
+ build:
91
+ name: Build distribution
92
+ needs: [target, validate]
93
+ runs-on: ubuntu-latest
94
+ steps:
95
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
96
+ with:
97
+ persist-credentials: false
98
+ ref: ${{ needs.target.outputs.tag }}
99
+ - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
100
+ with:
101
+ # A release build never restores a cache another run could have written.
102
+ enable-cache: false
103
+ - name: Require the tag to match the package version
104
+ env:
105
+ TAG: ${{ needs.target.outputs.tag }}
106
+ run: |
107
+ version="$(uv version --short)"
108
+ if [ "$TAG" != "v$version" ]; then
109
+ echo "::error::Tag $TAG does not match the package version $version"
110
+ exit 1
111
+ fi
112
+ - name: Build sdist + wheel
113
+ run: uv build
114
+ - name: Check package metadata
115
+ run: uvx twine check --strict dist/*
116
+ - name: Upload build artifacts
117
+ uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
118
+ with:
119
+ name: dist
120
+ path: dist/
121
+
122
+ publish:
123
+ name: Publish to PyPI
124
+ needs: build
125
+ runs-on: ubuntu-latest
126
+ environment:
127
+ name: pypi
128
+ url: https://pypi.org/p/jwt-toolkit
129
+ permissions:
130
+ id-token: write
131
+ attestations: write
132
+ contents: read
133
+ steps:
134
+ - name: Download build artifacts
135
+ uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
136
+ with:
137
+ name: dist
138
+ path: dist/
139
+ - name: Publish to PyPI (Trusted Publishing + PEP 740 attestations)
140
+ uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
141
+ with:
142
+ attestations: true
@@ -225,3 +225,6 @@ __marimo__/
225
225
 
226
226
  # Private planning notes
227
227
  /.project-planning/
228
+
229
+ # Venv kept by `make cliprobe`.
230
+ /.smoke-env/
@@ -5,6 +5,10 @@
5
5
  # Hooks are pinned by rev for reproducibility. Bump with:
6
6
  # uv run pre-commit autoupdate
7
7
 
8
+ # `pre-commit install` sets up both hook types: style checks on commit, and the
9
+ # Conventional Commits check on the message (release-please reads those messages).
10
+ default_install_hook_types: [pre-commit, commit-msg]
11
+
8
12
  repos:
9
13
  # General hygiene
10
14
  - repo: https://github.com/pre-commit/pre-commit-hooks
@@ -38,3 +42,12 @@ repos:
38
42
 
39
43
  # Mypy and pip-audit run in CI rather than pre-commit:
40
44
  # mypy is slow on cold cache, pip-audit needs network.
45
+
46
+ # Commit message rules shared with the PR-title check in CI.
47
+ - repo: local
48
+ hooks:
49
+ - id: conventional-commit-message
50
+ name: conventional commit message
51
+ entry: python scripts/check_commit_message.py --file
52
+ language: python
53
+ stages: [commit-msg]
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "1.3.0"
3
+ }
@@ -0,0 +1,130 @@
1
+ # Changelog
2
+
3
+ All notable changes to jwt-toolkit. New entries are written by release-please from Conventional Commit messages; entries up to 1.2.1 were copied from the GitHub release notes.
4
+
5
+ ## [1.3.0](https://github.com/KhaledSaeed18/jwt-toolkit/compare/v1.2.1...v1.3.0) (2026-11-23)
6
+
7
+
8
+ ### Features
9
+
10
+ * **cli:** report a specific cause code next to broad --json error codes ([34dabae](https://github.com/KhaledSaeed18/jwt-toolkit/commit/34dabaef92005971473ed031da1e367dfdbb0e19))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **cli:** emit no escape codes under NO_COLOR and --no-color ([#58](https://github.com/KhaledSaeed18/jwt-toolkit/issues/58)) ([0a6384d](https://github.com/KhaledSaeed18/jwt-toolkit/commit/0a6384dc8c8438eecd5b1bc6c3ced56304a6a05f))
16
+
17
+
18
+ ### Security
19
+
20
+ * **cli:** never echo credentials from JWKS or wordlist source URLs ([34dabae](https://github.com/KhaledSaeed18/jwt-toolkit/commit/34dabaef92005971473ed031da1e367dfdbb0e19))
21
+
22
+ ## [1.2.1](https://github.com/KhaledSaeed18/jwt-toolkit/compare/v1.2.0...v1.2.1) (2026-11-23)
23
+
24
+ ### Fixes
25
+
26
+ - **Malformed tokens are rejected on Python 3.15.** Python 3.15 stopped rejecting characters outside the base64 alphabet, so a token segment such as `ab!c` decoded to bytes instead of failing. jwt-toolkit now checks the RFC 7515 base64url alphabet itself, so every supported Python rejects such tokens (exit code 2). This also applies to `crack --encoding base64` wordlist entries. ([#55](https://github.com/KhaledSaeed18/jwt-toolkit/pull/55))
27
+ - **`download-wordlists` on Windows.** The bundled wordlist stays byte-exact on Windows checkouts, so its pinned SHA-256 matches. ([#55](https://github.com/KhaledSaeed18/jwt-toolkit/pull/55))
28
+
29
+ ### Platform support
30
+
31
+ CI now tests CPython 3.13, 3.14 and 3.15 on Linux and Windows, plus 3.13 on macOS. Workflows are hardened: read-only token, SHA-pinned actions, zizmor, and no cache in the publish job. ([#55](https://github.com/KhaledSaeed18/jwt-toolkit/pull/55))
32
+
33
+ No changes to the CLI grammar, `--json` output (`schema_version` is still `0.1`), error codes or exit codes.
34
+
35
+ ## [1.2.0](https://github.com/KhaledSaeed18/jwt-toolkit/compare/v1.1.0...v1.2.0) (2026-10-19)
36
+
37
+ Hardening release from an end-to-end review of 1.1.0. No `--json` field was renamed or removed (`schema_version` stays `0.1`), and there are no new dependencies.
38
+
39
+ ### Behavior changes
40
+
41
+ - **`verify` reports attack-shaped tokens as invalid.** A token with `alg: none`, an unknown or mis-cased `alg`, or an `alg` from the other key family than the one you supplied (algorithm confusion, CVE-2016-10555) now fails the signature check and exits **1** with a normal verify report. It used to exit **2** with an error document. Both reject the token; exit 2 remains for operator errors such as no key or two keys.
42
+ - **`audit --secret` grades F for a guessable secret.** When the secret verifies the token and is in the bundled common-secrets list, the audit reports it as CRITICAL.
43
+
44
+ ### New
45
+
46
+ - `audit` checks supplied key material: secrets from the common-secrets list (CRITICAL), secrets shorter than RFC 7518 3.2 requires (WARN), RSA keys under 2048 bits (CRITICAL). It also flags stripped signatures, gives `x5c` its own rule, and checks `iss`/`sub`/`aud` types.
47
+ - `crack --json` for CI, with new error codes `signature_missing`, `wordlist_missing`, `wordlist_unreadable`, and `wordlist_empty`.
48
+ - Tokens pasted as `Bearer <jwt>` work in every command.
49
+ - `sign --private-key` without `--alg` picks the algorithm from the key (RS256, ES256/384/512, Ed25519, Ed448).
50
+ - `verify --jwks-url` refuses keys published for encryption, responses over 1 MiB, and https-to-http redirects, and warns when keys come over plain `http://`.
51
+
52
+ ### Fixed
53
+
54
+ - `--quiet` no longer hides results and errors (`--quiet generate-secret` printed nothing).
55
+ - Errors and progress go to stderr, so `sign ... > token.jwt` no longer captures an error panel.
56
+ - No more tracebacks on non-ASCII signatures, a directory as the `crack` wordlist, binary `@file` tokens, or malformed JWKS entries.
57
+ - `crack --output` saves the exact secret, readable by its owner only.
58
+ - `download-wordlists --force` keeps the existing copy when a download fails its checksum or is interrupted.
59
+ - `forge` emits JSON errors under `--json` and refuses a private key passed as `--public-key`.
60
+
61
+ ### Internal
62
+
63
+ mypy strict mode, claim checks and wordlist streaming moved into `core/`, pre-commit hooks synced with `uv.lock`, and CI installs with `--locked`.
64
+
65
+ ## [1.1.0](https://github.com/KhaledSaeed18/jwt-toolkit/compare/v1.0.0...v1.1.0) (2026-10-17)
66
+
67
+ ### Highlights
68
+
69
+ - **New `diff` command.** Compare two tokens field by field, with JSON Pointer paths and identity, permission, and lifetime fields highlighted. Supports `--json` and `--exit-code`. ([#37](https://github.com/KhaledSaeed18/jwt-toolkit/pull/37))
70
+ - **EdDSA support.** `Ed25519`, `Ed448`, and `EdDSA` in `sign`, `verify`, `audit`, and JWKS (`kty: OKP`). ([#33](https://github.com/KhaledSaeed18/jwt-toolkit/pull/33))
71
+ - **`crack` works out of the box.** The curated wordlist ships with the package and is used when no wordlist is given. ([#34](https://github.com/KhaledSaeed18/jwt-toolkit/pull/34)) Candidates are checked in worker processes, which ran about twice as fast in our 5M-candidate test. ([#28](https://github.com/KhaledSaeed18/jwt-toolkit/pull/28))
72
+ - **Safer and easier inputs.** `--secret-file` for `sign`, `verify`, and `audit` ([#38](https://github.com/KhaledSaeed18/jwt-toolkit/pull/38)); X.509 certificates as public keys and encrypted private keys via `--passphrase-file` or a prompt ([#35](https://github.com/KhaledSaeed18/jwt-toolkit/pull/35)); `sign --payload-file` and `--expires-in 15m` ([#39](https://github.com/KhaledSaeed18/jwt-toolkit/pull/39)); `generate-secret --raw` ([#36](https://github.com/KhaledSaeed18/jwt-toolkit/pull/36)).
73
+ - **Readable time claims.** `decode` shows `iat`, `nbf`, and `exp` in UTC and relative to now. ([#41](https://github.com/KhaledSaeed18/jwt-toolkit/pull/41))
74
+ - **New README** with full documentation and a new header image. ([#43](https://github.com/KhaledSaeed18/jwt-toolkit/pull/43))
75
+
76
+ ### Behavior changes
77
+
78
+ These are fixes, but they can change results you rely on:
79
+
80
+ - `alg` is matched case-sensitively, as RFC 7515 requires. `verify` rejects `hs256`, and `sign --header` no longer accepts lowercase names. ([#25](https://github.com/KhaledSaeed18/jwt-toolkit/pull/25))
81
+ - `verify` rejects tokens that use `crit`, treats a token as expired at its `exp` second, and rejects non-numeric, `NaN`, or infinite time claims. ([#25](https://github.com/KhaledSaeed18/jwt-toolkit/pull/25))
82
+ - Headers and payloads must be JSON objects. Other values are a decode error (exit 2) instead of a crash. ([#25](https://github.com/KhaledSaeed18/jwt-toolkit/pull/25))
83
+ - Every `--json` failure path now prints a JSON error document with a stable `error` code. ([#25](https://github.com/KhaledSaeed18/jwt-toolkit/pull/25))
84
+ - `crack` tries wordlist lines exactly as written. Leading or trailing spaces, lines starting with `#`, and non-UTF-8 bytes are no longer skipped or altered. `--threads` is now `--workers` (the old name still works), with a default of 4. ([#27](https://github.com/KhaledSaeed18/jwt-toolkit/pull/27), [#28](https://github.com/KhaledSaeed18/jwt-toolkit/pull/28))
85
+ - `audit --require` flags any listed claim, not only `iss`, `aud`, and `iat`. A `--strict` gate may now fail where it passed before. ([#42](https://github.com/KhaledSaeed18/jwt-toolkit/pull/42))
86
+ - `download-wordlists` fetches from this release's tag and no longer has an unverified-TLS fallback. ([#26](https://github.com/KhaledSaeed18/jwt-toolkit/pull/26))
87
+
88
+ `--json` output keeps `schema_version` `0.1`. All changes to it are additive, such as `header_only` on `forge` variants ([#31](https://github.com/KhaledSaeed18/jwt-toolkit/pull/31)) and the `input` field on `diff` errors.
89
+
90
+ ### Security fixes
91
+
92
+ - Token contents, wordlist lines, and paths are rendered as literal text. A crafted claim such as `[/x]` could crash `audit`, `verify`, `decode`, `forge`, or `crack`, and balanced markup could restyle a report. ([#40](https://github.com/KhaledSaeed18/jwt-toolkit/pull/40), [#26](https://github.com/KhaledSaeed18/jwt-toolkit/pull/26))
93
+ - `forge` marks the four header-only variants, whose rejection does not prove the named flaw is absent. ([#31](https://github.com/KhaledSaeed18/jwt-toolkit/pull/31))
94
+
95
+ ### Packaging and project
96
+
97
+ - Ships `py.typed` and exposes `jwt_toolkit.__version__`. ([#32](https://github.com/KhaledSaeed18/jwt-toolkit/pull/32))
98
+ - The publish workflow runs the full check suite on the tagged commit and refuses tags that do not match the package version. ([#30](https://github.com/KhaledSaeed18/jwt-toolkit/pull/30))
99
+ - SECURITY.md describes the 1.x support policy. ([#29](https://github.com/KhaledSaeed18/jwt-toolkit/pull/29))
100
+ - The sdist no longer bundles README images. ([#45](https://github.com/KhaledSaeed18/jwt-toolkit/pull/45))
101
+
102
+ ## [1.0.0](https://github.com/KhaledSaeed18/jwt-toolkit/compare/v0.1.3...v1.0.0) (2026-07-03)
103
+
104
+ First stable release of **jwt-toolkit**: a defensive CLI for inspecting, verifying, auditing, forging (for self-audit), and brute-forcing weak HMAC secrets on JSON Web Tokens.
105
+
106
+ The public surface (CLI grammar, `--json` schema `0.1`, and `core/errors.py` codes) is unchanged from `v0.1.3`; this release promotes the project to a committed `1.0` line.
107
+
108
+ ### Changes since v0.1.3
109
+
110
+ - **Security:** bump `cryptography` to `49.0.0` (GHSA-537c-gmf6-5ccf) and `msgpack` to `1.2.1` (GHSA-6v7p-g79w-8964); `pip-audit` is clean.
111
+ - **Deps:** routine dependency and GitHub Actions updates via Dependabot.
112
+ - **Docs:** refreshed README badges and added a feature overview for the PyPI homepage.
113
+ - **Packaging:** development status promoted to `4 - Beta`.
114
+
115
+
116
+ ## [0.1.3](https://github.com/KhaledSaeed18/jwt-toolkit/compare/v0.1.2...v0.1.3) (2026-05-26)
117
+
118
+ Maintenance release.
119
+
120
+ ## [0.1.2](https://github.com/KhaledSaeed18/jwt-toolkit/compare/v0.1.1...v0.1.2) (2026-05-25)
121
+
122
+ Maintenance release.
123
+
124
+ ## [0.1.1](https://github.com/KhaledSaeed18/jwt-toolkit/compare/v0.1.0...v0.1.1) (2026-05-25)
125
+
126
+ Maintenance release.
127
+
128
+ ## 0.1.0 (2026-05-25)
129
+
130
+ Initial release of jwt-toolkit: decode, sign, verify (incl. JWKS), audit, forge, crack, generate-secret, download-wordlists.
@@ -77,6 +77,7 @@ jwt-toolkit/
77
77
  │ ├── lifetime.py # --expires-in parsing
78
78
  │ ├── timestamps.py # Human-readable time claims
79
79
  │ └── wordlist.py # Streaming wordlist reader and candidate expansion
80
+ ├── scripts/ # Package smoke test and cliprobe runner (dev only, not shipped in the wheel)
80
81
  ├── tests/ # Pytest suite mirroring the source layout
81
82
  │ ├── conftest.py # Shared fixtures (keys, tokens, tmp wordlists)
82
83
  │ ├── helpers.py # Test helpers
@@ -131,7 +132,7 @@ uv run jwt-toolkit --version
131
132
  make check
132
133
  ```
133
134
 
134
- `make check` runs the full local CI gate: lint, type checking, tests, security scan, dependency audit, and the GitHub Actions security lint. Run this before opening a pull request.
135
+ `make check` runs the full local CI gate: lint, type checking, tests, security scan, dependency audit, the GitHub Actions security lint, and the installed-package smoke test (`scripts/package_check.py`: builds the wheel and sdist, checks what they contain, installs each into a fresh venv outside the repository, and runs the `jwt-toolkit` entry point). Run this before opening a pull request.
135
136
 
136
137
  ## Common tasks
137
138
 
@@ -148,6 +149,8 @@ make check
148
149
  | Static security scan (bandit) | `make security` |
149
150
  | Check deps for known CVEs (pip-audit)| `make audit` |
150
151
  | Security-lint workflows (zizmor) | `make actions` |
152
+ | Smoke-test the built package | `make smoke` |
153
+ | cliprobe terminal checks (Node 22+) | `make cliprobe` |
151
154
  | Full local CI gate | `make check` |
152
155
  | Run all pre-commit hooks | `make pre-commit` |
153
156
  | Clean caches and build artifacts | `make clean` |
@@ -195,7 +198,7 @@ We follow [Conventional Commits](https://www.conventionalcommits.org/). The form
195
198
  <optional footer>
196
199
  ```
197
200
 
198
- `<type>` must be one of: `feat`, `fix`, `docs`, `refactor`, `test`, `chore`, `perf`, `security`, `build`, `ci`, `style`.
201
+ `<type>` must be one of: `feat`, `fix`, `docs`, `refactor`, `test`, `chore`, `perf`, `security`, `build`, `ci`, `style`, `revert`.
199
202
 
200
203
  `<scope>` is a short identifier for the area of the codebase. Use a command name, a `core/` module name, or a high-level area:
201
204
 
@@ -203,6 +206,8 @@ We follow [Conventional Commits](https://www.conventionalcommits.org/). The form
203
206
  - Core scopes: `core`, `auditor`, `claims`, `cracker`, `crypto`, `decoder`, `forge`, `jwks`, `wordlist`
204
207
  - Other scopes: `cli`, `readme`, `ci`, `deps`, `release`
205
208
 
209
+ The `commit-msg` hook installed by `make install` checks these rules, and CI checks the PR title, because the squash commit on `main` uses it as the message and release-please reads it to decide the next version.
210
+
206
211
  Rules:
207
212
 
208
213
  - Use the imperative mood: "add" not "added" or "adds".
@@ -234,6 +239,10 @@ chore(deps): bump cryptography to 48.0.0
234
239
  7. A maintainer will review. Address review feedback by pushing additional commits to the same branch. Avoid force-pushing during review so reviewers can see incremental changes. Squash-merging is performed by the maintainer at merge time.
235
240
  8. Once approved and green, a maintainer merges with a squash commit whose message follows the conventional-commits format.
236
241
 
242
+ ### Dependabot pull requests
243
+
244
+ Dependabot opens grouped pull requests on Mondays: runtime and dev dependencies (minor and patch), their major updates separately, security updates, and GitHub Actions. It waits seven days before proposing a new version, and updates `uv.lock` only, so the lower bounds in `pyproject.toml` stay low. Titles use `build(deps)`, `build(deps-dev)` and `ci(deps)`, which never cut a release on their own. Merge them with "squash and merge" once CI is green; if CI fails, fix it on the Dependabot branch before merging.
245
+
237
246
  ### What makes a good pull request
238
247
 
239
248
  - Small and focused. One logical change per PR.
@@ -278,13 +287,14 @@ When working on security-relevant code:
278
287
 
279
288
  ## Releasing
280
289
 
281
- Releases are maintainer-only. The publish workflow uses PyPI Trusted Publishing through the `pypi` GitHub environment, which requires manual approval. The release flow is:
290
+ Releases are maintainer-only and run through [release-please](https://github.com/googleapis/release-please) in `.github/workflows/publish.yml`:
291
+
292
+ 1. Every push to `main` updates an open release PR titled `chore(release): vX.Y.Z`. It bumps the version in `pyproject.toml`, `uv.lock` and `.release-please-manifest.json`, and adds the `CHANGELOG.md` entry built from the commit messages since the last release.
293
+ 2. The version comes from those messages: `feat` gives a minor release, `fix`, `security`, `perf`, `revert` and `docs` give a patch, and `!` or a `BREAKING CHANGE:` footer gives a major. `build`, `ci`, `chore`, `test`, `refactor` and `style` never cause a release on their own.
294
+ 3. Leave the release PR open while changes accumulate. Merging it releases: the same workflow run tags the commit, creates the GitHub Release, runs the full CI gate on that commit, builds, and publishes to PyPI with Trusted Publishing.
295
+ 4. The publish job waits for approval of the `pypi` GitHub environment.
282
296
 
283
- 1. Bump the version in `pyproject.toml` on a release branch.
284
- 2. Open a PR titled `chore(release): vX.Y.Z`.
285
- 3. After merge, tag `main` with `vX.Y.Z` and push the tag.
286
- 4. Create a GitHub release from the tag. The release body becomes the changelog entry.
287
- 5. Approve the `pypi` environment when the publish workflow asks.
297
+ If publishing fails after the tag exists, fix the cause and re-run it for that tag with `gh workflow run publish.yml --ref vX.Y.Z`. A version that reached PyPI can never be uploaded again; ship the next patch instead.
288
298
 
289
299
  Contributors do not need to do any of this. Maintainers handle releases.
290
300
 
@@ -1,7 +1,7 @@
1
1
  # jwt-toolkit dev commands. Run `make` or `make help` for the list.
2
2
 
3
3
  .DEFAULT_GOAL := help
4
- .PHONY: help install fmt lint typecheck test test-fast cov security audit actions check pre-commit clean
4
+ .PHONY: help install fmt lint typecheck test test-fast cov security audit actions smoke cliprobe check pre-commit clean
5
5
 
6
6
  UV ?= uv
7
7
 
@@ -41,11 +41,19 @@ audit: ## Check dependencies for known CVEs.
41
41
  actions: ## Security-lint the GitHub Actions workflows (zizmor).
42
42
  $(UV) run zizmor --offline --persona=regular .github/workflows
43
43
 
44
- check: lint typecheck test security audit actions ## Full local CI gate.
44
+ smoke: ## Build, check and smoke-test the installed wheel and sdist.
45
+ $(UV) run python scripts/package_check.py
46
+
47
+ CLIPROBE_ENV ?= .smoke-env
48
+ cliprobe: ## Run cliprobe (needs Node 22+) against the installed wheel.
49
+ $(UV) run python scripts/package_check.py --keep-venv $(CLIPROBE_ENV)
50
+ $(UV) run python scripts/run_cliprobe.py --strict $(CLIPROBE_ENV)
51
+
52
+ check: lint typecheck test security audit actions smoke ## Full local CI gate.
45
53
 
46
54
  pre-commit: ## Run all pre-commit hooks on every file.
47
55
  $(UV) run pre-commit run --all-files
48
56
 
49
57
  clean: ## Remove caches and build artifacts.
50
- rm -rf .pytest_cache .ruff_cache .mypy_cache .coverage coverage.xml htmlcov dist build
58
+ rm -rf .pytest_cache .ruff_cache .mypy_cache .coverage coverage.xml htmlcov dist build .smoke-env
51
59
  find . -type d -name __pycache__ -prune -exec rm -rf {} +
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: jwt-toolkit
3
- Version: 1.2.1
3
+ Version: 1.3.0
4
4
  Summary: A command-line toolkit for inspecting, verifying, cracking, and securing JSON Web Tokens. Built to expose how JWT signing works and where it breaks.
5
5
  Project-URL: Homepage, https://github.com/KhaledSaeed18/jwt-toolkit
6
6
  Project-URL: Repository, https://github.com/KhaledSaeed18/jwt-toolkit
@@ -425,7 +425,7 @@ jwt-toolkit --quiet --no-color audit "$TOKEN" --json
425
425
  | Option | Environment variable | Effect |
426
426
  | --- | --- | --- |
427
427
  | `--quiet` | `JWT_TOOLKIT_QUIET=1` | Drop the banner, progress, and hints. Results and errors are always printed. |
428
- | `--no-color` | `NO_COLOR=1` | Disable colors. |
428
+ | `--no-color` | `NO_COLOR=1` | Disable colors and text styles (no escape codes at all). |
429
429
  | `--no-banner` | `JWT_TOOLKIT_NO_BANNER=1` | Suppress the banner shown by a bare `jwt-toolkit`. |
430
430
 
431
431
  **Output streams.** Results go to stdout; errors, progress, and hints go to stderr, so `jwt-toolkit sign ... > token.jwt` captures only the token. Under `--json`, error documents are printed to stdout like any other result.
@@ -441,7 +441,35 @@ jwt-toolkit --quiet --no-color audit "$TOKEN" --json
441
441
  }
442
442
  ```
443
443
 
444
- Error codes include `invalid_structure`, `invalid_base64url`, `invalid_json`, `invalid_json_object`, `invalid_number`, `token_unreadable`, `unsupported_algorithm`, `invalid_key_options`, `key_error`, `stdin_conflict`, `signature_missing`, `wordlist_missing`, `wordlist_unreadable`, and `wordlist_empty`.
444
+ Error codes are stable: a code is never renamed or reused. When a command reports a broad code, an optional `cause` field names the specific failure, for example `"error": "key_error", "cause": "jwks_no_matching_key"`. `diff` errors also carry `"input": "before"` or `"after"`.
445
+
446
+ | `error` | Meaning | Commands |
447
+ | --- | --- | --- |
448
+ | `invalid_structure` | The token is not three dot-separated parts | all that take a token |
449
+ | `invalid_base64url` | A token part is not valid base64url | all that take a token |
450
+ | `invalid_json`, `invalid_json_object`, `invalid_number` | The header or payload is not a JSON object with finite numbers | all that take a token |
451
+ | `token_unreadable` | `@path` could not be read as UTF-8 text | all that take a token |
452
+ | `stdin_conflict` | Both tokens were given as `-` | `diff` |
453
+ | `invalid_key_options` | Missing, conflicting, or unusable key options | `verify`, `audit`, `forge` |
454
+ | `key_error` | The supplied key or JWKS could not verify the token | `verify` |
455
+ | `unsupported_algorithm` | The token's `alg` cannot be used for this command | `crack` |
456
+ | `signature_missing` | The token has an empty signature | `crack` |
457
+ | `wordlist_missing`, `wordlist_unreadable`, `wordlist_empty` | The wordlist cannot be used | `crack` |
458
+
459
+ | `cause` | Meaning |
460
+ | --- | --- |
461
+ | `key_parse_failed` | The key could not be read, decrypted, or used as a key |
462
+ | `key_algorithm_mismatch` | The key belongs to another algorithm family or curve |
463
+ | `key_not_public` | A private key was given where the public key belongs |
464
+ | `key_passphrase_required` | The private key is encrypted and no passphrase was given |
465
+ | `unsupported_algorithm` | The algorithm is not supported for this key |
466
+ | `jwks_fetch_failed` | The JWKS could not be fetched |
467
+ | `jwks_invalid` | The JWKS document, or the selected key, is malformed or not for signatures |
468
+ | `jwks_no_matching_key` | No key in the JWKS matches the token's `kid` |
469
+ | `jwks_ambiguous` | More than one key could match, so none is used |
470
+ | `forge_variant_unknown`, `forge_variant_needs_key` | The `forge --mode` variant is unknown or needs `--public-key` |
471
+
472
+ URLs in error messages are reduced to scheme, host, port, and path, so credentials or tokens in a JWKS URL are never echoed.
445
473
 
446
474
  **Exit codes.** `0` means the check passed, `1` means it found a problem, and `2` means the input could not be used. The exceptions are [`crack`](#crack), which exits `1` when it finds the secret, and [`diff`](#diff), which only exits `1` with `--exit-code`.
447
475