Skip to content

fix: Remove unused SESSION_SECRET from entire codebase#110

Merged
jdutton merged 3 commits into
mainfrom
fix/remove-unused-session-secret
Dec 20, 2025
Merged

fix: Remove unused SESSION_SECRET from entire codebase#110
jdutton merged 3 commits into
mainfrom
fix/remove-unused-session-secret

Conversation

@jdutton

@jdutton jdutton commented Dec 20, 2025

Copy link
Copy Markdown
Owner

Summary

Removes SESSION_SECRET configuration that was defined but never actually used anywhere in the codebase. This cleans up technical debt that suggested cookie-based session management when the project actually uses header-based session tracking.

Problem

SESSION_SECRET was defined in configuration, templates, and documentation but never consumed by any code:

  • ❌ No express-session or cookie-parser packages
  • ❌ No cookie signing operations
  • ❌ No cryptographic use of the secret
  • ✅ Sessions tracked via mcp-session-id HTTP header instead
  • ✅ OAuth uses standard Bearer tokens

This created confusion about what security features existed and added unnecessary configuration burden.

Changes

Source Code (5 files)

  • Remove SessionSecretSchema from packages/config/src/base-config.ts
  • Remove SESSION_SECRET from environment configuration
  • Remove sessionSecret from all HTTP server interfaces and types
  • Remove sessionSecret parameter from transport factory

Tests (15 files)

  • Remove SESSION_SECRET assertions from config tests
  • Remove sessionSecret from all test mocks and fixtures
  • All tests continue to pass

Documentation (4 files)

  • Remove SESSION_SECRET from API documentation
  • Remove from production checklists
  • Remove from deployment guides
  • Remove from OAuth setup instructions

Templates & Config (2 files)

  • Remove from scaffolding templates (.hbs files)
  • Remove from .env examples

Impact

  • 22 files modified
  • 82 deletions, 7 insertions
  • Zero functional changes - SESSION_SECRET was never used
  • No breaking changes - removing unused configuration

Testing

✅ All validation passed:

  • TypeScript compilation
  • ESLint (zero errors)
  • Unit tests (26.5s)
  • Integration tests (13.9s)
  • System tests - STDIO (10.3s)
  • System tests - HTTP (17s)
  • Headless browser tests (67s)
  • OpenAPI validation
  • Security scanning (gitleaks)

Verification

Thoroughly searched entire codebase for all variations:

  • SESSION_SECRET
  • sessionSecret
  • session-secret
  • session_secret

Result: Zero references remain

Rationale

Keeping unused configuration:

  • ❌ Creates confusion about security features
  • ❌ Suggests functionality that doesn't exist
  • ❌ Adds maintenance burden
  • ❌ Misleads users about required setup

Removing it:

  • ✅ Clarifies actual session management approach
  • ✅ Reduces configuration complexity
  • ✅ Eliminates technical debt
  • ✅ Prevents misleading documentation

🤖 Generated with Claude Code

jdutton and others added 3 commits December 5, 2025 14:02
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Remove SESSION_SECRET configuration that was never actually used.
The project uses header-based session tracking (mcp-session-id)
instead of cookie-based sessions, making SESSION_SECRET unnecessary.

Changes:
- Remove SessionSecretSchema from config package
- Remove SESSION_SECRET from environment configuration
- Remove sessionSecret from all HTTP server interfaces
- Remove SESSION_SECRET from all templates and .env examples
- Remove SESSION_SECRET from documentation
- Fix all tests that referenced the removed configuration

Impact:
- 22 files modified, 82 deletions
- No functional changes - SESSION_SECRET was never consumed
- All validation tests pass (unit, integration, system)

Rationale: SESSION_SECRET was defined in configuration but never
used anywhere in the codebase. Sessions are tracked via HTTP headers
(mcp-session-id) not cookies, and OAuth uses Bearer tokens. This
removes confusing technical debt that suggested cookie-based session
management that doesn't exist.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@jdutton jdutton merged commit d07972f into main Dec 20, 2025
7 checks passed
@jdutton jdutton deleted the fix/remove-unused-session-secret branch December 20, 2025 16:39
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