Skip to content

Skills: security headers, the nonce of templates and CORS - #642

Merged
dex4er merged 1 commit into
security-headers-cookbookfrom
security-headers-skills
Nov 18, 2026
Merged

dex4er merged 1 commit into
security-headers-cookbookfrom
security-headers-skills

Conversation

@dex4er

@dex4er dex4er commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Closes #634, its last step, stacked on #641.

Changes

  • pyjoyment:deploy:
    • The example application has plugin('SecurityHeaders', csp_report_only=..., reports='/csp-reports'), so a coding agent sets the security headers in every deployment.
    • New section Security headers: HSTS (only over HTTPS, -p behind a proxy, start with a short max_age, include_subdomains and preload later), the rollout of a CSP from csp_report_only and its reports to csp, the nonce and a CDN, Permissions-Policy, and CORS in the skill api.
    • New entries in Mistakes: no HSTS behind a proxy without -p; an enforced CSP before its reports are read; 'unsafe-inline' next to a nonce; style and onclick attributes.
    • The description and the links include the security headers.
  • pyjoyment:templates: inline scripts and styles go through the javascript/stylesheet blocks or nonce="<%= csp_nonce() %>", and style/onclick attributes move into the stylesheet and the script. The description and the links include it.
  • pyjoyment:api: plugin('CORS') replaces the hook that set Access-Control-Allow-Origin: *, and the hook moved into Mistakes: set by hand, it misses the preflight requests and Vary: Origin. New entries cover origins with credentials and AllowedHosts.

Validation

  • t/docs/skills_deploy.py: the headers of the application of the skill, its report route, and every option that the section names is an option of the plugin
  • t/docs/skills_api.py: Access-Control-Allow-Origin for a request with Origin, and the preflight of DELETE
  • t/docs/skills_templates.py: the three forms of the skill give every inline script and style the nonce of the policy
  • t/docs/skills.py, all of t/docs
  • claude plugin validate ./plugins/pyjoyment and claude plugin validate .: only the existing warning that the plugin has no version, which is intended
  • trunk check: no issues
  • CI

🤖 Generated with Claude Code

The skill deploy has the plugin SecurityHeaders in its application, a
section on HSTS, the rollout of a CSP from its reports, the nonce and
Permissions-Policy, and their mistakes; templates the nonce of the inline
scripts and styles; api the plugin CORS in place of a hook of *.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dex4er dex4er added this to the 0.4.1 milestone Nov 18, 2026
@dex4er
dex4er added this pull request to stack #637 November 18, 2026 17:30
@read-the-docs-community

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

Tests

Job Tests Passed ✅ Skipped ⚠️ Failed ❌ Log
prove (python 3.12, Asyncio) 7517 7488 29 0 ✅ 134996132732
prove (python 3.12, Poll) 7489 7458 31 0 ✅ 134996133295
prove (python 3.13, Asyncio) 7517 7488 29 0 ✅ 134996133126
prove (python 3.13, Poll) 7489 7458 31 0 ✅ 134996132858
prove (python 3.14, Asyncio) 7548 7524 24 0 ✅ 134996133031
prove (python 3.14, Poll) 7520 7494 26 0 ✅ 134996132966
prove (python 3.15, Asyncio) 7548 7524 24 0 ✅ 134996133158
prove (python 3.15, Poll) 7520 7494 26 0 ✅ 134996132917
prove (python 3.15t, Asyncio) 7548 7524 24 0 ✅ 134996133097
prove (python 3.15t, Poll) 7520 7494 26 0 ✅ 134996133157
prove (python mise, Asyncio) 7627 7592 35 0 ✅ 134996132563
prove (python mise, Asyncio, Windows) 7348 7282 66 0 ✅ 134996132658
prove (python mise, Poll) 7599 7562 37 0 ✅ 134996132178
prove (python mise, Poll, Windows) 7320 7252 68 0 ✅ 134996132646
prove (python pypy3.12, Asyncio) 7517 7488 29 0 ✅ 134996133188
prove (python pypy3.12, Poll) 7489 7458 31 0 ✅ 134996133192
pytest (python 3.12, ubuntu-26.04-arm) 446 420 26 0 ✅ 134996132371
pytest (python 3.15, ubuntu-26.04-arm) 446 425 21 0 ✅ 134996132771
pytest (python 3.15, windows-2025) 446 397 49 0 ✅ 134996132396
servers (python 3.12) 54 54 0 0 ✅ 134996132743
servers (python 3.15) 53 53 0 0 ✅ 134996132679
All 121561 120929 632 0 ✅

The run of the workflow

@dex4er dex4er modified the milestones: 0.4.1, 0.5.0 Nov 18, 2026
@dex4er
dex4er merged commit c2186fd into main Nov 18, 2026
25 checks passed
@dex4er
dex4er deleted the security-headers-skills branch November 18, 2026 21:20
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.

Security headers: HSTS, CSP with nonce and reports, Permissions-Policy, CORS

1 participant