Due to an influx of spam, we have had to temporarily disable account registrations. Please write an email to accountsupport@archlinux.org, with your desired username, if you want to get access. Sorry for the inconvenience.
2 seconds of delay for the SSH auth (because sshd calls it twice), probably another second when launching aurweb-git-serve. So a total of 3 seconds startup delay caused by poetry.
auth.py query on SSHPubKeys table joined with Users table but the WHERE statement has WHERE SSHPubKeys.PubKey = ? and the PubKey column is not indexed. So for each ssh auth we scan the whole sshpubkey table twice.
infrastructure!612 (merged) fixes the poetry being slow issue by not using it. aurweb-git-auth still takes around ~500ms and like 99% of the time is spent importing aurweb.db.
Bit of a hack to avoid importing aurweb.db (and thus aurweb.util and sqlalchemy), but it brings aurweb-git-auth's runtime down to 70 ms (from 1s) in my tests: !500 (closed)
After looking through this, I would've came up with the exact same solution here that @foutrelis did. The bootstrapping of ORM just makes this so much slower.
Your MR looks great; I'll just do some double-triple check on it, but I believe this would be fine.
I don't really consider this to be a hack. It's just using the raw DB connection as was done originally.