jwt-toolkit 1.2.0__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.
- jwt_toolkit-1.3.0/.gitattributes +3 -0
- jwt_toolkit-1.3.0/.github/dependabot.yml +68 -0
- jwt_toolkit-1.3.0/.github/workflows/ci.yml +130 -0
- jwt_toolkit-1.3.0/.github/workflows/pr-title.yml +23 -0
- jwt_toolkit-1.3.0/.github/workflows/publish.yml +142 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/.gitignore +6 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/.pre-commit-config.yaml +13 -0
- jwt_toolkit-1.3.0/.release-please-manifest.json +3 -0
- jwt_toolkit-1.3.0/CHANGELOG.md +130 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/CONTRIBUTING.md +20 -9
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/Makefile +14 -3
- jwt_toolkit-1.2.0/README.md → jwt_toolkit-1.3.0/PKG-INFO +66 -3
- jwt_toolkit-1.2.0/PKG-INFO → jwt_toolkit-1.3.0/README.md +31 -34
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/__init__.py +1 -1
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/cli/console.py +15 -3
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/cli/credentials.py +6 -8
- jwt_toolkit-1.3.0/jwt_toolkit/cli/decoding.py +75 -0
- jwt_toolkit-1.3.0/jwt_toolkit/cli/errors.py +62 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/commands/audit.py +7 -24
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/commands/crack.py +9 -19
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/commands/decode.py +3 -3
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/commands/diff.py +18 -19
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/commands/download_wordlists.py +45 -41
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/commands/forge.py +8 -9
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/commands/generate_secret.py +10 -7
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/commands/sign.py +70 -74
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/commands/verify.py +20 -41
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/core/crypto.py +30 -17
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/core/encoding.py +15 -5
- jwt_toolkit-1.3.0/jwt_toolkit/core/errors.py +160 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/core/forge.py +10 -3
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/core/jwks.py +56 -32
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/pyproject.toml +9 -2
- jwt_toolkit-1.3.0/release-please-config.json +35 -0
- jwt_toolkit-1.3.0/scripts/check_commit_message.py +85 -0
- jwt_toolkit-1.3.0/scripts/package_check.py +165 -0
- jwt_toolkit-1.3.0/scripts/run_cliprobe.py +77 -0
- jwt_toolkit-1.3.0/scripts/smoke_installed.py +172 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/tests/test_cmd_crack.py +4 -1
- jwt_toolkit-1.3.0/tests/test_cmd_errors.py +231 -0
- jwt_toolkit-1.3.0/tests/test_cmd_global_flags.py +138 -0
- jwt_toolkit-1.3.0/tests/test_encoding.py +37 -0
- jwt_toolkit-1.3.0/tests/test_errors.py +110 -0
- jwt_toolkit-1.3.0/tests/test_repo_dependabot.py +27 -0
- jwt_toolkit-1.3.0/tests/test_repo_release.py +142 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/uv.lock +427 -119
- jwt_toolkit-1.2.0/.github/dependabot.yml +0 -25
- jwt_toolkit-1.2.0/.github/workflows/ci.yml +0 -75
- jwt_toolkit-1.2.0/.github/workflows/publish.yml +0 -87
- jwt_toolkit-1.2.0/docs/plans/01-correctness-and-robustness.md +0 -260
- jwt_toolkit-1.2.0/docs/plans/02-verification-policies.md +0 -78
- jwt_toolkit-1.2.0/docs/plans/03-reports-and-automation.md +0 -89
- jwt_toolkit-1.2.0/docs/plans/04-jwks-and-discovery.md +0 -86
- jwt_toolkit-1.2.0/docs/plans/05-developer-workflows.md +0 -101
- jwt_toolkit-1.2.0/docs/plans/06-quality-and-releases.md +0 -113
- jwt_toolkit-1.2.0/docs/plans/07-delivery-and-handoff.md +0 -106
- jwt_toolkit-1.2.0/docs/plans/08-architecture-refactor.md +0 -118
- jwt_toolkit-1.2.0/docs/plans/README.md +0 -88
- jwt_toolkit-1.2.0/jwt_toolkit/cli/decoding.py +0 -118
- jwt_toolkit-1.2.0/jwt_toolkit/core/errors.py +0 -59
- jwt_toolkit-1.2.0/tests/test_cmd_global_flags.py +0 -67
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/.editorconfig +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/.github/ISSUE_TEMPLATE/documentation.yml +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/.python-version +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/LICENSE +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/SECURITY.md +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/cli/__init__.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/cli/algorithms.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/cli/banner.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/cli/panels.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/cli/wordlists.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/commands/__init__.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/core/__init__.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/core/auditor.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/core/claims.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/core/cracker.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/core/decoder.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/core/diff.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/core/lifetime.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/core/timestamps.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/core/wordlist.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/jwt_toolkit/py.typed +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/tests/__init__.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/tests/conftest.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/tests/helpers.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/tests/test_auditor.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/tests/test_claims.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/tests/test_cmd_audit.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/tests/test_cmd_decode.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/tests/test_cmd_diff.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/tests/test_cmd_download_wordlists.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/tests/test_cmd_forge.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/tests/test_cmd_generate_secret.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/tests/test_cmd_sign.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/tests/test_cmd_verify.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/tests/test_cracker.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/tests/test_credentials.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/tests/test_crypto.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/tests/test_crypto_asymmetric.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/tests/test_decoder.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/tests/test_diff.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/tests/test_forge.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/tests/test_jwks.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/tests/test_lifetime.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/tests/test_markup_escaping.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/tests/test_package.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/tests/test_timestamps.py +0 -0
- {jwt_toolkit-1.2.0 → jwt_toolkit-1.3.0}/tests/test_wordlist.py +0 -0
- {jwt_toolkit-1.2.0 → 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]
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
# Lets the release workflow run this same gate on the commit it publishes.
|
|
8
|
+
workflow_call:
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
group: ci-${{ github.workflow }}-${{ github.ref }}
|
|
15
|
+
# Superseded PR pushes are cancelled; main and release runs always finish.
|
|
16
|
+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
lint:
|
|
20
|
+
name: Lint & format
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
24
|
+
with:
|
|
25
|
+
persist-credentials: false
|
|
26
|
+
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
|
27
|
+
with:
|
|
28
|
+
enable-cache: true
|
|
29
|
+
- name: Install dev dependencies
|
|
30
|
+
run: uv sync --locked --group dev
|
|
31
|
+
- name: Ruff format (check only)
|
|
32
|
+
run: uv run ruff format --check .
|
|
33
|
+
- name: Ruff lint
|
|
34
|
+
run: uv run ruff check .
|
|
35
|
+
- name: Workflow security lint (zizmor)
|
|
36
|
+
run: uv run zizmor --offline --persona=regular .github/workflows
|
|
37
|
+
|
|
38
|
+
typecheck:
|
|
39
|
+
name: Type check
|
|
40
|
+
runs-on: ubuntu-latest
|
|
41
|
+
steps:
|
|
42
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
43
|
+
with:
|
|
44
|
+
persist-credentials: false
|
|
45
|
+
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
|
46
|
+
with:
|
|
47
|
+
enable-cache: true
|
|
48
|
+
- run: uv sync --locked --group dev
|
|
49
|
+
- run: uv run mypy
|
|
50
|
+
|
|
51
|
+
security:
|
|
52
|
+
name: Security scan
|
|
53
|
+
runs-on: ubuntu-latest
|
|
54
|
+
steps:
|
|
55
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
56
|
+
with:
|
|
57
|
+
persist-credentials: false
|
|
58
|
+
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
|
59
|
+
with:
|
|
60
|
+
enable-cache: true
|
|
61
|
+
- run: uv sync --locked --group dev
|
|
62
|
+
- name: Bandit static analysis
|
|
63
|
+
run: uv run bandit -c pyproject.toml -r jwt_toolkit --severity-level medium
|
|
64
|
+
- name: pip-audit dependency CVEs
|
|
65
|
+
run: uv run pip-audit
|
|
66
|
+
|
|
67
|
+
test:
|
|
68
|
+
name: Tests (${{ matrix.os }}, Python ${{ matrix.python-version }})
|
|
69
|
+
runs-on: ${{ matrix.os }}
|
|
70
|
+
strategy:
|
|
71
|
+
fail-fast: false
|
|
72
|
+
matrix:
|
|
73
|
+
# Every supported CPython on Linux and Windows (crack's worker processes
|
|
74
|
+
# use spawn there), plus the minimum on macOS. Keep in sync with the
|
|
75
|
+
# pyproject classifiers and the README "Installation" section.
|
|
76
|
+
os: [ubuntu-latest, windows-latest]
|
|
77
|
+
python-version: ["3.13", "3.14", "3.15"]
|
|
78
|
+
include:
|
|
79
|
+
- os: macos-latest
|
|
80
|
+
python-version: "3.13"
|
|
81
|
+
env:
|
|
82
|
+
COVERAGE_CELL: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.15' }}
|
|
83
|
+
steps:
|
|
84
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
85
|
+
with:
|
|
86
|
+
persist-credentials: false
|
|
87
|
+
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
|
|
88
|
+
with:
|
|
89
|
+
enable-cache: true
|
|
90
|
+
python-version: ${{ matrix.python-version }}
|
|
91
|
+
- run: uv sync --locked --group dev
|
|
92
|
+
- name: Run tests with coverage
|
|
93
|
+
run: uv run pytest --cov --cov-report=term-missing --cov-report=xml -n auto
|
|
94
|
+
- name: Upload coverage artifact
|
|
95
|
+
if: always() && env.COVERAGE_CELL == 'true'
|
|
96
|
+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
97
|
+
with:
|
|
98
|
+
name: coverage
|
|
99
|
+
path: coverage.xml
|
|
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
|
|
@@ -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,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, and
|
|
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
|
|
|
@@ -147,6 +148,9 @@ make check
|
|
|
147
148
|
| Coverage report on stdout | `make cov` |
|
|
148
149
|
| Static security scan (bandit) | `make security` |
|
|
149
150
|
| Check deps for known CVEs (pip-audit)| `make audit` |
|
|
151
|
+
| Security-lint workflows (zizmor) | `make actions` |
|
|
152
|
+
| Smoke-test the built package | `make smoke` |
|
|
153
|
+
| cliprobe terminal checks (Node 22+) | `make cliprobe` |
|
|
150
154
|
| Full local CI gate | `make check` |
|
|
151
155
|
| Run all pre-commit hooks | `make pre-commit` |
|
|
152
156
|
| Clean caches and build artifacts | `make clean` |
|
|
@@ -194,7 +198,7 @@ We follow [Conventional Commits](https://www.conventionalcommits.org/). The form
|
|
|
194
198
|
<optional footer>
|
|
195
199
|
```
|
|
196
200
|
|
|
197
|
-
`<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`.
|
|
198
202
|
|
|
199
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:
|
|
200
204
|
|
|
@@ -202,6 +206,8 @@ We follow [Conventional Commits](https://www.conventionalcommits.org/). The form
|
|
|
202
206
|
- Core scopes: `core`, `auditor`, `claims`, `cracker`, `crypto`, `decoder`, `forge`, `jwks`, `wordlist`
|
|
203
207
|
- Other scopes: `cli`, `readme`, `ci`, `deps`, `release`
|
|
204
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
|
+
|
|
205
211
|
Rules:
|
|
206
212
|
|
|
207
213
|
- Use the imperative mood: "add" not "added" or "adds".
|
|
@@ -229,10 +235,14 @@ chore(deps): bump cryptography to 48.0.0
|
|
|
229
235
|
3. Make focused commits that follow the conventions above.
|
|
230
236
|
4. Run `make check` and make sure everything passes locally.
|
|
231
237
|
5. Push your branch and open a pull request against `main`. Fill in every section of the PR template.
|
|
232
|
-
6. The CI workflow runs lint, type check,
|
|
238
|
+
6. The CI workflow runs lint, type check, security checks, and the tests on Linux and Windows with every supported Python, plus macOS. All checks must pass. Actions are pinned to full commit SHAs; keep the version comment when you change one.
|
|
233
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.
|
|
234
240
|
8. Once approved and green, a maintainer merges with a squash commit whose message follows the conventional-commits format.
|
|
235
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
|
+
|
|
236
246
|
### What makes a good pull request
|
|
237
247
|
|
|
238
248
|
- Small and focused. One logical change per PR.
|
|
@@ -277,13 +287,14 @@ When working on security-relevant code:
|
|
|
277
287
|
|
|
278
288
|
## Releasing
|
|
279
289
|
|
|
280
|
-
Releases are maintainer-only
|
|
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.
|
|
281
296
|
|
|
282
|
-
|
|
283
|
-
2. Open a PR titled `chore(release): vX.Y.Z`.
|
|
284
|
-
3. After merge, tag `main` with `vX.Y.Z` and push the tag.
|
|
285
|
-
4. Create a GitHub release from the tag. The release body becomes the changelog entry.
|
|
286
|
-
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.
|
|
287
298
|
|
|
288
299
|
Contributors do not need to do any of this. Maintainers handle releases.
|
|
289
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 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
|
|
|
@@ -38,11 +38,22 @@ security: ## Static security scan of the source.
|
|
|
38
38
|
audit: ## Check dependencies for known CVEs.
|
|
39
39
|
$(UV) run pip-audit
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
actions: ## Security-lint the GitHub Actions workflows (zizmor).
|
|
42
|
+
$(UV) run zizmor --offline --persona=regular .github/workflows
|
|
43
|
+
|
|
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.
|
|
42
53
|
|
|
43
54
|
pre-commit: ## Run all pre-commit hooks on every file.
|
|
44
55
|
$(UV) run pre-commit run --all-files
|
|
45
56
|
|
|
46
57
|
clean: ## Remove caches and build artifacts.
|
|
47
|
-
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
|
|
48
59
|
find . -type d -name __pycache__ -prune -exec rm -rf {} +
|