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
+10 -3
View File
@@ -1,12 +1,12 @@
/**
* S3 compatibility E2E tests using the official AWS SDK v3.
*
* Tests that the TeleUploader S3 gateway is compatible with standard
* Tests that the file storage gateway is compatible with standard
* AWS SDK clients. All operations are exercised against the production
* endpoint.
*
* Prerequisites (env vars):
* - S3_ACCESS_KEY (default: teleuploader-admin)
* - S3_ACCESS_KEY (default: filedrop-admin)
* - S3_SECRET_KEY (required)
* - BASE_URL (default: https://upload.asepharyana.my.id)
*
@@ -26,6 +26,7 @@ import {
DeleteBucketCommand,
DeleteObjectCommand,
DeleteObjectsCommand,
GetBucketVersioningCommand,
GetObjectCommand,
HeadBucketCommand,
HeadObjectCommand,
@@ -42,7 +43,7 @@ import {
// ── Config ───────────────────────────────────────────────────────────────────
const BASE_URL = process.env.BASE_URL || 'https://upload.asepharyana.my.id';
const S3_KEY = process.env.S3_ACCESS_KEY || 'teleuploader-admin';
const S3_KEY = process.env.S3_ACCESS_KEY || 'filedrop-admin';
const S3_SECRET = process.env.S3_SECRET_KEY;
const TS = Date.now().toString(36);
@@ -133,6 +134,12 @@ describe('S3 SDK compatibility', () => {
);
});
it('GetBucketVersioning returns disabled configuration for Gitea compatibility', async () => {
const versioning = await s3.send(new GetBucketVersioningCommand({ Bucket: BUCKET }));
expect(versioning.Status).toBeUndefined();
expect(versioning.MFADelete).toBeUndefined();
});
// ── Object operations ──────────────────────────────────────────────────────
it('PutObject stores text content', async () => {