Skip to content

feat: solve session collision bug with new API design#96

Merged
noxecane merged 5 commits intomasterfrom
feat/session-store
Jul 1, 2025
Merged

feat: solve session collision bug with new API design#96
noxecane merged 5 commits intomasterfrom
feat/session-store

Conversation

@noxecane
Copy link
Owner

@noxecane noxecane commented Jul 1, 2025

  • Replace NewCookieSession/NewBearerToken with NewSession requiring unique sessionID
  • Add NewHeadlessSession for stateless JWT tokens
  • Introduce ToCookie/ToAuth for HTTP transport layer separation
  • Replace LoadCookie/LoadBearer/LoadHeadless with FromCookie/FromAuth
  • Fix LogoutCookie to use Decommission(token) instead of Revoke(key)
  • Fix LogoutAuth to handle both bearer and headless tokens properly
  • Update all tests to use new API and verify session isolation

This design prevents session collisions by requiring users to provide unique session IDs, and separates session logic from HTTP transport.

🤖 Generated with Claude Code

noxecane and others added 5 commits July 1, 2025 21:15
- Replace NewCookieSession/NewBearerToken with NewSession requiring unique sessionID
- Add NewHeadlessSession for stateless JWT tokens
- Introduce ToCookie/ToAuth for HTTP transport layer separation
- Replace LoadCookie/LoadBearer/LoadHeadless with FromCookie/FromAuth
- Fix LogoutCookie to use Decommission(token) instead of Revoke(key)
- Fix LogoutAuth to handle both bearer and headless tokens properly
- Update all tests to use new API and verify session isolation

This design prevents session collisions by requiring users to provide
unique session IDs, and separates session logic from HTTP transport.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Replace LoadBearer/LoadCookie/LoadHeadless calls with FromAuth/FromCookie
- Maintains backward compatibility for existing API middleware

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Replace interface{} with any type alias for Go 1.18+ compatibility
- Standardize error message capitalization

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Emphasize creating logical commit history over just saving work
- Add requirement to analyze changes with git status/diff first
- Clarify that unrelated changes should never be batched together
- Add explicit guidance for documentation and maintenance commits

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Fix phrasing to emphasize logical organization over preservation
- Strengthen requirement to always analyze changes first
- Add explicit separation of documentation and maintenance commits

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@noxecane noxecane merged commit 2f0c6ef into master Jul 1, 2025
1 check passed
@noxecane noxecane deleted the feat/session-store branch July 1, 2025 21:11
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