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
- Fork the repo and create a branch
git checkout -b feature/v1-sunset-410
- Implement changes
app/api/streams/route.ts, app/api/streams/[id]/route.ts
app/lib/api-version.ts — header + sunset helpers
- 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
Guidelines
- Minimum 90% test coverage including pre/post sunset
- Clear documentation and inline comments
- Timeframe: 96 hours
Description
The README and
app/lib/api-version.tsdefine a deprecation policy where/api/v1/streams/*and the/api/streams/*alias must carryDeprecation/Sunsetheaders and return410 Goneafter 2026-12-31, butapp/api/streams/route.tsdoes 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
DeprecationandSunset(RFC 9745) headers to every response from the v1/alias stream routes.410 Gonewith a machine-readable body linking todocs/api-v2-migration.md.Suggested Execution
app/api/streams/route.ts,app/api/streams/[id]/route.tsapp/lib/api-version.ts— header + sunset helpersnpm test -- app/lib/api-version.test.ts app/api/streamsExample commit message
Acceptance Criteria
Deprecation+Sunsetheaders410 Gonewith migration linkGuidelines