Skip to content

Comments

Encrypt cookies#60

Merged
sergeychernyshev merged 5 commits intomainfrom
59-encrypt-cookies
Feb 16, 2026
Merged

Encrypt cookies#60
sergeychernyshev merged 5 commits intomainfrom
59-encrypt-cookies

Conversation

@sergeychernyshev
Copy link
Member

@sergeychernyshev sergeychernyshev commented Feb 16, 2026

This PR implements encryption for session-related cookies using AES-GCM.

Key changes:

  • Created src/CookieManager.ts to handle encryption and decryption using the Web Crypto API.
  • Added SESSION_SECRET to environment variables and strictly require it in the worker code (similarly to ORIGIN_URL).
  • Updated the documentation in public/index.html to clearly separate required and optional configuration variables.
  • Standardized the test suite using wrangler.test.jsonc and vitest.config.mts to provide stable default configuration for automated tests.
  • Updated src/index.ts and src/auth/index.ts to encrypt session_id and backup_session_id cookies.
  • Refactored cookie parsing and session retrieval to handle decryption gracefully.
  • Updated all integration tests to use CookieManager for compatibility with the new encrypted cookie format.

Closes #59

✨ Assisted by AI: Gemini

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 16, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
startup-api 9298582 Feb 16 2026, 02:55 AM

@sergeychernyshev sergeychernyshev merged commit 4c0b332 into main Feb 16, 2026
1 of 2 checks passed
@sergeychernyshev sergeychernyshev deleted the 59-encrypt-cookies branch February 16, 2026 02:58
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.

Encrypt cookies

1 participant