Fix repository API endpoints and tests#55
Merged
ngocbd merged 8 commits intoAI-Decenter:mainfrom Sep 19, 2025
buihaigiap:main
Merged
Fix repository API endpoints and tests#55ngocbd merged 8 commits intoAI-Decenter:mainfrom buihaigiap:main
ngocbd merged 8 commits intoAI-Decenter:mainfrom
buihaigiap:main
Conversation
✅ Fixed repository management endpoints:
- Added JWT authentication with created_by field
- Implemented missing GET /repos/{namespace}/repositories/{name} endpoint
- Fixed DELETE endpoint to return 200 OK with success message instead of 204
- Added proper error handling and access control
✅ Fixed repository routes:
- Added get_repository route mapping
- Fixed route organization and structure
✅ Updated test expectations:
- Changed DELETE test to expect 200 instead of 204
- All 62 integration tests now pass
✅ Auto-start server functionality:
- runtest.sh already had auto-start capability
- Tests can now run fully automated with ./runtest.sh
Fixes repository creation, listing, retrieval, and deletion workflows.
All repository API tests now pass successfully.
- Add manifest content storage to S3 in put_manifest_impl()
- Store manifests using blobs/{digest} path format for consistency
- Ensure both blobs and manifests are persisted to S3 storage
- Fix Docker Registry v2 API compliance for proper image storage
- Fixed str Sized compilation errors in docker_registry_v2.rs - Added proper Docker authentication support with docker_auth.rs module - Implemented JWT and Basic auth for Docker registry operations - Added organization-level registry authentication migration - Enhanced repository permission checking for pull/push operations - Added comprehensive Docker workflow tests - Updated cache and database storage tests - Fixed type inference issues with user_id handling
- Fixed incomplete response tuples in put_manifest_impl function - Added proper JSON responses to all error return statements - Fixed 500 internal server errors in Docker Registry V2 manifest upload - Ensured all HTTP responses have proper StatusCode, Headers, and JSON body structure
- Simplified server startup process (cargo run & instead of complex env setup) - Reduced server startup wait from 60s to 20s - Removed verbose pre-test verification and logging - Removed failure handling section for cleaner workflow - Maintains core functionality while improving readability
Major improvements: - Fix service port configurations (Redis: 6380, MinIO: 9001/9002) - Add manifest content caching in memory as S3 fallback - Implement manifest storage in both S3 and memory cache - Fix production binary compilation with manifest_cache field - Add database migration for manifest content column - Update test runner with correct service ports - Add database cleanup utilities Docker Registry V2 enhancements: - Retrieve actual manifest content from S3 storage - Fallback to memory cache when S3 fails - Store manifest content in both S3 and memory for reliability - Improve manifest get/put operations with proper content handling Infrastructure fixes: - Correct Redis port mapping in docker-compose - Fix PostgreSQL port (5434) and MinIO ports in test scripts - Add production optimizations with proper background tasks - Include manifest cache in AppState for both main and production binaries Test improvements: - Update runtest.sh with proper service health checks - More lenient test result handling - Clear existing manifests for fresh testing All Docker Registry V2 APIs working correctly with server successfully running on port 8080 and processing authentication requests.
✨ Features added: - Auto frontend dev server startup in debug mode - Production build with embedded static files - Single command deployment (cargo run) - SPA routing support with fallback - TypeScript fixes (process.env -> import.meta.env) 🔧 Technical changes: - Added build.rs for automatic frontend building - Updated lib.rs to serve static files - Added main.rs auto-spawn frontend dev server - Fixed Vite config with proper proxy settings - Updated tsconfig.json for Vite client types - Added tower-http fs feature for static serving 📁 File management: - Added dist/ to .gitignore (auto-generated) - Cleaned up redundant development scripts - Streamlined development workflow 🚀 Usage: - Development: cargo run (auto FE+BE) - Production: cargo run --release (embedded) - Frontend: http://localhost:5173 (dev) - Backend: http://localhost:8080 (always) - Docs: http://localhost:8080/docs
✨ Features Added: - Change password API (/auth/change-password) with current password verification - Forgot password API (/auth/forgot-password) with simplified email-based reset - Password length validation (minimum 8 characters) for registration and password changes - Comprehensive input validation and error handling 🔧 Security Enhancements: - Enabled password length validation in user registration - JWT token verification for password change operations - Argon2 password hashing for new passwords - Cache invalidation after password changes 📚 API Documentation: - Added OpenAPI/Swagger documentation for new endpoints - Complete request/response schemas - Authentication requirements specified 🧪 Testing: - Fixed test_registration_short_password assertion bug - Added comprehensive test coverage for password management - All authentication tests now passing 🗂️ Code Structure: - Added new request/response DTOs for password operations - Enhanced auth routes with PUT and POST endpoints - Clean error handling with appropriate HTTP status codes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✅ Fixed repository management endpoints:
✅ Fixed repository routes:
✅ Updated test expectations:
✅ Auto-start server functionality:
Fixes repository creation, listing, retrieval, and deletion workflows. All repository API tests now pass successfully.