[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.git
repository 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-fpm
andfastapi
Docker-contained services. Ourcgit
services are not accessible by the host, and they're pretty much hard coded to provide two cgit instances with differentclone-prefix
configurations 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-auth
run 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.py
aurweb/routers/rpc.py
-
fastapi: Complete RPC [2] - @kevr - Note: The
v
query parameter is now required. - Note: We must only support
v5
. - Note: The
get-comment-form
type has been removed. - Use
aurweb.packages.search.PackageSearch
fortype=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_required
decorator which can be used in place ofauth_required
. - Add error mappings for
credential_required
failures (this will additionally require that we supply a way to givecredential_required
the 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 packages
andpkgbase
logic- Move
pkgbase
routes 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