FastAPI
Description​
FastAPI is a modern, high-performance web framework for building APIs with Python based on standard Python type hints. The key features of FastAPI include automatic data model validation, serialisation, and documentation with OpenAPI and JSON Schema. It supports asynchronous request handling, allowing it to handle large volumes of requests simultaneously, and it is also designed to be easy to use while ensuring optimal performance, making it a popular choice for creating scalable and maintainable web applications.
General details​
- Developer(s): Sebastián RamÃrez, with minor contributions from other developers.
- Open source: Yes
- Language(s): Python
- Repository: https://github.com/tiangolo/fastapi
- License: MIT
- Operating system(s): OS Independent
- Actively maintained: Yes (less than a week ago)
Intended use on the device​
The SOUP is used in the medical device for the following specific purposes only:
- Implement the REST APIs serving as the entry point for each microservice and AI inference service that make up the device.
- Utilise the built-in security mechanisms (OAuth 2.0) to implement user authentication and authorisation functionalities for the device.
Requirements​
For the integration and safe usage of this SOUP within a software system, it's important to outline both functional and performance requirements. These requirements help mitigate risks and ensure compatibility and performance standards are met.
Functional​
- API route definitions: Allow for the definition of multiple API routes, supporting various HTTP methods (GET, POST, PUT, DELETE) with clear and concise syntax. Each route should be capable of handling request parameters, body payloads, and producing appropriate responses.
- Data validation and serialisation: Provide mechanisms for request data validation and serialisation using
Pydantic
models or similar techniques. This includes the automatic generation of OpenAPI documentation based on these models. - Authentication and authorisation: Support authentication mechanisms (e.g., OAuth2, JWT tokens) and provide hooks for implementing permission-based access control to protect API endpoints.
- Asynchronous support: Fully support asynchronous route handlers, allowing for non-blocking I/O operations, which are crucial for IO-bound tasks such as accessing databases.
- Dependency injection: Offer a straightforward way to manage dependencies through dependency injection, enabling reusable components and shared functionality across different parts of the application.
- Error handling and logging: Include robust error handling capabilities, allowing for the definition of custom error responses. Additionally, it should facilitate logging of requests, responses, and application errors in a structured format.
Performance​
- Response time: Ensure fast response times, aiming for sub-second latency for handling requests under typical load conditions. Performance benchmarks should be publicly available to demonstrate this capability.
- Scalability: Capable of scaling horizontally to manage increased load, with support for running in a containerised environment (e.g., Docker) and orchestration tools like Kubernetes for easy deployment and scaling.
- Resource efficiency: Have a low memory footprint and efficiently manage resources, especially under high concurrency scenarios, to support a large number of simultaneous connections without degradation in performance.
- Rate limiting: To prevent abuse and ensure equitable resource use among consumers, it should offer built-in or easily integrable rate limiting features.
- Concurrency handling: It should excel in handling concurrent requests efficiently, leveraging modern Python features like async/await.
- Caching: Support for response caching mechanisms to reduce load on the server and improve response times for frequently accessed data.
System requirements​
Establishing minimum software and hardware requirements is important to mitigate risks, such as security vulnerabilities, performance issues, or compatibility problems, and to ensure that the SOUP functions effectively within the intended environment.
Software​
After evaluation, we find that there are no specific software requirements for this SOUP. It works properly on standard computing devices, which includes our environment.
Hardware​
After evaluation, we find that there are no specific hardware requirements for this SOUP. It works properly on standard computing devices, which includes our environment.
Documentation​
The official SOUP documentation can be found at: https://fastapi.tiangolo.com/
Additionally, a criterion for validating the SOUP is that all the items of the following checklist are satisfied:
- The vendor maintains clear and comprehensive documentation of the SOUP describing its functional capabilities, user guidelines, and tutorials, which facilitates learning and rapid adoption.
- The documentation for the SOUP is regularly updated and clearly outlines every feature utilised by the medical device, doing so for all integrated versions of the SOUP.
Related software items​
We catalog the interconnections between the microservices within our software architecture and the specific versions of the SOUP they utilise. This mapping ensures clarity and traceability, facilitating both the understanding of the system's dependencies and the management of SOUP components.
Although the title of the section mentions software items, the relationship with SOUP versions has been established with microservices (also considered software items, by the way) because each one is inside a different Docker container and, therefore, has its own isolated runtime environment.
SOUP version | Software item(s) |
---|---|
0.110.0 | WEB API GATEWAYREPORT BUILDER AGPPGA ALADIN APASI-API APASI-SEGMENTER APASI-CLASSIFIERAPULSI ASALT ASCORAD-API ASCORAD-SEGMENTERASCORAD-CLASSIFIER AUAS AIHS4 NSIL ICD MULTICLASS CLASSIFIER ICD BINARY CLASSIFIER BINARY REFERRER QUALITY VALIDATOR DOMAIN VALIDATOR |
Related risks​
The following are risks applicable to this SOUP from the table found in document R-TF-013-002 Risk management record_2023_001
:
- 58. SOUP presents an anomaly that makes it incompatible with other SOUPs or with software elements of the device.
- 59. SOUP is not being maintained nor regularly patched.
- 60. SOUP presents cybersecurity vulnerabilities.
Lists of published anomalies​
The incidents, anomalies, known issues or changes between versions for this SOUP can be found at:
History of evaluation of SOUP anomalies​
23 Feb 2024​
- Reviewer of the anomalies: Alejandro Carmena Magro
- Version(s) of the SOUP reviewed: 0.110.0.
No anomalies have been found.
Record signature meaning​
- Author: JD-004
- Reviewer: JD-003
- Approver: JD-005