[FastAPI] Home stretch
This issue will keep track of our "final" steps to implementing the basis of aurweb with FastAPI.
Tasks
-
docker: Host-configurable mariadb service - @fluix !200 (merged) - We need to provide the Docker host a way to provide an instance of mariadb from the host to the container.
-
docker: Host-configurable git service - @fluix !201 (merged) - We need to configure production Docker to bind-mount an external
aur.gitrepository into the container.
- We need to configure production Docker to bind-mount an external
-
docker: Host-configurable cgit services - @fluix - In production, nginx is externally used as a front-end to the
php-fpmandfastapiDocker-contained services. Ourcgitservices are not accessible by the host, and they're pretty much hard coded to provide two cgit instances with differentclone-prefixconfigurations for PHP and FastAPI (separately). We need to make this configurable by the host so they can plugin to our cgit services via their external nginx.
- In production, nginx is externally used as a front-end to the
-
docker: Create bridge service for aurweb-git-auth- @kevr- In production, the Docker host wishes to manage SSH authentication for different reasons: server access (1) and AUR ssh/git access (2). For this reason, a local RPC API is needed to allow the host to configure a particular user (example: 'aur') to access
aurweb-git-authrun inside of a Docker container, while allowing other users to authenticate as they normally would.
- In production, the Docker host wishes to manage SSH authentication for different reasons: server access (1) and AUR ssh/git access (2). For this reason, a local RPC API is needed to allow the host to configure a particular user (example: 'aur') to access
-
fastapi: Rework RPC [1] - @kevr !203 (merged) aurweb/rpc.pyaurweb/routers/rpc.py
-
fastapi: Complete RPC [2] - @kevr - Note: The
vquery parameter is now required. - Note: We must only support
v5. - Note: The
get-comment-formtype has been removed. - Use
aurweb.packages.search.PackageSearchfortype=search.
- Note: The
-
fastapi: Implement /metrics- @kevr- https://github.com/trallnag/prometheus-fastapi-instrumentator
- See #17 (closed) for elaboration.
-
fastapi: Rework all auth requirements to depend on credentials - Create a new
credential_requireddecorator which can be used in place ofauth_required. - Add error mappings for
credential_requiredfailures (this will additionally require that we supply a way to givecredential_requiredthe proper template and context it'll need to render the page which the error should be displayed on.
- Create a new
-
fastapi: Review the aurweb.session.Session model - We should modify this to support multiple sessions. A user may login from multiple machines and each machine should have their own session.
-
fastapi: Produce benchmarks of every route using hyperfine or oha. -
fastapi: Separate packagesandpkgbaselogic- Move
pkgbaseroutes into their own router:aurweb/routers/pkgbase.py - Move all non-router callbacks to other aurweb modules. We should keep router files only defining routes, nothing more. This will keep code clean and more organized.
- Move
-
fastapi: User.ResetKey should have an expiration (optional) -
fastapi: Unify all CASCADE related backrefs. - For CASCADE to properly work when a child class creates a backref on a parent class, the
cascade="all, delete"argument must be supplied. This is done where required at the moment, but should be done in all cases.
- For CASCADE to properly work when a child class creates a backref on a parent class, the
After these tasks, we'll need to focus more on testing and fixing any unintended inconsistencies in the project.
Edited by Leonidas Spyropoulos