feat: 1.5.0 prep — API v1 cutover, LICENSE, CHANGELOG, CI
- Remove legacy /api/ mount; all routes now under /api/v1/ only - Update path matchers (CSRF excludes, public routes, audit log, rate limits) - Move standalone routes (/api/network/ips, /api/docs, /api/docs/spec) to v1 - Update openapi.yaml (110 paths), CA pages, and 4 lingering frontend files - Add LICENSE (proprietary EULA), CHANGELOG.md (Keep a Changelog format) - Add .gitea/workflows/ci.yml (test+lint and security audit jobs) - Fix 9 pre-existing no-empty lint errors so CI starts green - Drop ad-hoc scratch reports and *.bak files from repo root All 739 jest tests pass. Lint is clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -169,7 +169,7 @@ describe('CSRF Protection', () => {
|
||||
const origEnv = process.env.NODE_ENV;
|
||||
process.env.NODE_ENV = 'production';
|
||||
|
||||
const excludedPaths = ['/api/totp/verify', '/api/totp/setup', '/health', '/api/health'];
|
||||
const excludedPaths = ['/api/v1/totp/verify', '/api/v1/totp/setup', '/health', '/api/v1/health'];
|
||||
for (const excludedPath of excludedPaths) {
|
||||
const { req, res, next } = createMockReqRes({ method: 'POST', path: excludedPath });
|
||||
csrfValidationMiddleware(req, res, next);
|
||||
@@ -184,7 +184,7 @@ describe('CSRF Protection', () => {
|
||||
process.env.NODE_ENV = 'production';
|
||||
|
||||
const { req, res, next } = createMockReqRes({
|
||||
method: 'POST', path: '/api/auth/gate/plex'
|
||||
method: 'POST', path: '/api/v1/auth/gate/plex'
|
||||
});
|
||||
csrfValidationMiddleware(req, res, next);
|
||||
expect(next).toHaveBeenCalled();
|
||||
@@ -296,7 +296,7 @@ describe('CSRF Protection', () => {
|
||||
process.env.NODE_ENV = origEnv;
|
||||
});
|
||||
|
||||
it('normalizes /api/v1/ prefix for exclusion matching', () => {
|
||||
it('excludes /api/v1/ paths directly', () => {
|
||||
const origEnv = process.env.NODE_ENV;
|
||||
process.env.NODE_ENV = 'production';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user