Skip to content

Pyjo.Headers: shortcuts of the headers of security and of CORS - #635

Merged
dex4er merged 1 commit into
mainfrom
headers-security-shortcuts
Nov 18, 2026
Merged

dex4er merged 1 commit into
mainfrom
headers-security-shortcuts

Conversation

@dex4er

@dex4er dex4er commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Part of #634, its first step: the bottom of a stack of pull requests, which the next steps (the plugin of the security headers, the nonce, the reports of CSP, CORS) build on.

Changes

  • New shortcuts of Pyjo.Headers, each with a # Not in Mojolicious: marker, a docstring example and the specification it comes from:
    • permissions_policy, content_security_policy_report_only, reporting_endpoints
    • x_content_type_options, referrer_policy
    • cross_origin_embedder_policy, cross_origin_opener_policy, cross_origin_resource_policy
    • CORS: access_control_allow_credentials, access_control_allow_headers, access_control_allow_methods, access_control_expose_headers, access_control_max_age, access_control_request_headers, access_control_request_method
  • Their names are in NAMES, so a header added in lower case keeps its normal case in names() and in the message.

Validation

  • t/Pyjo/Headers.py: every new shortcut, the normal case of the names, and the name of Content-Security-Policy-Report-Only in the message
  • t/docs/Headers.py evaluates the docstring example of each shortcut
  • PYTHONDEVMODE=1 python -m Pyjo.Prove -l -j 4 -r t: all tests pass
  • sphinx-build -W passes and the API page lists the new shortcuts
  • trunk check: no issues
  • CI

🤖 Generated with Claude Code

Permissions-Policy, Content-Security-Policy-Report-Only,
Reporting-Endpoints, X-Content-Type-Options, Referrer-Policy, the
Cross-Origin-*-Policy headers and the headers of CORS other than
Access-Control-Allow-Origin, with their names in NAMES, so that they keep
their normal case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dex4er dex4er added this to the 0.4.1 milestone Nov 18, 2026
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 Pyjoyment | 🛠️ Build #35989469 | 📁 Comparing 63f00e0 against latest (4deb3f0)

  🔍 Preview build  

2 files changed
± genindex.html
± api/Pyjo_Headers.html

@github-actions

Copy link
Copy Markdown
Contributor

Docker Smoke Test

Job Tests Passed ✅ Skipped ⚠️ Failed ❌ Log
smoke (app) 11 11 0 0 ✅ 134947345197
smoke (fastcgi) 5 5 0 0 ✅ 134947345703
smoke (kubernetes) 8 8 0 0 ✅ 134947345508
smoke (lambda) 2 2 0 0 ✅ 134947345596
smoke (lambda-image) 5 5 0 0 ✅ 134947345760
smoke (lambda-stream) 2 2 0 0 ✅ 134947345787
smoke (lambda-zip) 9 9 0 0 ✅ 134947345865
smoke (lite) 4 4 0 0 ✅ 134947345412
smoke (lite-pep723) 4 4 0 0 ✅ 134947345717
All 50 50 0 0 ✅

The run of the workflow

@github-actions

Copy link
Copy Markdown
Contributor

Tests

Job Tests Passed ✅ Skipped ⚠️ Failed ❌ Log
prove (python 3.12, Asyncio) 7472 7443 29 0 ✅ 134947346399
prove (python 3.12, Poll) 7444 7413 31 0 ✅ 134947346863
prove (python 3.13, Asyncio) 7472 7443 29 0 ✅ 134947346389
prove (python 3.13, Poll) 7444 7413 31 0 ✅ 134947345679
prove (python 3.14, Asyncio) 7503 7479 24 0 ✅ 134947346628
prove (python 3.14, Poll) 7475 7449 26 0 ✅ 134947346370
prove (python 3.15, Asyncio) 7503 7479 24 0 ✅ 134947346358
prove (python 3.15, Poll) 7475 7449 26 0 ✅ 134947346182
prove (python 3.15t, Asyncio) 7503 7479 24 0 ✅ 134947346490
prove (python 3.15t, Poll) 7475 7449 26 0 ✅ 134947346385
prove (python mise, Asyncio) 7582 7547 35 0 ✅ 134947345620
prove (python mise, Asyncio, Windows) 7303 7237 66 0 ✅ 134947345849
prove (python mise, Poll) 7554 7517 37 0 ✅ 134947345991
prove (python mise, Poll, Windows) 7275 7207 68 0 ✅ 134947345289
prove (python pypy3.12, Asyncio) 7472 7443 29 0 ✅ 134947346278
prove (python pypy3.12, Poll) 7444 7413 31 0 ✅ 134947346401
pytest (python 3.12, ubuntu-26.04-arm) 442 416 26 0 ✅ 134947346026
pytest (python 3.15, ubuntu-26.04-arm) 442 421 21 0 ✅ 134947345785
pytest (python 3.15, windows-2025) 442 393 49 0 ✅ 134947345946
servers (python 3.12) 54 54 0 0 ✅ 134947346190
servers (python 3.15) 53 53 0 0 ✅ 134947345966
All 120829 120197 632 0 ✅

The run of the workflow

@dex4er
dex4er added this pull request to stack #637 November 18, 2026 16:45
@dex4er dex4er modified the milestones: 0.4.1, 0.5.0 Nov 18, 2026
@dex4er
dex4er merged commit 3bb0d3f into main Nov 18, 2026
36 checks passed
@dex4er
dex4er deleted the headers-security-shortcuts branch November 18, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant