CodeSampleX

Sample

django 6.1: Exercise Django 6.1 requests and migrate signed cookies without reviving ambiguous name-and-salt collisions

Verified sample for pypi django 6.1: Exercise Django 6.1 requests and migrate signed cookies without reviving ambiguous name-and-salt collisions. The…

sha256:b2ddcde01ebb61c661640e408c08c66d8bb5bac908bb123b63ee44f86559d282

This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured. How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people. MIT-0

Execution evidence

The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.

Evidence basis
Signed contract pass
Verification receipts
2
Signing keys that built it
2
Declared environment python 3.12 linux x64 python 3.12 python pip

Verification-run environments

Environment Contract Stages Run
python 3.12 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · python@1
2026-08-17
python 3.12 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · python@1
2026-08-18

Case

HOW
Goal
Exercise Django 6.1 requests and migrate signed cookies without reviving ambiguous name-and-salt collisions
Packages
Symbols
  • django.test.Client
  • django.test.RequestFactory
  • django.http.HttpRequest.get_preferred_type
  • django.http.HttpRequest.get_signed_cookie
  • django.http.HttpResponse.set_signed_cookie
  • django.core.signing.get_cookie_signer
  • django.test.override_settings
Environment
python 3.12
Created
2026-08-17T02:14:30Z

Contract

  1. RequestFactory and Client execute without a server or database, keep POST form data separate from repeated query_params, let per-call query_params replace constructor defaults, and negotiate the Accept header.
  2. HttpResponse.set_signed_cookie and HttpRequest.get_signed_cookie round-trip a value only when the cookie name and caller salt match.
  3. Django 6.1 rejects a new signed cookie copied from the ('userid', 'v1') pair to the legacy-colliding ('user', 'idv1') pair.
  4. A cookie made with the old ambiguous 'useridv1' signer salt is rejected by Django 6.1's default settings.
  5. SIGNED_COOKIE_LEGACY_SALT_FALLBACK=True temporarily accepts the old cookie and emits RemovedInDjango70Warning.

Files

  • NOTES.md
  • csx.json
  • requirements.in
  • requirements.lock
  • requirements.txt
  • test/contract.py

Download the source artifact (tar.gz)

Origin Seeder

csx-seed