Skip to content

Enforce 410 Gone for sunset v1 stream paths per the documented deprecation policy #244

@greatest0fallt1me

Description

@greatest0fallt1me

Description

The README and app/lib/api-version.ts define a deprecation policy where /api/v1/streams/* and the /api/streams/* alias must carry Deprecation/Sunset headers and return 410 Gone after 2026-12-31, but app/api/streams/route.ts does not emit these headers or enforce the sunset. Implement the deprecation/sunset behavior server-side. This is a backend API-lifecycle feature.

Requirements and Context

  • Add Deprecation and Sunset (RFC 9745) headers to every response from the v1/alias stream routes.
  • After the configured sunset date, return 410 Gone with a machine-readable body linking to docs/api-v2-migration.md.
  • Drive the sunset date from config so it is testable without waiting for the real date.
  • Must be secure, tested, and documented
  • Should be efficient and easy to review

Suggested Execution

  1. Fork the repo and create a branch
    git checkout -b feature/v1-sunset-410
  2. Implement changes
    • app/api/streams/route.ts, app/api/streams/[id]/route.ts
    • app/lib/api-version.ts — header + sunset helpers
  3. Test and commit
    • npm test -- app/lib/api-version.test.ts app/api/streams
    • Cover edge cases: pre-sunset headers, post-sunset 410, body link present
    • Include test output and notes in the PR

Example commit message

feat: enforce v1 deprecation headers and 410 sunset

Acceptance Criteria

  • v1/alias responses carry Deprecation + Sunset headers
  • Post-sunset requests return 410 Gone with migration link
  • Sunset date is config-driven and testable
  • Coverage ≥ 90% for the version helpers

Guidelines

  • Minimum 90% test coverage including pre/post sunset
  • Clear documentation and inline comments
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programapiAPI endpoint/contract workbackendBackend service workenhancementNew feature or improvement
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions