Adds EuroScope file management API endpoints - #31
Merged
Conversation
Implements comprehensive file management system for EuroScope with ICAO-based organization. Provides public file listing endpoint for retrieving files by airport code and authenticated endpoints for upload/delete operations. Includes access control integration with division system to ensure users can only manage files for airports they have permission to access. Enforces file size limits and restricts each ICAO to maximum 2 files to prevent storage abuse.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a comprehensive file management API for EuroScope with ICAO-specific file organization. The implementation adds endpoints for listing, uploading, and deleting files with proper authentication and access control mechanisms.
- Adds public file listing endpoint for retrieving files by ICAO code
- Implements authenticated file upload with size limits and ICAO access validation
- Provides file deletion capabilities with proper authorization checks
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.
This pull request introduces new EuroScope endpoints for managing and retrieving files associated with specific ICAO codes. The changes include adding routes for listing, uploading, and deleting files, with robust validation and user authentication mechanisms.
New EuroScope Endpoints:
Added a GET endpoint (
/euroscope/files/:icao) to list public files for a given ICAO code. This includes validation of the ICAO format and response formatting for client ease of use.Added a POST endpoint (
/euroscope/upload) to upload files to ICAO-specific folders. This includes file validation (type, size, and ICAO format), user access checks, and a limit of 2 files per ICAO.Added a DELETE endpoint (
/euroscope/files/:icao/:filename) to delete specific files. This includes user access checks and validation of the ICAO format.Middleware and Authentication:
These changes enhance the application's functionality for managing ICAO-related files while ensuring security and proper access control.