feat: implement authentication routes with login, logout, and user info retrieval

feat: add S3 bucket versioning support and related XML response handling

refactor: rename temporary file paths from 'teleuploader' to 'filedrop' for consistency

fix: update Swagger documentation to reflect new API name and descriptions

test: add unit tests for authentication routes and utilities

test: implement end-to-end tests for S3 bucket configuration and versioning

chore: update environment variable defaults for new service name
This commit is contained in:
asepharyana
2026-07-07 19:58:15 +07:00
parent 144ebe6dd3
commit 340c12d671
28 changed files with 898 additions and 52 deletions
+9
View File
@@ -12,6 +12,9 @@ describe('Environment Variables Validation', () => {
expect(config).toHaveProperty('logLevel');
expect(config).toHaveProperty('rateLimitWindowMs');
expect(config).toHaveProperty('rateLimitMaxRequests');
expect(config).toHaveProperty('adminApiToken');
expect(config).toHaveProperty('sessionCookieName');
expect(config).toHaveProperty('sessionMaxAgeMs');
});
it('config.botToken should return BOT_TOKEN from process.env', () => {
@@ -42,4 +45,10 @@ describe('Environment Variables Validation', () => {
it('rateLimitMaxRequests should default to 150 when not specified', () => {
expect(config.rateLimitMaxRequests).toBe(150);
});
it('auth config should be disabled by default with a 24 hour session', () => {
expect(config.adminApiToken).toBe(process.env.ADMIN_API_TOKEN || '');
expect(config.sessionCookieName).toBe(process.env.SESSION_COOKIE_NAME || 'tu_session');
expect(config.sessionMaxAgeMs).toBe(86400 * 1000);
});
});